From f0e12299831d4084eed62e0ee3455343654ed92468682202273c02b1662d94df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 12 Aug 2019 13:47:18 +0000 Subject: [PATCH] - Switch to multibuild to enable tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-attrs?expand=0&rev=22 --- _multibuild | 3 +++ python-attrs.changes | 5 +++++ python-attrs.spec | 29 ++++++++++++++++++++--------- 3 files changed, 28 insertions(+), 9 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-attrs.changes b/python-attrs.changes index 971e034..099f3d5 100644 --- a/python-attrs.changes +++ b/python-attrs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 12 11:20:18 UTC 2019 - Tomáš Chvátal + +- Switch to multibuild to enable tests + ------------------------------------------------------------------- Mon Mar 4 20:07:57 UTC 2019 - Ondřej Súkup diff --git a/python-attrs.spec b/python-attrs.spec index 68035a4..9f565a9 100644 --- a/python-attrs.spec +++ b/python-attrs.spec @@ -17,8 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_with tests -Name: python-attrs +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +Name: python-attrs%{psuffix} Version: 19.1.0 Release: 0 Summary: Attributes without boilerplate @@ -26,13 +33,13 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/hynek/attrs/ Source: https://files.pythonhosted.org/packages/source/a/attrs/attrs-%{version}.tar.gz -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module setuptools >= 40.6.0} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch -%if %{with tests} +%if %{with test} +BuildRequires: %{python_module Pympler} BuildRequires: %{python_module hypothesis} -BuildRequires: %{python_module pympler} BuildRequires: %{python_module pytest} BuildRequires: %{python_module six} BuildRequires: %{python_module zope.interface} @@ -66,18 +73,22 @@ python-attrs is the successor to python-characterstic %python_build %install +%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} - -%if %{with tests} -%check -%python_exec -m pytest tests %endif +%if %{with test} +%check +%pytest +%endif + +%if !%{with test} %files %{python_files} %license LICENSE %doc CHANGELOG.rst README.rst %{python_sitelib}/attr* %{python_sitelib}/attrs-%{version}-py*.egg-info +%endif %changelog