Run basic import check in RHEL builds

This commit is contained in:
Miro Hrončok 2023-06-01 09:40:14 +02:00
parent 84e4580f96
commit eb0690fef2

View File

@ -1,8 +1,9 @@
%global pypi_name sphinxcontrib-htmlhelp %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 # RHEL does not include html5lib, without which the tests fail
%bcond check %{undefined rhel} %bcond tests %[%{with check} && %{undefined rhel}]
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 2.0.0 Version: 2.0.0
@ -21,10 +22,12 @@ BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
%if %{with check} %if %{with check}
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-sphinx >= 1:2 BuildRequires: python%{python3_pkgversion}-sphinx >= 1:2
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-html5lib BuildRequires: python%{python3_pkgversion}-html5lib
%endif %endif
%endif
%description %description
sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files. sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files.
@ -71,8 +74,11 @@ popd
%if %{with check} %if %{with check}
%check %check
%py3_check_import sphinxcontrib.htmlhelp
%if %{with tests}
%{__python3} -m pytest %{__python3} -m pytest
%endif %endif
%endif
%files -n python%{python3_pkgversion}-%{pypi_name} -f sphinxcontrib.htmlhelp.lang %files -n python%{python3_pkgversion}-%{pypi_name} -f sphinxcontrib.htmlhelp.lang