Accepting request 813457 from home:mcalabkova:branches:devel:languages:python

- enable testing by default with multibuild

OBS-URL: https://build.opensuse.org/request/show/813457
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-extras?expand=0&rev=27
This commit is contained in:
Tomáš Chvátal 2020-06-11 11:19:45 +00:00 committed by Git OBS Bridge
parent fe78d28be2
commit 9572ab1fe3
3 changed files with 20 additions and 6 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -2,6 +2,7 @@
Wed Jun 10 09:07:14 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com> Wed Jun 10 09:07:14 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- replace nose - replace nose
- enable testing by default with multibuild
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Oct 14 13:37:36 UTC 2019 - Matej Cepl <mcepl@suse.com> Mon Oct 14 13:37:36 UTC 2019 - Matej Cepl <mcepl@suse.com>

View File

@ -17,10 +17,16 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
# A build cycle exists between python-extras and python-testtools. Thus, only # A build cycle exists between python-extras and python-testtools.
# enable testing with a build conditional (off by default): %global flavor @BUILD_FLAVOR@%{nil}
%bcond_without tests %if "%{flavor}" == "test"
Name: python-extras %define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-extras%{psuffix}
Version: 1.0.0 Version: 1.0.0
Release: 0 Release: 0
Summary: Extra bits for Python Summary: Extra bits for Python
@ -34,7 +40,7 @@ BuildRequires: python-rpm-macros
#!BuildIgnore: python-extras #!BuildIgnore: python-extras
BuildArch: noarch BuildArch: noarch
# Test requirements: # Test requirements:
%if %{with tests} %if %{with test}
BuildRequires: %{python_module testtools} BuildRequires: %{python_module testtools}
%endif %endif
%python_subpackages %python_subpackages
@ -51,18 +57,22 @@ general use outside of a testing context.
%python_build %python_build
%install %install
%if !%{with test}
%python_install %python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with tests} %if %{with test}
%check %check
%python_exec -m unittest discover %python_exec -m unittest discover
%endif %endif
%if !%{with test}
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc NEWS README.rst %doc NEWS README.rst
%{python_sitelib}/extras %{python_sitelib}/extras
%{python_sitelib}/extras-%{version}-py%{python_version}.egg-info/ %{python_sitelib}/extras-%{version}-py%{python_version}.egg-info/
%endif
%changelog %changelog