From f67c3d857fd58a3a077de4e0c27dd18a5a8032bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 28 Mar 2019 10:46:02 +0100 Subject: [PATCH] Add bcond for tests --- python-dateutil.spec | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/python-dateutil.spec b/python-dateutil.spec index 37d409b..25031da 100644 --- a/python-dateutil.spec +++ b/python-dateutil.spec @@ -10,6 +10,9 @@ License: BSD URL: https://github.com/dateutil/dateutil Source: %{pypi_source} +# when bootstrapping dateutil-freezegun, we cannot run tests +%bcond_without tests + BuildArch: noarch BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme @@ -23,11 +26,13 @@ module available in Python. %package -n python2-%{modname} Summary: %summary BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-setuptools_scm +%if %{with tests} BuildRequires: python2-freezegun BuildRequires: python2-pytest BuildRequires: python2-six -BuildRequires: python2-setuptools -BuildRequires: python2-setuptools_scm +%endif Requires: tzdata Requires: python2-six %{?python_provide:%python_provide python2-%{modname}} @@ -37,12 +42,14 @@ Requires: python2-six %package -n python3-%{modname} Summary: %summary BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-setuptools_scm +%if %{with tests} BuildRequires: python3-freezegun BuildRequires: python3-hypothesis BuildRequires: python3-pytest BuildRequires: python3-six -BuildRequires: python3-setuptools -BuildRequires: python3-setuptools_scm +%endif Requires: tzdata Requires: python3-six %{?python_provide:%python_provide python3-%{modname}} @@ -68,6 +75,7 @@ make -C docs html %py2_install %py3_install +%if %{with tests} %check %{__python3} -m pytest @@ -79,6 +87,7 @@ make -C docs html %{__python2} -m pytest \ --ignore dateutil/test/property \ -k 'not gettz_badzone_unicode' +%endif %files -n python2-%{modname} %license LICENSE