Add bcond for tests

This commit is contained in:
Miro Hrončok 2019-03-28 10:46:02 +01:00
parent c5a77051d4
commit f67c3d857f

View File

@ -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