Add a bcond for tests (used when bootstrapping Python)

This commit is contained in:
Miro Hrončok 2018-05-13 16:31:48 +02:00
parent c3d4463a2f
commit 6e045f99f2

View File

@ -6,6 +6,9 @@
%global with_python3 0
%endif
# Turn the tests off when bootstrapping Python, because pytest requires pluggy
%bcond_without tests
Name: python-pluggy
Version: 0.6.0
Release: 2%{?dist}
@ -18,12 +21,17 @@ Source0: https://github.com/pytest-dev/%{pypiname}/archive/%{version}.tar
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-setuptools
%if %{with tests}
BuildRequires: python2-pytest
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-setuptools
%if %{with tests}
BuildRequires: python3-pytest
%endif
%endif # with python3
%global _description\
@ -66,7 +74,7 @@ The plugin manager stripped of pytest specific details.
%py2_install
%if %{with tests}
%check
export PYTHONPATH=.:$PYTHONPATH
py.test testing
@ -74,6 +82,7 @@ py.test testing
%if 0%{?with_python3}
py.test-%{python3_version} testing
%endif
%endif # with tests
%files -n python2-%{pypiname}