From cd8449b35af2b8f88047d8fb6f5c690272c50ae9da915217e2ba749f244b1fa4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 18 Jul 2022 12:05:11 +0000 Subject: [PATCH 1/3] 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 From fb5373309a0f37c5aaeb097e006b33f3f976a38b42df730fbbb055bc2bf3e082 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 18 Jul 2022 12:12:21 +0000 Subject: [PATCH 2/3] - Removing a test file is too much a hack for me OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=84 --- python-Pygments.changes | 5 +++++ python-Pygments.spec | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python-Pygments.changes b/python-Pygments.changes index 044ad24..0ac9939 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 18 12:11:36 UTC 2022 - Matej Cepl + +- Removing a test file is too much a hack for me + ------------------------------------------------------------------- Fri Jul 15 14:30:49 UTC 2022 - Ben Greiner diff --git a/python-Pygments.spec b/python-Pygments.spec index f7544cd..ca124d8 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -84,8 +84,7 @@ install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 %check # skip test that requires wcag-contrast-ratio Python package -rm ./tests/contrast/test_contrasts.py -%pytest +%pytest --ignore tests/contrast/test_contrasts.py %pre # If libalternatives is used: Removing old update-alternatives entries. From 7a6601f27e3fc988b1cc84cd34e3a47f09ffdc8dc478ebc01e727da4d7ed02bc Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 18 Jul 2022 13:12:36 +0000 Subject: [PATCH 3/3] Accepting request 989963 from home:mcepl:branches:devel:languages:python - Add BR of wcag-contrast-ratio to enable more tests. OBS-URL: https://build.opensuse.org/request/show/989963 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=85 --- python-Pygments.changes | 5 +++++ python-Pygments.spec | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python-Pygments.changes b/python-Pygments.changes index 0ac9939..8370055 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 18 12:58:46 UTC 2022 - Matej Cepl + +- Add BR of wcag-contrast-ratio to enable more tests. + ------------------------------------------------------------------- Mon Jul 18 12:11:36 UTC 2022 - Matej Cepl diff --git a/python-Pygments.spec b/python-Pygments.spec index ca124d8..609c56a 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -37,6 +37,7 @@ BuildRequires: %{python_module base >= 3.5} BuildRequires: %{python_module lxml} BuildRequires: %{python_module pytest >= 7} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wcag-contrast-ratio} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 # Preferred for plugin loading, see https://pygments.org/docs/plugins/ @@ -84,7 +85,7 @@ install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 %check # skip test that requires wcag-contrast-ratio Python package -%pytest --ignore tests/contrast/test_contrasts.py +%pytest %pre # If libalternatives is used: Removing old update-alternatives entries.