Compare commits

..

6 Commits
f37 ... f38

Author SHA1 Message Date
Karolina Surma
a31453064c Fix tests failures with Pygments 2.14 2023-01-31 16:26:54 +01:00
Fedora Release Engineering
7507893559 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 17:26:13 +00:00
Karolina Surma
d24b3b01a9 Update to 5.3.0 2022-11-16 16:54:32 +01:00
Karolina Surma
9c0d32b9af Remove duplicate files from the built documentation 2022-08-22 14:46:37 +02:00
Karolina Surma
9104ffe553 Remove reST docs from the -doc package, ship only HTML 2022-08-22 13:56:02 +02:00
Karolina Surma
2da599dd9a Update to 5.1.1 2022-08-17 10:12:09 +02:00
5 changed files with 147 additions and 52 deletions

3
.gitignore vendored
View File

@@ -38,3 +38,6 @@
/Sphinx-4.4.0.tar.gz
/Sphinx-4.5.0.tar.gz
/Sphinx-5.0.2.tar.gz
/Sphinx-5.1.1.tar.gz
/Sphinx-5.2.3.tar.gz
/Sphinx-5.3.0.tar.gz

View File

@@ -1,27 +0,0 @@
From 4b482334a28d0706ba4bd68d51be9c041c135798 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-Fran=C3=A7ois=20B?=
<2589111+jfbu@users.noreply.github.com>
Date: Sat, 25 Jun 2022 21:10:34 +0200
Subject: [PATCH] Fix duplicated field term colons for Docutils 0.18+ (#10595)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
---
sphinx/themes/basic/static/basic.css_t | 2 ++
2 files changed, 4 insertions(+)
diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t
index d8f3fe74626..47f802dc4e7 100644
--- a/sphinx/themes/basic/static/basic.css_t
+++ b/sphinx/themes/basic/static/basic.css_t
@@ -686,9 +686,11 @@ dl.field-list > dt {
padding-right: 5px;
}
+{%- if docutils_version_info[:2] < (0, 18) %}
dl.field-list > dt:after {
content: ":";
}
+{% endif %}
dl.field-list > dd {
padding-left: 0.5em;

View File

@@ -0,0 +1,114 @@
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,7 +24,7 @@
%global upstream_name Sphinx
Name: python-sphinx
%global general_version 5.0.2
%global general_version 5.3.0
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
@@ -45,11 +45,10 @@ Source0: %{pypi_source %{upstream_name} %{upstream_version}}
# which causes that test to fail.
Patch1: sphinx-test_theming.diff
# Fix double colon rendering in Sphinx roles
# This was supposed to get to Sphinx 5.0.3 but it was never released
# Backporting per request: https://bugzilla.redhat.com/show_bug.cgi?id=2166116
# Upstream: https://github.com/sphinx-doc/sphinx/issues/10594
Patch2: Fix-double-colons-with-docutils-0.18.patch
# 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
BuildArch: noarch
@@ -242,7 +241,7 @@ Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be
useful to many other projects.
This package contains documentation in reST and HTML formats.
This package contains documentation in the HTML format.
%prep
@@ -255,11 +254,6 @@ dos2unix -k ./sphinx/themes/basic/static/jquery.js
rm tests/test_ext_imgconverter.py
%endif
# Don't measure coverage:
sed -i '/pytest-cov/d' setup.py
# Not needed on recent Pythons, https://github.com/sphinx-doc/sphinx/pull/8483
sed -i '/typed_ast/d' setup.py
%generate_buildrequires
%pyproject_buildrequires -r %{?with_tests:-x test}
@@ -274,6 +268,10 @@ export SPHINXBUILD="%{python3} ../sphinx/cmd/build.py"
make html SPHINXBUILD="$SPHINXBUILD"
make man SPHINXBUILD="$SPHINXBUILD"
rm -rf _build/html/.buildinfo
# Those files are copied to _build/html/_images and loaded to the
# html pages from there - we can safely remove the duplicated and unused files
rm -rf _build/html/_static/themes _build/html/_static/tutorial
rm -f _build/html/_static/more.png _build/html/_static/translation.svg
mv _build/html ..
popd
@@ -300,12 +298,6 @@ do
done
popd
# Deliver rst files
rm -rf doc/_build
sed -i 's|python ../sphinx-build.py|/usr/bin/sphinx-build|' doc/Makefile
mv doc reST
rm reST/make.bat
# Move language files to /usr/share;
# patch to support this incorporated in 0.6.6
pushd %{buildroot}%{python3_sitelib}
@@ -339,9 +331,11 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%if %{with tests}
%check
# Currently, all linkcheck tests and test_latex_images need internet
# test_build_latex_doc needs internet to download pictures,
# but fails also with it enabled, we decided to skip it entirely
%pytest \
%if %{without internet}
-k "not linkcheck and not test_latex_images" \
-k "not linkcheck and not test_latex_images and not test_build_latex_doc" \
%endif
;
%endif
@@ -353,7 +347,7 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%{_bindir}/sphinx-*
%{python3_sitelib}/sphinx/
%dir %{python3_sitelib}/sphinxcontrib/
%{python3_sitelib}/Sphinx-%{upstream_version}.dist-info/
%{python3_sitelib}/sphinx-%{upstream_version}.dist-info/
%dir %{_datadir}/sphinx/
%dir %{_datadir}/sphinx/locale
%dir %{_datadir}/sphinx/locale/*
@@ -366,13 +360,24 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%files doc
%license LICENSE
%doc html reST
%doc html
%changelog
* Wed Feb 01 2023 Karolina Surma <ksurma@redhat.com> - 1:5.0.2-3
- Backport a fix for rendering double colons in Sphinx roles
- Fixes: rhbz#2166116
* Tue Jan 31 2023 Karolina Surma <ksurma@redhat.com> - 1:5.3.0-3
- Fix tests with python-pygments 2.14+
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Nov 08 2022 Karolina Surma <ksurma@redhat.com> - 1:5.3.0-1
- Update to 5.3.0
- Fixes rhbz#2129546
* Mon Aug 15 2022 Karolina Surma <ksurma@redhat.com> - 1:5.1.1-1
- Update to 5.1.1
- Fixes rhbz#2110473
- Remove reST documentation from the -doc package, ship only HTML
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View File

@@ -1 +1 @@
SHA512 (Sphinx-5.0.2.tar.gz) = d564697f0b82a9a59dd6a81e7822dbeac00fb6cc98cdc2422f04ec87c5133b5e03057ccdfdcfe38dccff41f6c53262d49f4ee6f77047c579aa2e55370bfe2dc6
SHA512 (Sphinx-5.3.0.tar.gz) = cd2321409f7566c6333d6fc5c4eb4ed2d07490923b0c8762a31f062d9e5d86bbd9bd2c2bb3b93a00b37f31940173404dba8259de940fe402a248cf66a72cd7ae