Update to 6.1.3

This commit is contained in:
Karolina Surma 2023-03-09 14:09:19 +01:00
parent 84bf048c91
commit 9a29732cf9
4 changed files with 9 additions and 134 deletions

1
.gitignore vendored
View File

@ -41,3 +41,4 @@
/Sphinx-5.1.1.tar.gz /Sphinx-5.1.1.tar.gz
/Sphinx-5.2.3.tar.gz /Sphinx-5.2.3.tar.gz
/Sphinx-5.3.0.tar.gz /Sphinx-5.3.0.tar.gz
/Sphinx-6.1.3.tar.gz

View File

@ -1,114 +0,0 @@
From c3bf917fcf18c5211b220a7b294b7e6012c2d510 Mon Sep 17 00:00:00 2001
From: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Date: Sun, 1 Jan 2023 19:17:03 +0000
Subject: [PATCH] Fix tests for Pygments 2.14
Pygments 2.14 was released on 01/01/2023 [0]
[0]: https://pygments.org/docs/changelog/#version-2-14-0
---
pyproject.toml | 2 +-
tests/test_ext_viewcode.py | 27 +++++++++++++++++++--------
tests/test_intl.py | 11 +++++++++--
3 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 0e059b5..c02ce20 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -64,7 +64,7 @@ dependencies = [
"sphinxcontrib-serializinghtml>=1.1.5",
"sphinxcontrib-qthelp",
"Jinja2>=3.0",
- "Pygments>=2.12",
+ "Pygments>=2.13",
"docutils>=0.14,<0.20",
"snowballstemmer>=2.0",
"babel>=2.9",
diff --git a/tests/test_ext_viewcode.py b/tests/test_ext_viewcode.py
index 7750b8d..6d443d1 100644
--- a/tests/test_ext_viewcode.py
+++ b/tests/test_ext_viewcode.py
@@ -2,6 +2,7 @@
import re
+import pygments
import pytest
@@ -31,14 +32,24 @@ def test_viewcode(app, status, warning):
result = (app.outdir / '_modules/spam/mod1.html').read_text(encoding='utf8')
result = re.sub('<span class=".*?">', '<span>', result) # filter pygments classes
- assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
- 'href="../../index.html#spam.Class1">[docs]</a>'
- '<span>@decorator</span>\n'
- '<span>class</span> <span>Class1</span>'
- '<span>(</span><span>object</span><span>):</span>\n'
- ' <span>&quot;&quot;&quot;</span>\n'
- '<span> this is Class1</span>\n'
- '<span> &quot;&quot;&quot;</span></div>\n') in result
+ if pygments.__version__ >= '2.14.0':
+ assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
+ 'href="../../index.html#spam.Class1">[docs]</a>'
+ '<span>@decorator</span>\n'
+ '<span>class</span> <span>Class1</span>'
+ '<span>(</span><span>object</span><span>):</span>\n'
+ '<span> </span><span>&quot;&quot;&quot;</span>\n'
+ '<span> this is Class1</span>\n'
+ '<span> &quot;&quot;&quot;</span></div>\n') in result
+ else:
+ assert ('<div class="viewcode-block" id="Class1"><a class="viewcode-back" '
+ 'href="../../index.html#spam.Class1">[docs]</a>'
+ '<span>@decorator</span>\n'
+ '<span>class</span> <span>Class1</span>'
+ '<span>(</span><span>object</span><span>):</span>\n'
+ ' <span>&quot;&quot;&quot;</span>\n'
+ '<span> this is Class1</span>\n'
+ '<span> &quot;&quot;&quot;</span></div>\n') in result
@pytest.mark.sphinx('epub', testroot='ext-viewcode')
diff --git a/tests/test_intl.py b/tests/test_intl.py
index 796d95b..0c4b838 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -6,6 +6,7 @@ Runs the text builder in the test root.
import os
import re
+import pygments
import docutils
import pytest
from babel.messages import mofile, pofile
@@ -1105,8 +1106,11 @@ def test_additional_targets_should_not_be_translated(app):
expected_expr = ("""<span class="n">literal</span>"""
"""<span class="o">-</span>"""
"""<span class="n">block</span>\n"""
- """<span class="k">in</span> """
+ """<span class="k">in</span>"""
+ """<span class="w"> </span>"""
"""<span class="n">list</span>""")
+ if pygments.__version__ < '2.14.0':
+ expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted
@@ -1184,8 +1188,11 @@ def test_additional_targets_should_be_translated(app):
expected_expr = ("""<span class="no">LITERAL</span>"""
"""<span class="o">-</span>"""
"""<span class="no">BLOCK</span>\n"""
- """<span class="no">IN</span> """
+ """<span class="no">IN</span>"""
+ """<span class="w"> </span>"""
"""<span class="no">LIST</span>""")
+ if pygments.__version__ < '2.14.0':
+ expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted
--
2.39.1

