From eb0690fef245f490e0d3b050d99a2b8f0edc96f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 1 Jun 2023 09:40:14 +0200 Subject: [PATCH] Run basic import check in RHEL builds --- python-sphinxcontrib-htmlhelp.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python-sphinxcontrib-htmlhelp.spec b/python-sphinxcontrib-htmlhelp.spec index 950cb88..762051d 100644 --- a/python-sphinxcontrib-htmlhelp.spec +++ b/python-sphinxcontrib-htmlhelp.spec @@ -1,8 +1,9 @@ %global pypi_name sphinxcontrib-htmlhelp -# when bootstrapping sphinx, we cannot run tests yet +# when bootstrapping sphinx, we cannot even run an import check +%bcond check 1 # RHEL does not include html5lib, without which the tests fail -%bcond check %{undefined rhel} +%bcond tests %[%{with check} && %{undefined rhel}] Name: python-%{pypi_name} Version: 2.0.0 @@ -21,10 +22,12 @@ BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if %{with check} -BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-sphinx >= 1:2 +%if %{with tests} +BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-html5lib %endif +%endif %description sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files. @@ -71,8 +74,11 @@ popd %if %{with check} %check +%py3_check_import sphinxcontrib.htmlhelp +%if %{with tests} %{__python3} -m pytest %endif +%endif %files -n python%{python3_pkgversion}-%{pypi_name} -f sphinxcontrib.htmlhelp.lang