From dcbdd0520a8a29468d3cdfee61da4dd7178767e9b68786dbab24925fe03b9c1c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 21 Jan 2025 03:48:54 +0000 Subject: [PATCH] Accepting request 1239062 from home:mcalabkova:branches:devel:languages:python - Add pygments.patch to fix test failure with Pygments 2.19 OBS-URL: https://build.opensuse.org/request/show/1239062 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-readme_renderer?expand=0&rev=35 --- pygments.patch | 95 ++++++++++++++++++++++++++++++++++ python-readme_renderer.changes | 5 ++ python-readme_renderer.spec | 4 +- 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 pygments.patch diff --git a/pygments.patch b/pygments.patch new file mode 100644 index 0000000..1b4578a --- /dev/null +++ b/pygments.patch @@ -0,0 +1,95 @@ +From 04d5cfe76850192364eff344be7fe27730af8484 Mon Sep 17 00:00:00 2001 +From: shenxianpeng +Date: Sat, 18 Jan 2025 06:30:04 -0500 +Subject: [PATCH] update test outputs to fix test fail (#325) + +--- + tests/fixtures/test_CommonMark_008.html | 6 +++--- + tests/fixtures/test_GFM_doublequotes.html | 2 +- + tests/fixtures/test_GFM_highlight.html | 2 +- + tests/fixtures/test_GFM_highlight_default_py.html | 2 +- + tests/fixtures/test_GFM_malicious_pre.html | 2 +- + tests/fixtures/test_rst_008.html | 6 +++--- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/fixtures/test_CommonMark_008.html b/tests/fixtures/test_CommonMark_008.html +index eef144d..5072058 100644 +--- a/tests/fixtures/test_CommonMark_008.html ++++ b/tests/fixtures/test_CommonMark_008.html +@@ -1,9 +1,9 @@ +

Here is some Python code for a Dog:

+-
class Dog(Animal):
+-    def __init__(self, name):
++
class Dog(Animal):
++    def __init__(self, name):
+         self.name = name
+ 
+-    def make_sound(self):
++    def make_sound(self):
+         print('Ruff!')
+ 
+ dog = Dog('Fido')
+diff --git a/tests/fixtures/test_GFM_doublequotes.html b/tests/fixtures/test_GFM_doublequotes.html
+index f75a4cf..b26adba 100644
+--- a/tests/fixtures/test_GFM_doublequotes.html
++++ b/tests/fixtures/test_GFM_doublequotes.html
+@@ -1,7 +1,7 @@
+ 

This is normal text.

+
This is code text.
+ 
+-
def this_is_python():
++
def this_is_python():
+     """This is a docstring."""
+     pass
+ 
+diff --git a/tests/fixtures/test_GFM_highlight.html b/tests/fixtures/test_GFM_highlight.html +index c2cf7bb..1eae5fd 100644 +--- a/tests/fixtures/test_GFM_highlight.html ++++ b/tests/fixtures/test_GFM_highlight.html +@@ -1,7 +1,7 @@ +

This is normal text.

+
This is code text.
+ 
+-
def this_is_python():
++
def this_is_python():
+     pass
+ 
+
func ThisIsGo(){
+diff --git a/tests/fixtures/test_GFM_highlight_default_py.html b/tests/fixtures/test_GFM_highlight_default_py.html
+index d85d6ce..d1a136f 100644
+--- a/tests/fixtures/test_GFM_highlight_default_py.html
++++ b/tests/fixtures/test_GFM_highlight_default_py.html
+@@ -1,4 +1,4 @@
+-
async def this_is_python():
++
async def this_is_python():
+     pass
+ 
+ print(await this_is_python())
+diff --git a/tests/fixtures/test_GFM_malicious_pre.html b/tests/fixtures/test_GFM_malicious_pre.html
+index dc7b6e6..2e586ec 100644
+--- a/tests/fixtures/test_GFM_malicious_pre.html
++++ b/tests/fixtures/test_GFM_malicious_pre.html
+@@ -1,5 +1,5 @@
+ 

This is normal text.

+-
def this_is_python():
++
def this_is_python():
+     """This is a docstring."""
+     pass
+ <script type="text/javascript">alert('I am evil.');</script>
+diff --git a/tests/fixtures/test_rst_008.html b/tests/fixtures/test_rst_008.html
+index 6762f3a..bbb44a8 100644
+--- a/tests/fixtures/test_rst_008.html
++++ b/tests/fixtures/test_rst_008.html
+@@ -1,9 +1,9 @@
+ 

Here is some Python code for a Dog:

+-
class Dog(Animal):
+-    def __init__(self, name):
++
class Dog(Animal):
++    def __init__(self, name):
+         self.name = name
+ 
+-    def make_sound(self):
++    def make_sound(self):
+         print('Ruff!')
+ 
+ dog = Dog('Fido')
diff --git a/python-readme_renderer.changes b/python-readme_renderer.changes index 94b327f..6640864 100644 --- a/python-readme_renderer.changes +++ b/python-readme_renderer.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 20 15:29:01 UTC 2025 - Markéta Machová + +- Add pygments.patch to fix test failure with Pygments 2.19 + ------------------------------------------------------------------- Thu Nov 7 13:28:54 UTC 2024 - Daniel Garcia diff --git a/python-readme_renderer.spec b/python-readme_renderer.spec index f9c3d7a..1e2ee6c 100644 --- a/python-readme_renderer.spec +++ b/python-readme_renderer.spec @@ -1,7 +1,7 @@ # # spec file for package python-readme_renderer # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,8 @@ Summary: A library for rendering "readme" descriptions License: Apache-2.0 URL: https://github.com/pypa/readme_renderer Source: https://files.pythonhosted.org/packages/source/r/readme_renderer/readme_renderer-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/pypa/readme_renderer/pull/325 fix: update test outputs to fix tests fail +Patch: pygments.patch BuildRequires: %{python_module Pygments >= 2.5.1} BuildRequires: %{python_module cmarkgfm >= 0.7.0} BuildRequires: %{python_module docutils >= 0.13.1}