From 1e6c011ee05b4696d453612f846d0c3b0e52360bdffbd5e8f4062e6c51b486ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 28 May 2020 07:35:21 +0000 Subject: [PATCH] Accepting request 809574 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/809574 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-catkin-pkg?expand=0&rev=9 --- python-catkin-pkg.changes | 6 ++++++ python-catkin-pkg.spec | 36 ++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/python-catkin-pkg.changes b/python-catkin-pkg.changes index 28aac6d..f9bd959 100644 --- a/python-catkin-pkg.changes +++ b/python-catkin-pkg.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 27 09:36:36 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative +- use %pytest + ------------------------------------------------------------------- Mon Mar 30 12:51:38 UTC 2020 - Marketa Calabkova diff --git a/python-catkin-pkg.spec b/python-catkin-pkg.spec index 620b06c..f5af276 100644 --- a/python-catkin-pkg.spec +++ b/python-catkin-pkg.spec @@ -17,6 +17,8 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define commands create_pkg find_pkg generate_changelog package_version prepare_release tag_changelog test_changelog + Name: python-catkin-pkg Version: 0.4.16 Release: 0 @@ -32,13 +34,15 @@ Requires: python-docutils Requires: python-pyparsing Requires: python-python-dateutil Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module docutils} BuildRequires: %{python_module flake8} BuildRequires: %{python_module mock} -BuildRequires: %{python_module nose} BuildRequires: %{python_module pyparsing} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-dateutil} # /SECTION %python_subpackages @@ -54,23 +58,35 @@ Library for retrieving information about catkin packages. %install %python_install +for c in %{commands}; do + %python_clone -a %{buildroot}%{_bindir}/catkin_$c +done %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export PYTHONPATH=$PWD/src -cd test # flake8 line length checks failing (E501) -%python_exec %{_bindir}/nosetests --exclude=test/test_flake8.py +%pytest -k 'not test_flake8' + +%post +for c in %{commands}; do + %python_install_alternative catkin_$c +done + +%postun +for c in %{commands}; do + %python_uninstall_alternative catkin_$c +done %files %{python_files} %license LICENSE -%python3_only %{_bindir}/catkin_create_pkg -%python3_only %{_bindir}/catkin_find_pkg -%python3_only %{_bindir}/catkin_generate_changelog -%python3_only %{_bindir}/catkin_package_version -%python3_only %{_bindir}/catkin_prepare_release -%python3_only %{_bindir}/catkin_tag_changelog -%python3_only %{_bindir}/catkin_test_changelog +%python_alternative %{_bindir}/catkin_create_pkg +%python_alternative %{_bindir}/catkin_find_pkg +%python_alternative %{_bindir}/catkin_generate_changelog +%python_alternative %{_bindir}/catkin_package_version +%python_alternative %{_bindir}/catkin_prepare_release +%python_alternative %{_bindir}/catkin_tag_changelog +%python_alternative %{_bindir}/catkin_test_changelog %{python_sitelib}/* %changelog