diff --git a/pygments-2.12.0-test-fix.patch b/pygments-2.12.0-test-fix.patch new file mode 100644 index 0000000..1804147 --- /dev/null +++ b/pygments-2.12.0-test-fix.patch @@ -0,0 +1,13 @@ +diff --git a/tests/test_traceback.py b/tests/test_traceback.py +index 2830e26aa..03705f99c 100644 +--- a/tests/test_traceback.py ++++ b/tests/test_traceback.py +@@ -277,7 +277,7 @@ def test_guess_lexer_yaml_j2(): + something: {{ raiser() }} + else: {{ 5 + 5 }} + """ +- assert Traceback._guess_lexer("test.yaml.j2", code) == "text" ++ assert Traceback._guess_lexer("test.yaml.j2", code) in ("text", "YAML+Jinja") + + + def test_recursive(): diff --git a/python-rich.spec b/python-rich.spec index 7deea89..3186656 100644 --- a/python-rich.spec +++ b/python-rich.spec @@ -10,6 +10,10 @@ URL: https://github.com/Textualize/rich Source0: %{url}/archive/v%{version}/rich-%{version}.tar.gz BuildArch: noarch +# Fix a test with Pygments 2.12.0 +# Resolved upstream: https://github.com/Textualize/rich/commit/e2332480eba780be2090b5cc98bee21874d13f33 +Patch0: pygments-2.12.0-test-fix.patch + BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # for checks @@ -34,7 +38,7 @@ also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box. %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -p1 -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires -r