From 976a71363dab1064b9376ee3be420785da894b56 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Oct 14 2020 08:09:07 +0000 Subject: Backport commit to fix sphinx with latest version of pygments --- diff --git a/85b24a2e88ea71edc728aff3b078d34c2f374f06.patch b/85b24a2e88ea71edc728aff3b078d34c2f374f06.patch new file mode 100644 index 0000000..99c8180 --- /dev/null +++ b/85b24a2e88ea71edc728aff3b078d34c2f374f06.patch @@ -0,0 +1,36 @@ +From 85b24a2e88ea71edc728aff3b078d34c2f374f06 Mon Sep 17 00:00:00 2001 +From: Takeshi KOMIYA +Date: Sun, 13 Sep 2020 09:16:32 +0900 +Subject: [PATCH] Fix our test failed with pygments-2.7.0 + +Since pygments-2.7.0, it has changed the style of output HTML. +That makes our test broken. This fixes it to pass with new pygments. +--- + tests/test_build_html.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/tests/test_build_html.py b/tests/test_build_html.py +index e949f11572..1efc6c14a6 100644 +--- a/tests/test_build_html.py ++++ b/tests/test_build_html.py +@@ -10,8 +10,10 @@ + + import os + import re ++from distutils.version import LooseVersion + from itertools import cycle, chain + ++import pygments + import pytest + from html5lib import HTMLParser + +@@ -1591,4 +1593,8 @@ def test_html_codeblock_linenos_style_inline(app): + app.build() + content = (app.outdir / 'index.html').read_text() + +- assert '1 ' in content ++ pygments_version = tuple(LooseVersion(pygments.__version__).version) ++ if pygments_version > (2, 7): ++ assert '1' in content ++ else: ++ assert '1 ' in content diff --git a/python-sphinx.spec b/python-sphinx.spec index 4e3f8b1..73e5299 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -25,7 +25,7 @@ Name: python-sphinx #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 Summary: Python documentation generator @@ -42,6 +42,11 @@ Source0: %{pypi_source %{upstream_name} %{upstream_version}} # which causes that test to fail. Patch1: sphinx-test_theming.diff +# Latest version of python-pygments (2.7.1) breaks python-sphinx. +# It is already fixed in upstream and this patch can be removed +# once new version of python-sphinx is released. +Patch2: https://github.com/sphinx-doc/sphinx/commit/85b24a2e88ea71edc728aff3b078d34c2f374f06.patch + BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel @@ -383,6 +388,9 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib %changelog +* Wed Oct 14 2020 Tomas Hrnciar - 1:3.2.1-2 +- Backport commit to fix python-sphinx with python-pygments v2.7.1 + * Tue Aug 18 2020 Miro HronĨok - 1:3.2.1-1 - Update to 3.2.1 - Remove compatibility symbolic links from /usr/libexec/