From d74992fe32515009b888d080ce4842143a7cedf04c73185726c89aa55a3e4864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 14 Mar 2020 09:57:12 +0000 Subject: [PATCH] - Add patch to fix build with pygments 2.4 and newer: * pygments25.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=63 --- pygments25.patch | 107 ++++++++++++++++++++++++++++++++++++++++ python-docutils.changes | 6 +++ python-docutils.spec | 3 +- 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 pygments25.patch diff --git a/pygments25.patch b/pygments25.patch new file mode 100644 index 0000000..c998c23 --- /dev/null +++ b/pygments25.patch @@ -0,0 +1,107 @@ +Index: docutils/test/test_parsers/test_rst/test_directives/test_code.py +=================================================================== +--- docutils/test/test_parsers/test_rst/test_directives/test_code.py (revision 8494) ++++ docutils/test/test_parsers/test_rst/test_directives/test_code.py (revision 8495) +@@ -98,7 +98,7 @@ + + totest['code-parsing'] = [ + ["""\ +-.. code:: python ++.. code:: python3 + :class: testclass + + print('hello world') # to stdout +@@ -105,9 +105,9 @@ + """, + """\ + +- ++ + \n\ +- ++ + print + + ( +@@ -120,7 +120,7 @@ + # to stdout + """], + ["""\ +-.. code:: python ++.. code:: python3 + :class: testclass + :name: my_function + :number-lines: 7 +@@ -134,7 +134,7 @@ + """, + """\ + +- ++ + + 7 \n\ + +@@ -167,7 +167,7 @@ + + 12 \n\ + \n\ +- ++ + print + + ( +Index: docutils/test/test_parsers/test_rst/test_directives/test_code_long.py +=================================================================== +--- docutils/test/test_parsers/test_rst/test_directives/test_code_long.py (revision 8494) ++++ docutils/test/test_parsers/test_rst/test_directives/test_code_long.py (revision 8495) +@@ -24,7 +24,7 @@ + + totest['code-parsing-long'] = [ + ["""\ +-.. code:: python ++.. code:: python3 + :number-lines: 7 + + def my_function(): +@@ -36,7 +36,7 @@ + """, + """\ + +- ++ + + 7 \n\ + +@@ -69,7 +69,7 @@ + + 12 \n\ + \n\ +- ++ + print + + ( +Index: docutils/test/test_parsers/test_rst/test_interpreted.py +=================================================================== +--- docutils/test/test_parsers/test_rst/test_interpreted.py (revision 8494) ++++ docutils/test/test_parsers/test_rst/test_interpreted.py (revision 8495) +@@ -271,7 +271,7 @@ + Custom role based on code role: + + .. role:: python(code) +- :language: python ++ :language: python3 + :class: testclass + + Python code :python:`print("The end")`. +@@ -282,8 +282,8 @@ + Custom role based on code role: + + Python code \n\ +- +- ++ ++ + print + + ( diff --git a/python-docutils.changes b/python-docutils.changes index 2fc855f..fe9a81c 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Mar 14 09:56:02 UTC 2020 - Tomáš Chvátal + +- Add patch to fix build with pygments 2.4 and newer: + * pygments25.patch + ------------------------------------------------------------------- Wed Jan 15 10:56:28 UTC 2020 - Tomáš Chvátal diff --git a/python-docutils.spec b/python-docutils.spec index ef45f08..2daebae 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -30,10 +30,10 @@ Version: 0.16 Release: 0 Summary: Python Documentation Utilities License: Python-2.0 AND BSD-2-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND SUSE-Public-Domain -Group: Development/Languages/Python URL: https://pypi.python.org/pypi/docutils/ Source: https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz Source99: python-docutils-rpmlintrc +Patch0: pygments25.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xml} BuildRequires: fdupes @@ -63,6 +63,7 @@ easy-to-read, what-you-see-is-what-you-get plaintext markup syntax. %prep %setup -q -n docutils-%{version} +%patch0 -p1 # Remove useless ".py" ending from executables: for i in tools/rst*; do mv "$i" "${i/.py}"; done sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py