From 9e071f18c44e5b611e3166d148fab484e65faf1005f47b424edf1af0261e2475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 19 Nov 2019 11:06:57 +0000 Subject: [PATCH 1/3] Accepting request 749497 from home:frispete:python - Create multibuild for testing in order to cope with a circular dependency with python-cliff - Clean up spec file OBS-URL: https://build.opensuse.org/request/show/749497 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stestr?expand=0&rev=28 --- _multibuild | 3 +++ python-stestr.changes | 7 +++++++ python-stestr.spec | 44 +++++++++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-stestr.changes b/python-stestr.changes index baf48c6..762c18b 100644 --- a/python-stestr.changes +++ b/python-stestr.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Nov 17 17:19:01 UTC 2019 - Hans-Peter Jansen + +- Create multibuild for testing in order to cope with a circular + dependency with python-cliff +- Clean up spec file + ------------------------------------------------------------------- Wed Oct 30 13:17:37 UTC 2019 - Dirk Mueller diff --git a/python-stestr.spec b/python-stestr.spec index a21c89d..f9bb198 100644 --- a/python-stestr.spec +++ b/python-stestr.spec @@ -1,7 +1,7 @@ # -# spec file for package python-stestr +# spec file for package python # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -Name: python-stestr +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -%{flavor} +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +Name: python-stestr%{psuffix} Version: 2.5.1 Release: 0 Summary: A test runner runner similar to testrepository @@ -25,6 +33,9 @@ License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/mtreinish/stestr Source: https://files.pythonhosted.org/packages/source/s/stestr/stestr-%{version}.tar.gz +BuildRequires: %{python_module pbr >= 2.0.0} +BuildRequires: %{python_module setuptools} +%if %{with test} BuildRequires: %{python_module PyYAML >= 3.10.0} BuildRequires: %{python_module SQLAlchemy} BuildRequires: %{python_module cliff >= 2.8.0} @@ -33,13 +44,13 @@ BuildRequires: %{python_module ddt >= 1.0.1} BuildRequires: %{python_module fixtures >= 3.0.0} BuildRequires: %{python_module future} BuildRequires: %{python_module mock >= 2.0} -BuildRequires: %{python_module pbr >= 2.0.0} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-subunit >= 1.3.0} -BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.10.0} +BuildRequires: %{python_module stestr >= %{version}} BuildRequires: %{python_module testtools >= 2.2.0} BuildRequires: %{python_module voluptuous >= 0.8.9} +%endif BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-dbm @@ -77,6 +88,13 @@ and has examples. # do not test sql rm stestr/tests/repository/test_sql.py +%if %{with test} +%check +export LC_ALL="en_US.UTF8" +%python_expand py.test-%{$python_bin_suffix} -v stestr/tests -k 'not test_empty_with_pretty_out' +%endif + +%if ! %{with test} %build export LC_ALL="en_US.UTF8" %python_build @@ -87,21 +105,6 @@ export LC_ALL="en_US.UTF8" %python_clone -a %{buildroot}%{_bindir}/stestr %python_expand %fdupes %{buildroot}%{$python_sitelib} -%check -export LC_ALL="en_US.UTF8" -# test_empty_with_pretty_out - edge case not triggered in OBS -%{python_expand mkdir build/bin -for filepath in %{buildroot}/%{_bindir}/stestr*-%{$python_bin_suffix}; do - filename=$(basename $filepath) - unsuffixed=${filename/-%{$python_bin_suffix}/} - cp $filepath build/bin/$unsuffixed -done -export PATH="$(pwd)/build/bin:$PATH" -export PYTHONPATH=%{buildroot}%{$python_sitelib} -py.test-%{$python_bin_suffix} -v stestr/tests -k 'not test_empty_with_pretty_out' -rm -r build/bin -} - %post %python_install_alternative stestr @@ -113,5 +116,6 @@ rm -r build/bin %doc ChangeLog README.rst %python_alternative %{_bindir}/stestr %{python_sitelib}/* +%endif %changelog From 42f80b54a1b91bf5c32df72aac2e2e10d3ba76d1fd98f14b56c7f4f51f04a039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 19 Nov 2019 11:09:52 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stestr?expand=0&rev=29 --- python-stestr.spec | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/python-stestr.spec b/python-stestr.spec index f9bb198..3b4bc82 100644 --- a/python-stestr.spec +++ b/python-stestr.spec @@ -35,6 +35,21 @@ URL: https://github.com/mtreinish/stestr Source: https://files.pythonhosted.org/packages/source/s/stestr/stestr-%{version}.tar.gz BuildRequires: %{python_module pbr >= 2.0.0} BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: python3-dbm +Requires: python-PyYAML >= 3.10.0 +Requires: python-cliff >= 2.8.0 +Requires: python-fixtures >= 3.0.0 +Requires: python-future +Requires: python-pbr >= 2.0.0 +Requires: python-python-subunit >= 1.3.0 +Requires: python-six >= 1.10.0 +Requires: python-testtools >= 2.2.0 +Requires: python-voluptuous >= 0.8.9 +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch %if %{with test} BuildRequires: %{python_module PyYAML >= 3.10.0} BuildRequires: %{python_module SQLAlchemy} @@ -51,28 +66,13 @@ BuildRequires: %{python_module stestr >= %{version}} BuildRequires: %{python_module testtools >= 2.2.0} BuildRequires: %{python_module voluptuous >= 0.8.9} %endif -BuildRequires: fdupes -BuildRequires: python-rpm-macros -BuildRequires: python3-dbm -Requires: python-PyYAML >= 3.10.0 -Requires: python-cliff >= 2.8.0 -Requires: python-fixtures >= 3.0.0 -Requires: python-future -Requires: python-pbr >= 2.0.0 -Requires: python-python-subunit >= 1.3.0 -Requires: python-six >= 1.10.0 -Requires: python-testtools >= 2.2.0 -Requires: python-voluptuous >= 0.8.9 %ifpython3 Requires: python-dbm %endif -Requires(post): update-alternatives -Requires(postun): update-alternatives %if !0%{?_no_weakdeps} Recommends: python-SQLAlchemy Recommends: python-subunit2sql >= 1.8.0 %endif -BuildArch: noarch %python_subpackages %description @@ -91,7 +91,7 @@ rm stestr/tests/repository/test_sql.py %if %{with test} %check export LC_ALL="en_US.UTF8" -%python_expand py.test-%{$python_bin_suffix} -v stestr/tests -k 'not test_empty_with_pretty_out' +%pytest stestr/tests -k 'not test_empty_with_pretty_out' %endif %if ! %{with test} From 691cd9fbe360547ac9b0b0423ba9e68db36df473c8568e9e4fa3640a427d7f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 19 Nov 2019 11:10:13 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stestr?expand=0&rev=30 --- python-stestr.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-stestr.spec b/python-stestr.spec index 3b4bc82..de54032 100644 --- a/python-stestr.spec +++ b/python-stestr.spec @@ -1,7 +1,7 @@ # -# spec file for package python +# spec file for package python-stestr # -# Copyright (c) 2019 SUSE LLC. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed