1
0

- Use multibuild to avoid cycles with pytest

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-virtualenv?expand=0&rev=71
This commit is contained in:
Tomáš Chvátal 2019-09-17 18:07:53 +00:00 committed by Git OBS Bridge
parent 33e019dfea
commit db4fbaa216
3 changed files with 26 additions and 1 deletions

3
_multibuild Normal file
View File

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

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Sep 17 18:01:51 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Use multibuild to avoid cycles with pytest
-------------------------------------------------------------------
Mon Sep 16 10:20:57 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -17,7 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-virtualenv
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-virtualenv%{psuffix}
Version: 16.7.5
Release: 0
Summary: Virtual Python Environment builder
@ -25,11 +33,14 @@ License: MIT
Group: Development/Languages/Python
URL: http://www.virtualenv.org/
Source: https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz
%if %{with test}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pypiserver}
BuildRequires: %{python_module pytest-localserver}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module virtualenv >= %{version}}
%endif
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -68,16 +79,21 @@ libraries either).
%python_build
%install
%if !%{with test}
%python_install
%python_expand fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/virtualenv
%endif
%check
%if %{with test}
# test_bootstrap is tied to python2 command calls, skip it
# test_always_copy_option does not handle system install dirs in /usr/lib64
# test_wheel_invocation_dash_p or test_use_from_wheel or test_wheel_contains or test_wheel_basic_invocation; online tests
%pytest -k 'not (test_always_copy_option or test_bootstrap or test_use_from_wheel or test_wheel_contains or test_wheel_basic_invocation or test_wheel_invocation_dash_p)'
%endif
%if !%{with test}
%post
%python_install_alternative virtualenv
@ -90,5 +106,6 @@ libraries either).
%{python_sitelib}/virtualenv*
%python_alternative %{_bindir}/virtualenv
%pycache_only %{python_sitelib}/__pycache__
%endif
%changelog