From 870b788558bb24108b85547a4a1cef1f307f765995cfd5d1422baea0486da071 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 6 May 2020 02:34:31 +0000 Subject: [PATCH 1/3] - Convert to multibuild to break a self-requires loop. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wcwidth?expand=0&rev=19 --- _multibuild | 3 +++ python-wcwidth.changes | 5 +++++ python-wcwidth.spec | 9 +++++++++ 3 files changed, 17 insertions(+) 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-wcwidth.changes b/python-wcwidth.changes index 481019c..280905a 100644 --- a/python-wcwidth.changes +++ b/python-wcwidth.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 6 02:25:29 UTC 2020 - Steve Kowalik + +- Convert to multibuild to break a self-requires loop. + ------------------------------------------------------------------- Wed Mar 25 14:31:41 UTC 2020 - pgajdos@suse.com diff --git a/python-wcwidth.spec b/python-wcwidth.spec index a0e1932..c4dc192 100644 --- a/python-wcwidth.spec +++ b/python-wcwidth.spec @@ -17,6 +17,11 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%if "%{flavor}" == "test" +%bcond_without test +%else +%bcond_with test +%endif Name: python-wcwidth Version: 0.1.9 Release: 0 @@ -25,7 +30,9 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/jquast/wcwidth Source: https://files.pythonhosted.org/packages/source/w/wcwidth/wcwidth-%{version}.tar.gz +%if %{with test} BuildRequires: %{python_module pytest} +%endif BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -60,7 +67,9 @@ release files, which this project aims to track. } %check +%if %{with test} %pytest +%endif %files %{python_files} %license LICENSE.txt From aa41020dd6ca31d4af3646444d7cccd7650122dc42117437aeadf8d792310d87 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 6 May 2020 09:37:05 +0000 Subject: [PATCH 2/3] Don't share Name between flavors, and don't install for test flavor OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wcwidth?expand=0&rev=20 --- python-wcwidth.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python-wcwidth.spec b/python-wcwidth.spec index c4dc192..bb3190c 100644 --- a/python-wcwidth.spec +++ b/python-wcwidth.spec @@ -1,5 +1,5 @@ # -# spec file for package python-wcwidth +# spec file for package python # # Copyright (c) 2020 SUSE LLC # @@ -19,10 +19,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %if "%{flavor}" == "test" %bcond_without test +%define psuffix -%{flavor} %else %bcond_with test +%define psuffix %{nil} %endif -Name: python-wcwidth +Name: python-wcwidth%{psuffix} Version: 0.1.9 Release: 0 Summary: Number of Terminal column cells of wide-character codes @@ -59,21 +61,26 @@ release files, which this project aims to track. %python_build %install +%if ! %{with test} %python_install # Remove tests from runtime %{python_expand rm -r %{buildroot}%{$python_sitelib}/wcwidth/tests/ %fdupes %{buildroot}%{$python_sitelib} } +%endif %check %if %{with test} %pytest %endif +%if ! %{with test} + %files %{python_files} %license LICENSE.txt %doc README.rst %{python_sitelib}/* +%endif %changelog From a2929d0c6eb977089b43fd4c2048f11b8eee89fd553f7b8ce872153490ed1ac3 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 6 May 2020 09:58:14 +0000 Subject: [PATCH 3/3] Specify flavor from BUILD_FLAVOR OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wcwidth?expand=0&rev=21 --- python-wcwidth.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python-wcwidth.spec b/python-wcwidth.spec index bb3190c..aa34c43 100644 --- a/python-wcwidth.spec +++ b/python-wcwidth.spec @@ -17,6 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %bcond_without test %define psuffix -%{flavor}