From c2e2356a476ef2fa3e95ef373a26cdbee0f546d2433bbce2eb7bc114d87e1e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Monin?= Date: Tue, 4 Jan 2022 17:47:14 +0000 Subject: [PATCH 1/2] Accepting request 943586 from home:marxin:branches:devel:languages:python - Update to 2.11.1: https://github.com/pygments/pygments/blob/master/CHANGES - Remove one test as it requires wcag-contrast-ratio Python package. I verified python-pelican package can be built with updated Pygments. OBS-URL: https://build.opensuse.org/request/show/943586 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=79 --- Pygments-2.11.1.tar.gz | 3 +++ Pygments-2.9.0.tar.gz | 3 --- python-Pygments.changes | 7 +++++++ python-Pygments.spec | 8 +++++--- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 Pygments-2.11.1.tar.gz delete mode 100644 Pygments-2.9.0.tar.gz diff --git a/Pygments-2.11.1.tar.gz b/Pygments-2.11.1.tar.gz new file mode 100644 index 0000000..ccb348a --- /dev/null +++ b/Pygments-2.11.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59b895e326f0fb0d733fd28c6839bd18ad0687ba20efc26d4277fd1d30b971f4 +size 4206490 diff --git a/Pygments-2.9.0.tar.gz b/Pygments-2.9.0.tar.gz deleted file mode 100644 index 5bcdf2f..0000000 --- a/Pygments-2.9.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f -size 4048049 diff --git a/python-Pygments.changes b/python-Pygments.changes index 2dff35e..2199b57 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 3 11:09:21 UTC 2022 - Martin Liška + +- Update to 2.11.1: + https://github.com/pygments/pygments/blob/master/CHANGES +- Remove one test as it requires wcag-contrast-ratio Python package. + ------------------------------------------------------------------- Thu Sep 9 08:48:02 UTC 2021 - Stefan Schubert diff --git a/python-Pygments.spec b/python-Pygments.spec index 8c9357f..b97370f 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -1,7 +1,7 @@ # # spec file for package python-Pygments # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,8 +26,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-Pygments -# DO NOT UPGRADE UNTIL PELICAN IS COMPATIBLE! -Version: 2.9.0 +Version: 2.11.1 Release: 0 Summary: A syntax highlighting package written in Python License: BSD-2-Clause @@ -38,6 +37,7 @@ 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 setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 @@ -97,6 +97,8 @@ install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 %python_uninstall_alternative pygmentize %check +# skip test that requires wcag-contrast-ratio Python package +rm ./tests/contrast/test_contrasts.py %pytest %files %{python_files} From 7c515cfc09600f0e269a5704c91e7cafd48c9c785e54d491606568dbb210df48 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 7 Feb 2022 09:27:11 +0000 Subject: [PATCH 2/2] Accepting request 951979 from home:benoit_monin:branches:devel:languages:python - update to 2.11.2 - backport elpi_fix_catastrophic_backtracking.patch - switch prep stage to autosetup - remove commented-out shebang removal OBS-URL: https://build.opensuse.org/request/show/951979 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=80 --- Pygments-2.11.1.tar.gz | 3 -- Pygments-2.11.2.tar.gz | 3 ++ elpi_fix_catastrophic_backtracking.patch | 39 ++++++++++++++++++++++++ python-Pygments.changes | 24 +++++++++++++++ python-Pygments.spec | 9 +++--- 5 files changed, 70 insertions(+), 8 deletions(-) delete mode 100644 Pygments-2.11.1.tar.gz create mode 100644 Pygments-2.11.2.tar.gz create mode 100644 elpi_fix_catastrophic_backtracking.patch diff --git a/Pygments-2.11.1.tar.gz b/Pygments-2.11.1.tar.gz deleted file mode 100644 index ccb348a..0000000 --- a/Pygments-2.11.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:59b895e326f0fb0d733fd28c6839bd18ad0687ba20efc26d4277fd1d30b971f4 -size 4206490 diff --git a/Pygments-2.11.2.tar.gz b/Pygments-2.11.2.tar.gz new file mode 100644 index 0000000..2ba74fc --- /dev/null +++ b/Pygments-2.11.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a +size 4206258 diff --git a/elpi_fix_catastrophic_backtracking.patch b/elpi_fix_catastrophic_backtracking.patch new file mode 100644 index 0000000..2ce7cf2 --- /dev/null +++ b/elpi_fix_catastrophic_backtracking.patch @@ -0,0 +1,39 @@ +From dbd7931f9d60966fbb80745db368ad773a8b7569 Mon Sep 17 00:00:00 2001 +From: Jean Abou-Samra +Date: Thu, 3 Feb 2022 22:27:01 +0100 +Subject: [PATCH] Elpi: fix catastrophic backtracking (#2061) + +--- + pygments/lexers/elpi.py | 4 ++-- + tests/snippets/elpi/test_catastrophic_backtracking.txt | 6 ++++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + create mode 100644 tests/snippets/elpi/test_catastrophic_backtracking.txt + +diff --git a/pygments/lexers/elpi.py b/pygments/lexers/elpi.py +index 691182a86..3ce6ed6a2 100644 +--- a/pygments/lexers/elpi.py ++++ b/pygments/lexers/elpi.py +@@ -32,9 +32,9 @@ class ElpiLexer(RegexLexer): + schar2_re = r"([+*^?/<>`'@#~=&!])" + schar_re = r"({}|-|\$|_)".format(schar2_re) + idchar_re = r"({}|{}|{}|{})".format(lcase_re,ucase_re,digit_re,schar_re) +- idcharstarns_re = r"({}+|(?=\.[a-z])\.{}+)".format(idchar_re,idchar_re) ++ idcharstarns_re = r"({}*(\.({}|{}){}*)*)".format(idchar_re, lcase_re, ucase_re, idchar_re) + symbchar_re = r"({}|{}|{}|{}|:)".format(lcase_re, ucase_re, digit_re, schar_re) +- constant_re = r"({}{}*|{}{}*|{}{}*|_{}+)".format(ucase_re, idchar_re, lcase_re, idcharstarns_re,schar2_re, symbchar_re,idchar_re) ++ constant_re = r"({}{}*|{}{}|{}{}*|_{}+)".format(ucase_re, idchar_re, lcase_re, idcharstarns_re,schar2_re, symbchar_re,idchar_re) + symbol_re=r"(,|<=>|->|:-|;|\?-|->|&|=>|\bas\b|\buvar\b|<|=<|=|==|>=|>|\bi<|\bi=<|\bi>=|\bi>|\bis\b|\br<|\br=<|\br>=|\br>|\bs<|\bs=<|\bs>=|\bs>|@|::|\[\]|`->|`:|`:=|\^|-|\+|\bi-|\bi\+|r-|r\+|/|\*|\bdiv\b|\bi\*|\bmod\b|\br\*|~|\bi~|\br~)" + escape_re=r"\(({}|{})\)".format(constant_re,symbol_re) + const_sym_re = r"({}|{}|{})".format(constant_re,symbol_re,escape_re) +diff --git a/tests/snippets/elpi/test_catastrophic_backtracking.txt b/tests/snippets/elpi/test_catastrophic_backtracking.txt +new file mode 100644 +index 000000000..a14a0549c +--- /dev/null ++++ b/tests/snippets/elpi/test_catastrophic_backtracking.txt +@@ -0,0 +1,6 @@ ++---input--- ++aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ++ ++---tokens--- ++'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' Text ++'\n' Text.Whitespace diff --git a/python-Pygments.changes b/python-Pygments.changes index 2199b57..8690cf9 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Sun Feb 6 21:20:22 UTC 2022 - Benoît Monin + +- backport elpi_fix_catastrophic_backtracking.patch: + fix build getting stuck when running the tests +- switch prep stage to autosetup +- remove commented-out shebang removal + +------------------------------------------------------------------- +Wed Jan 12 19:53:14 UTC 2022 - Benoît Monin + +- update to 2.11.2: + * Updated lexers: + + C-family: Fix incorrect handling of labels (#2022, #1996, + #1182) + + Java: Fixed an issue with record keywords result in Error + tokens in some cases (#2018) + * Fix links to line numbers not working correctly (#2014) + * Remove underline from Whitespace style in the Tango theme + (#2020) + * Fix IRC and Terminal256 formatters not backtracking correctly + for custom token types, resulting in some unstyled tokens + (#1986) + ------------------------------------------------------------------- Mon Jan 3 11:09:21 UTC 2022 - Martin Liška diff --git a/python-Pygments.spec b/python-Pygments.spec index b97370f..89890cb 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -26,13 +26,15 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-Pygments -Version: 2.11.1 +Version: 2.11.2 Release: 0 Summary: A syntax highlighting package written in Python License: BSD-2-Clause Group: Development/Languages/Python URL: http://pygments.org Source: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz +# PATCH-FIX-UPSTREAM -- backported from dbd7931f9d60 +Patch1: elpi_fix_catastrophic_backtracking.patch 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 @@ -67,10 +69,7 @@ source code. Highlights are: * highlights Brainfuck %prep -%setup -q -n Pygments-%{version} - -# Remove unnecessary shebang -# sed -i '1 { /^#!/ d }' pygments/lexers/_usd_builtins.py +%autosetup -n Pygments-%{version} -p1 %build %python_build