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