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