From 6e045f99f2c99517d578c722644bbc7ca2625aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 13 May 2018 16:31:48 +0200 Subject: [PATCH] Add a bcond for tests (used when bootstrapping Python) --- python-pluggy.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/python-pluggy.spec b/python-pluggy.spec index 97a696e..1dd7851 100644 --- a/python-pluggy.spec +++ b/python-pluggy.spec @@ -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}