From f20cfd59b4576bd69486e0a159f758e70dcebce75c45db526bad763905fd7e6c Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 4 Jan 2023 16:26:26 +0000 Subject: [PATCH] - Add fix-tests-pygments-2.14.0.patch to adapt tests to the new version of pygments gh#pypa/readme_renderer#272 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-readme_renderer?expand=0&rev=23 --- fix-tests-pygments-2.14.0.patch | 110 ++++++++++++++++++++++++++++++++ python-readme_renderer.changes | 6 ++ python-readme_renderer.spec | 8 ++- 3 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 fix-tests-pygments-2.14.0.patch diff --git a/fix-tests-pygments-2.14.0.patch b/fix-tests-pygments-2.14.0.patch new file mode 100644 index 0000000..f76a793 --- /dev/null +++ b/fix-tests-pygments-2.14.0.patch @@ -0,0 +1,110 @@ +From c213bb9f3adfc1dccc2f03141489f833bd83db53 Mon Sep 17 00:00:00 2001 +From: Daniel Garcia Moreno +Date: Wed, 4 Jan 2023 17:21:48 +0100 +Subject: [PATCH] Adapt tests to pygments 2.14.0 + +This patch update the test fixtures to match the output of pygments +2.14.0 +--- + tests/fixtures/test_CommonMark_008.html | 4 ++-- + tests/fixtures/test_GFM_doublequotes.html | 8 ++++---- + tests/fixtures/test_GFM_highlight.html | 6 +++--- + tests/fixtures/test_GFM_malicious_pre.html | 2 +- + tests/fixtures/test_rst_008.html | 18 +++++++++--------- + 5 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/tests/fixtures/test_CommonMark_008.html b/tests/fixtures/test_CommonMark_008.html +index b941909..4d52a37 100644 +--- a/tests/fixtures/test_CommonMark_008.html ++++ b/tests/fixtures/test_CommonMark_008.html +@@ -9,8 +9,8 @@ + dog = Dog('Fido') + +

and then here is some bash:

+-
if [ "$1" = "--help" ]; then
+-    echo "OK"
++
if [ "$1" = "--help" ]; then
++    echo "OK"
+ fi
+ 
+

or click SurveyMonkey

+diff --git a/tests/fixtures/test_GFM_doublequotes.html b/tests/fixtures/test_GFM_doublequotes.html +index 546fd39..1353714 100644 +--- a/tests/fixtures/test_GFM_doublequotes.html ++++ b/tests/fixtures/test_GFM_doublequotes.html +@@ -2,10 +2,10 @@ +
This is code text.
+ 
+
def this_is_python():
+-    """This is a docstring."""
++    """This is a docstring."""
+     pass
+ 
+-
func ThisIsGo(){
+-    return
+-}
++
func ThisIsGo(){
++    return
++}
+ 
+diff --git a/tests/fixtures/test_GFM_highlight.html b/tests/fixtures/test_GFM_highlight.html +index 4094325..c2cf7bb 100644 +--- a/tests/fixtures/test_GFM_highlight.html ++++ b/tests/fixtures/test_GFM_highlight.html +@@ -4,9 +4,9 @@ +
def this_is_python():
+     pass
+ 
+-
func ThisIsGo(){
+-    return
+-}
++
func ThisIsGo(){
++    return
++}
+ 
+
An unknown code fence block
+ 
+diff --git a/tests/fixtures/test_GFM_malicious_pre.html b/tests/fixtures/test_GFM_malicious_pre.html +index 7194eee..245e17e 100644 +--- a/tests/fixtures/test_GFM_malicious_pre.html ++++ b/tests/fixtures/test_GFM_malicious_pre.html +@@ -1,6 +1,6 @@ +

This is normal text.

+
def this_is_python():
+-    """This is a docstring."""
++    """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 621a70c..6a01a9d 100644 +--- a/tests/fixtures/test_rst_008.html ++++ b/tests/fixtures/test_rst_008.html +@@ -1,15 +1,15 @@ +

Here is some Python code for a Dog:

+-
class Dog(Animal):
+-    def __init__(self, name):
+-        self.name = name
++
class Dog(Animal):
++    def __init__(self, name):
++        self.name = name
+ 
+-    def make_sound(self):
+-        print('Ruff!')
++    def make_sound(self):
++        print('Ruff!')
+ 
+-dog = Dog('Fido')
++dog = Dog('Fido')
+

and then here is some bash:

+-
if [ "$1" = "--help" ]; then
+-    echo "OK"
+-fi
++
if [ "$1" = "--help" ]; then
++    echo "OK"
++fi
+

or click SurveyMonkey

+
An unknown code fence block
+-- +2.39.0 + diff --git a/python-readme_renderer.changes b/python-readme_renderer.changes index 5d0d039..64fb5ab 100644 --- a/python-readme_renderer.changes +++ b/python-readme_renderer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 4 16:24:09 UTC 2023 - Daniel Garcia + +- Add fix-tests-pygments-2.14.0.patch to adapt tests to the new version of + pygments gh#pypa/readme_renderer#272 + ------------------------------------------------------------------- Wed Nov 9 18:51:01 UTC 2022 - Yogalakshmi Arunachalam diff --git a/python-readme_renderer.spec b/python-readme_renderer.spec index 23a6e86..b077a04 100644 --- a/python-readme_renderer.spec +++ b/python-readme_renderer.spec @@ -1,7 +1,7 @@ # # spec file for package python-readme_renderer # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,6 @@ %define skip_python2 1 -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-readme_renderer Version: 37.3 Release: 0 @@ -25,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 fix-tests-pygments-2.14.0.patch gh#pypa/readme_renderer#272 +Patch0: fix-tests-pygments-2.14.0.patch BuildRequires: %{python_module Pygments >= 2.5.1} BuildRequires: %{python_module bleach >= 2.1.0} BuildRequires: %{python_module cmarkgfm >= 0.7.0} @@ -62,6 +63,7 @@ export LANG=en_US.UTF-8 %files %{python_files} %license LICENSE %doc CHANGES.rst README.rst -%{python_sitelib}/* +%{python_sitelib}/readme_renderer +%{python_sitelib}/readme_renderer-%{version}*-info %changelog