From 8770b129f5d8da605a512d58dfaed7afc1c98412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 15 Feb 2023 12:52:00 +0100 Subject: [PATCH] RHEL/ELN: Stop building the HTML documentation and running the contrast-ratio tests This allows us to avoid pulling python-wcag-contrast-ratio into the next RHELs. Changes explained: - sphinx documentation is not required for RHEL, disabled - we keep building it in Fedora mostly as an additional check that the package is OK - wcag-contrast-ratio was used in docs - manpage is good even without docs, it was not built by sphinx anyway - tests.contrast.test_contrasts needs wcag-contrast-ratio, disabled on RHEL - wcag-contrast-ratio was only used in this test - to pass options to pytest, invoke it via %pytest instead of make --- python-pygments.spec | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/python-pygments.spec b/python-pygments.spec index 08321ab..524ff9f 100644 --- a/python-pygments.spec +++ b/python-pygments.spec @@ -1,10 +1,11 @@ # when bootstrapping, we cannot yet use sphinx and pytest -%bcond_without docs -%bcond_without tests +# on RHEL, we don't need to build the documentation +%bcond docs %{undefined rhel} +%bcond tests 1 Name: python-pygments Version: 2.14.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Syntax highlighting engine written in Python License: BSD-2-Clause @@ -18,13 +19,17 @@ BuildRequires: pyproject-rpm-macros %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-lxml +%if %{undefined rhel} +# this is only used in tests.contrast.test_contrasts +# to avoid pulling this package into RHEL, the test is ignored in %%check +BuildRequires: python%{python3_pkgversion}-wcag-contrast-ratio +%endif %endif %if %{with docs} -BuildRequires: python%{python3_pkgversion}-sphinx -%endif -%if %{with docs} || %{with tests} -BuildRequires: python%{python3_pkgversion}-wcag-contrast-ratio BuildRequires: make +BuildRequires: python%{python3_pkgversion}-sphinx +# the sphinx config imports tests.contrast.test_contrasts: +BuildRequires: python%{python3_pkgversion}-wcag-contrast-ratio %endif @@ -68,32 +73,34 @@ Provides: pygmentize = %{?epoch:%{epoch}:}%{version}-%{release} %pyproject_install %pyproject_save_files pygments +install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/ + %if %{with docs} %make_build -C doc html rm doc/_build/html/.buildinfo rm -rf doc/_build/html/_sources -install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/ chmod -x %{buildroot}%{_mandir}/man1/*.1 %endif %if %{with tests} %check -make test PYTHON=%{python3} +%pytest %{?rhel:--ignore tests/contrast/test_contrasts.py} %endif %files -n python%{python3_pkgversion}-pygments -f %{pyproject_files} %doc AUTHORS CHANGES +%{?with_docs:%doc doc/_build/html} %license LICENSE %{_bindir}/pygmentize -%if %{with docs} %lang(en) %{_mandir}/man1/pygmentize.1* -%doc doc/_build/html -%endif %changelog +* Thu Feb 16 2023 Miro HronĨok - 2.14.0-2 +- Don't build the documentation (and drop undesired dependencies) in Fedora ELN + * Mon Jan 30 2023 Parag Nemade - 2.14.0-1 - Update to 2.14.0 (#2157264) - Update license tag to SPDX expression