From 276da462884c494ebb89f4cbb43a113acdf5914964d37d277fb797fd183a6479 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 16 Oct 2021 09:42:23 +0000 Subject: [PATCH] Accepting request 925059 from home:pgajdos:python - %check: use %pyunittest rpm macro - added sources + _multibuild OBS-URL: https://build.opensuse.org/request/show/925059 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=48 --- _multibuild | 3 +++ python-zope.interface.changes | 7 +++++++ python-zope.interface.spec | 29 +++++++++++++++++++++++++---- 3 files changed, 35 insertions(+), 4 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-zope.interface.changes b/python-zope.interface.changes index ad0fb93..bc6e560 100644 --- a/python-zope.interface.changes +++ b/python-zope.interface.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 13 09:49:15 UTC 2021 - pgajdos@suse.com + +- %check: use %pyunittest rpm macro +- added sources + + _multibuild + ------------------------------------------------------------------- Fri Jul 9 22:37:08 UTC 2021 - Jason Craig diff --git a/python-zope.interface.spec b/python-zope.interface.spec index a08acf7..9aa7abc 100644 --- a/python-zope.interface.spec +++ b/python-zope.interface.spec @@ -1,5 +1,5 @@ # -# spec file for package python-zope.interface +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -17,9 +17,17 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif %global modname zope.interface %define oldpython python -Name: python-zope.interface +Name: python-zope.interface%{psuffix} Version: 5.4.0 Release: 0 Summary: Interfaces for Python @@ -29,8 +37,13 @@ Source: https://files.pythonhosted.org/packages/source/z/zope.interface/ # needed for tests that try to compile things BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +# SECTION test requirements +%if %{with test} BuildRequires: %{python_module zope.event} +BuildRequires: %{python_module zope.interface} BuildRequires: %{python_module zope.testing} +%endif +# /SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools @@ -55,20 +68,28 @@ the Design By Contract methodology support in Python. %setup -q -n %{modname}-%{version} %build +%if !%{with test} %python_build +%endif %install +%if !%{with test} %python_install %python_expand rm %{buildroot}%{$python_sitearch}/zope/interface/_zope_interface_coptimizations.c %python_expand %fdupes %{buildroot}%{$python_sitearch} +%endif %check -sed -i '/coverage/d' setup.py -%python_exec setup.py test +%if %{with test} +cd src +%pyunittest zope/interface/{common/,}tests/test_*.py +%endif +%if !%{with test} %files %{python_files} %license LICENSE.txt COPYRIGHT.txt %doc CHANGES.rst README.rst %{python_sitearch}/* +%endif %changelog