View File

@ -24,19 +24,17 @@
%global upstream_name Sphinx %global upstream_name Sphinx
Name: python-sphinx Name: python-sphinx
%global general_version 5.3.0 %global general_version 6.1.3
#global prerel ... #global prerel ...
%global upstream_version %{general_version}%{?prerel} %global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}} Version: %{general_version}%{?prerel:~%{prerel}}
Release: 4%{?dist} Release: 1%{?dist}
Epoch: 1 Epoch: 1
Summary: Python documentation generator Summary: Python documentation generator
# Unless otherwise noted, the license for code is BSD # Unless otherwise noted, the license for code is BSD
# sphinx/util/inspect.py has bits licensed with PSF license v2 (Python)
# sphinx/themes/haiku/static/haiku.css_t has bits licensed with MIT # sphinx/themes/haiku/static/haiku.css_t has bits licensed with MIT
# JS: JQuery, Underscore, css3-mediaqueries are available under MIT License: BSD and MIT
License: BSD and Python and MIT
URL: https://www.sphinx-doc.org/ URL: https://www.sphinx-doc.org/
Source0: %{pypi_source %{upstream_name} %{upstream_version}} Source0: %{pypi_source %{upstream_name} %{upstream_version}}
@ -45,10 +43,6 @@ Source0: %{pypi_source %{upstream_name} %{upstream_version}}
# which causes that test to fail. # which causes that test to fail.
Patch1: sphinx-test_theming.diff Patch1: sphinx-test_theming.diff
# Backported upstream commit included in Sphinx 6+ ensures compatibility
# with python-pygments 2.14+
# https://github.com/sphinx-doc/sphinx/commit/965768bfda2a00ba6
Patch2: fix-tests-with-pygments-2.14.patch
# Backported upstream commit ensures compatibility with Babel 2.12 # Backported upstream commit ensures compatibility with Babel 2.12
# https://github.com/sphinx-doc/sphinx/commit/c5641702b # https://github.com/sphinx-doc/sphinx/commit/c5641702b
@ -64,9 +58,6 @@ BuildRequires: pyproject-rpm-macros
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-websupport BuildRequires: python%{python3_pkgversion}-sphinxcontrib-websupport
%endif %endif
# for fixes
BuildRequires: dos2unix
%if %{with tests} %if %{with tests}
# tests import _testcapi # tests import _testcapi
BuildRequires: python%{python3_pkgversion}-test BuildRequires: python%{python3_pkgversion}-test
@ -149,10 +140,6 @@ Summary: Python documentation generator
Recommends: graphviz Recommends: graphviz
Recommends: ImageMagick Recommends: ImageMagick
# Bundled JavaScript
Provides: bundled(jquery) = 3.5.1
Provides: bundled(underscore) = 1.3.1
Provides: bundled(css3-mediaqueries) = 1.0
%description -n python%{python3_pkgversion}-sphinx %description -n python%{python3_pkgversion}-sphinx
Sphinx is a tool that makes it easy to create intelligent and Sphinx is a tool that makes it easy to create intelligent and
@ -251,9 +238,6 @@ This package contains documentation in the HTML format.
%prep %prep
%autosetup -n %{upstream_name}-%{upstream_version} -p1 %autosetup -n %{upstream_name}-%{upstream_version} -p1
# fix line encoding of bundled jquery.js
dos2unix -k ./sphinx/themes/basic/static/jquery.js
%if %{without imagemagick_tests} %if %{without imagemagick_tests}
rm tests/test_ext_imgconverter.py rm tests/test_ext_imgconverter.py
%endif %endif
@ -374,6 +358,10 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%changelog %changelog
* Fri Mar 10 2023 Karolina Surma <ksurma@redhat.com> - 1:6.1.3-1
- Update to 6.1.3
- Fixes rhbz#2135122
* Thu Mar 09 2023 Karolina Surma <ksurma@redhat.com> - 1:5.3.0-4 * Thu Mar 09 2023 Karolina Surma <ksurma@redhat.com> - 1:5.3.0-4
- Fix tests related to missing setuptools and Babel 2.12 - Fix tests related to missing setuptools and Babel 2.12
- Fixes rhbz#2176685 - Fixes rhbz#2176685

View File

@ -1 +1 @@
SHA512 (Sphinx-5.3.0.tar.gz) = cd2321409f7566c6333d6fc5c4eb4ed2d07490923b0c8762a31f062d9e5d86bbd9bd2c2bb3b93a00b37f31940173404dba8259de940fe402a248cf66a72cd7ae SHA512 (Sphinx-6.1.3.tar.gz) = 97970f9c25355a5d40dedc7386415b84634f753f1f384ea2bbcee127ffcb637deca088daac615dce21518a32270b70e7e268321c72a4997d64d5eae99edadfbe