From cd8449b35af2b8f88047d8fb6f5c690272c50ae9da915217e2ba749f244b1fa4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 18 Jul 2022 12:05:11 +0000 Subject: [PATCH] Accepting request 989740 from home:bnavigator:branches:devel:languages:python fix another typo. - Don't fall back to setuptools but to importlib-metadata for plugin loading. (If a package for 15.X would be build, but Pytest 7 is required for testing -- gh#pygments/pygments#2080) OBS-URL: https://build.opensuse.org/request/show/989740 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=83 --- python-Pygments.changes | 7 +++++++ python-Pygments.spec | 23 +++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/python-Pygments.changes b/python-Pygments.changes index 53f92ea..044ad24 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jul 15 14:30:49 UTC 2022 - Ben Greiner + +- Don't fall back to setuptools but to importlib-metadata for + plugin loading. (If a package for 15.X would be build, but + Pytest 7 is required for testing -- gh#pygments/pygments#2080) + ------------------------------------------------------------------- Sun May 15 18:58:34 UTC 2022 - Dirk Müller diff --git a/python-Pygments.spec b/python-Pygments.spec index 5bf2fe5..f7544cd 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -34,14 +34,15 @@ Group: Development/Languages/Python URL: http://pygments.org Source: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz BuildRequires: %{python_module base >= 3.5} -# We need pytest just because of its test runner, it seems even -# python3 stdlib unittest runner doesn't work -BuildRequires: %{python_module pytest} BuildRequires: %{python_module lxml} +BuildRequires: %{python_module pytest >= 7} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 -Requires: python-setuptools +# Preferred for plugin loading, see https://pygments.org/docs/plugins/ +%if 0%{?python_version_nodots} < 38 +Requires: python-importlib-metadata +%endif %if %{with libalternatives} Requires: alts BuildRequires: alts @@ -81,7 +82,10 @@ install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 %fdupes %{buildroot}%{$python_sitelib} } -%prepare_alternative pygmentize +%check +# skip test that requires wcag-contrast-ratio Python package +rm ./tests/contrast/test_contrasts.py +%pytest %pre # If libalternatives is used: Removing old update-alternatives entries. @@ -93,17 +97,12 @@ install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 %postun %python_uninstall_alternative pygmentize -%check -# skip test that requires wcag-contrast-ratio Python package -rm ./tests/contrast/test_contrasts.py -%pytest - %files %{python_files} %license LICENSE %doc AUTHORS CHANGES %python_alternative %{_bindir}/pygmentize %python_alternative %{_mandir}/man1/pygmentize.1%{ext_man} -%{python_sitelib}/pygments/ -%{python_sitelib}/Pygments-%{version}-py%{python_version}.egg-info/ +%{python_sitelib}/pygments +%{python_sitelib}/Pygments-%{version}*-info %changelog