diff --git a/python-chardet.spec b/python-chardet.spec index b7806e0..c002fb5 100644 --- a/python-chardet.spec +++ b/python-chardet.spec @@ -10,11 +10,16 @@ Source0: %pypi_source BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools -BuildRequires: python2-pytest BuildRequires: python3-devel BuildRequires: python3-setuptools + +# Circular dependency on pytest +%bcond_without tests +%if %{with tests} +BuildRequires: python2-pytest BuildRequires: python3-pytest +%endif %global _description\ @@ -52,9 +57,11 @@ sed -ie '1d' %{pypi_name}/cli/chardetect.py rm %{buildroot}%{_bindir}/* %py3_install +%if %{with tests} %check %{__python2} -m pytest -v %{__python3} -m pytest -v +%endif %files -n python2-%{pypi_name} %license LICENSE