Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a31453064c | ||
|
|
7507893559 | ||
|
|
d24b3b01a9 | ||
|
|
9c0d32b9af | ||
|
|
9104ffe553 | ||
|
|
2da599dd9a | ||
|
|
2fbf62bfba | ||
|
|
a0cc515b74 | ||
|
|
0b87836124 | ||
|
|
be9e7b1508 | ||
|
|
81f3c96c10 | ||
|
|
055cf1292a | ||
|
|
b0978bafd9 | ||
|
|
ca6027ecf0 | ||
|
|
7dfe865724 | ||
|
|
644aef964c | ||
|
|
2e80cab0b5 | ||
|
|
8aeee581aa |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -32,3 +32,12 @@
|
||||
/Sphinx-3.5.4.tar.gz
|
||||
/Sphinx-4.0.2.tar.gz
|
||||
/Sphinx-4.1.2.tar.gz
|
||||
/Sphinx-4.2.0.tar.gz
|
||||
/Sphinx-4.3.0.tar.gz
|
||||
/Sphinx-4.3.1.tar.gz
|
||||
/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
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 648af37d864b5d76bbe833785d664e40d56d9768 Mon Sep 17 00:00:00 2001
|
||||
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
|
||||
Date: Wed, 11 Aug 2021 01:36:46 +0900
|
||||
Subject: [PATCH] Fix #9537: autodoc: Some typing.* objects are broken
|
||||
|
||||
At the HEAD of 3.10, the implementation of `typing._GenericAlias` has
|
||||
been changed to have correct _name and __name__.
|
||||
---
|
||||
sphinx/util/typing.py | 6 ++++--
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
|
||||
index f856950bf2..df5277ae7b 100644
|
||||
--- a/sphinx/util/typing.py
|
||||
+++ b/sphinx/util/typing.py
|
||||
@@ -148,7 +148,9 @@ def _restify_py37(cls: Optional[Type]) -> str:
|
||||
args = ', '.join(restify(a) for a in cls.__args__)
|
||||
return ':obj:`~typing.Union`\\ [%s]' % args
|
||||
elif inspect.isgenericalias(cls):
|
||||
- if getattr(cls, '_name', None):
|
||||
+ if isinstance(cls.__origin__, typing._SpecialForm):
|
||||
+ text = restify(cls.__origin__) # type: ignore
|
||||
+ elif getattr(cls, '_name', None):
|
||||
if cls.__module__ == 'typing':
|
||||
text = ':class:`~%s.%s`' % (cls.__module__, cls._name)
|
||||
else:
|
||||
@@ -344,7 +346,7 @@ def _stringify_py37(annotation: Any) -> str:
|
||||
if not isinstance(annotation.__args__, (list, tuple)):
|
||||
# broken __args__ found
|
||||
pass
|
||||
- elif qualname == 'Union':
|
||||
+ elif qualname in ('Optional', 'Union'):
|
||||
if len(annotation.__args__) > 1 and annotation.__args__[-1] is NoneType:
|
||||
if len(annotation.__args__) > 2:
|
||||
args = ', '.join(stringify(a) for a in annotation.__args__[:-1])
|
||||
114
fix-tests-with-pygments-2.14.patch
Normal file
114
fix-tests-with-pygments-2.14.patch
Normal 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>"""</span>\n'
|
||||
- '<span> this is Class1</span>\n'
|
||||
- '<span> """</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>"""</span>\n'
|
||||
+ '<span> this is Class1</span>\n'
|
||||
+ '<span> """</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>"""</span>\n'
|
||||
+ '<span> this is Class1</span>\n'
|
||||
+ '<span> """</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
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
From 06ec5b027d01e8f7717e4687f89f335e83545ff9 Mon Sep 17 00:00:00 2001
|
||||
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
|
||||
Date: Wed, 18 Aug 2021 01:50:08 +0900
|
||||
Subject: [PATCH] Fix test: Tests has been broken with pygments-2.10+
|
||||
|
||||
---
|
||||
tests/test_intl.py | 21 +++++++++++++++++----
|
||||
1 file changed, 17 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tests/test_intl.py b/tests/test_intl.py
|
||||
index 7791b4aeed5..e9e7ee9e24b 100644
|
||||
--- a/tests/test_intl.py
|
||||
+++ b/tests/test_intl.py
|
||||
@@ -12,6 +12,7 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
+import pygments
|
||||
import pytest
|
||||
from babel.messages import mofile, pofile
|
||||
from babel.messages.catalog import Catalog
|
||||
@@ -30,6 +31,8 @@
|
||||
},
|
||||
)
|
||||
|
||||
+pygments_version = tuple(int(v) for v in pygments.__version__.split('.'))
|
||||
+
|
||||
|
||||
def read_po(pathname):
|
||||
with pathname.open() as f:
|
||||
@@ -1060,8 +1063,13 @@ def test_additional_targets_should_not_be_translated(app):
|
||||
assert_count(expected_expr, result, 1)
|
||||
|
||||
# C code block with lang should not be translated but be *C* highlighted
|
||||
- expected_expr = ("""<span class="cp">#include</span> """
|
||||
- """<span class="cpf"><stdio.h></span>""")
|
||||
+ if pygments_version < (2, 10, 0):
|
||||
+ expected_expr = ("""<span class="cp">#include</span> """
|
||||
+ """<span class="cpf"><stdio.h></span>""")
|
||||
+ else:
|
||||
+ expected_expr = ("""<span class="cp">#include</span>"""
|
||||
+ """<span class="w"> </span>"""
|
||||
+ """<span class="cpf"><stdio.h></span>""")
|
||||
assert_count(expected_expr, result, 1)
|
||||
|
||||
# literal block in list item should not be translated
|
||||
@@ -1138,8 +1146,13 @@ def test_additional_targets_should_be_translated(app):
|
||||
assert_count(expected_expr, result, 1)
|
||||
|
||||
# C code block with lang should be translated and be *C* highlighted
|
||||
- expected_expr = ("""<span class="cp">#include</span> """
|
||||
- """<span class="cpf"><STDIO.H></span>""")
|
||||
+ if pygments_version < (2, 10, 0):
|
||||
+ expected_expr = ("""<span class="cp">#include</span> """
|
||||
+ """<span class="cpf"><STDIO.H></span>""")
|
||||
+ else:
|
||||
+ expected_expr = ("""<span class="cp">#include</span>"""
|
||||
+ """<span class="w"> </span>"""
|
||||
+ """<span class="cpf"><STDIO.H></span>""")
|
||||
assert_count(expected_expr, result, 1)
|
||||
|
||||
# literal block in list item should be translated
|
||||
@@ -1,36 +0,0 @@
|
||||
From d0c97e9eb57126e38b7b018a101df1ecb1ad12b8 Mon Sep 17 00:00:00 2001
|
||||
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
|
||||
Date: Sat, 31 Jul 2021 01:41:35 +0900
|
||||
Subject: [PATCH] Fix #9504: autodoc: generate incorrect reference to the
|
||||
parent class
|
||||
|
||||
Autodoc generates incorrect references to the parent class the target
|
||||
class inherites the class having `_name` attribute. It conciders the
|
||||
parent is a kind of SpecialForm'ed class by mistake. This uses
|
||||
`isinstance(X, SpecialForm)` to check that.
|
||||
|
||||
Note: SpecialForm became a class since Python 3.7.
|
||||
---
|
||||
CHANGES | 2 ++
|
||||
sphinx/util/typing.py | 8 ++------
|
||||
2 files changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
|
||||
index 012d32e524..f856950bf2 100644
|
||||
--- a/sphinx/util/typing.py
|
||||
+++ b/sphinx/util/typing.py
|
||||
@@ -171,12 +171,8 @@ def _restify_py37(cls: Optional[Type]) -> str:
|
||||
text += r"\ [%s]" % ", ".join(restify(a) for a in cls.__args__)
|
||||
|
||||
return text
|
||||
- elif hasattr(cls, '_name'):
|
||||
- # SpecialForm
|
||||
- if cls.__module__ == 'typing':
|
||||
- return ':obj:`~%s.%s`' % (cls.__module__, cls._name)
|
||||
- else:
|
||||
- return ':obj:`%s.%s`' % (cls.__module__, cls._name)
|
||||
+ elif isinstance(cls, typing._SpecialForm):
|
||||
+ return ':obj:`~%s.%s`' % (cls.__module__, cls._name)
|
||||
elif hasattr(cls, '__qualname__'):
|
||||
if cls.__module__ == 'typing':
|
||||
return ':class:`~%s.%s`' % (cls.__module__, cls.__qualname__)
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
# Unset -s on python shebang to allow RPM-installed sphinx to be used
|
||||
# with user-installed modules (#1903763)
|
||||
%global py3_shebang_flags %nil
|
||||
%global py3_shebang_flags %(echo %py3_shebang_flags | sed s/s//)
|
||||
|
||||
# No internet in Koji
|
||||
%bcond_with internet
|
||||
@@ -24,7 +24,7 @@
|
||||
%global upstream_name Sphinx
|
||||
|
||||
Name: python-sphinx
|
||||
%global general_version 4.1.2
|
||||
%global general_version 5.3.0
|
||||
#global prerel ...
|
||||
%global upstream_version %{general_version}%{?prerel}
|
||||
Version: %{general_version}%{?prerel:~%{prerel}}
|
||||
@@ -44,23 +44,11 @@ Source0: %{pypi_source %{upstream_name} %{upstream_version}}
|
||||
# Allow extra themes to exist. We pull in python3-sphinx-theme-alabaster
|
||||
# which causes that test to fail.
|
||||
Patch1: sphinx-test_theming.diff
|
||||
# `types.Union` was renamed to `types.UnionType` on the HEAD of Python 3.10
|
||||
# (refs: python/cpython#27342). Afterwars, sphinx-build crashes because of ImportError
|
||||
# Merged upstream: https://github.com/sphinx-doc/sphinx/pull/9513
|
||||
Patch2: rename-types-Union-to-types-UnionType.patch
|
||||
# Fix test failures with python-pygments 2.10+
|
||||
# https://github.com/sphinx-doc/sphinx/pull/9557
|
||||
Patch3: fix-tests-with-pygments-210.patch
|
||||
# Some objects under ``typing`` module are not displayed well
|
||||
# with the HEAD of Python 3.10.0rc2+
|
||||
# Merged upstream: https://github.com/sphinx-doc/sphinx/pull/9538
|
||||
Patch4: display-typing-objects-correctly-with-Python-310.patch
|
||||
# Render typing.Annotated correctly with Python 3.10
|
||||
# Merged upstream: https://github.com/sphinx-doc/sphinx/pull/9590
|
||||
Patch5: render-typing-Annotated-correctly-with-Python-3.10.patch
|
||||
# Generate correct reference to the parent class
|
||||
# Merged upstream: https://github.com/sphinx-doc/sphinx/pull/9515/
|
||||
Patch6: generate-correct-reference-to-parent-class.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
|
||||
|
||||
@@ -253,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
|
||||
@@ -266,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}
|
||||
@@ -285,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
|
||||
|
||||
@@ -311,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}
|
||||
@@ -350,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
|
||||
@@ -364,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/*
|
||||
@@ -377,10 +360,60 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
|
||||
|
||||
%files doc
|
||||
%license LICENSE
|
||||
%doc html reST
|
||||
%doc html
|
||||
|
||||
|
||||
%changelog
|
||||
* 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
|
||||
|
||||
* Tue Jun 21 2022 Karolina Surma <ksurma@redhat.com> - 1:5.0.2-1
|
||||
- Update to 5.0.2
|
||||
|
||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1:4.5.0-3
|
||||
- Rebuilt for Python 3.11
|
||||
|
||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1:4.5.0-2
|
||||
- Bootstrap for Python 3.11
|
||||
|
||||
* Fri Apr 01 2022 Karolina Surma <ksurma@redhat.com> - 1:4.5.0-1
|
||||
- Update to 4.5.0
|
||||
- Fixes rhbz#2068924
|
||||
|
||||
* Tue Feb 01 2022 Karolina Surma <ksurma@redhat.com> - 1:4.4.0-1
|
||||
- Update to 4.4.0
|
||||
- Fixes rhbz#2033955
|
||||
|
||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Mon Nov 29 2021 Karolina Surma <ksurma@redhat.com> - 1:4.3.1-1
|
||||
- Update to 4.3.1
|
||||
- Fixes rhbz#2027059
|
||||
|
||||
* Fri Nov 19 2021 Karolina Surma <ksurma@redhat.com> - 1:4.3.0-1
|
||||
- Update to 4.3.0
|
||||
- Fixes rhbz#2022111
|
||||
|
||||
* Fri Sep 17 2021 Karolina Surma <ksurma@redhat.com> - 1:4.2.0-1
|
||||
- Update to 4.2.0
|
||||
- Fixes rhbz#2003427
|
||||
|
||||
* Thu Sep 16 2021 Karolina Surma <ksurma@redhat.com> - 1:4.1.2-3
|
||||
- Display typing objects correctly with Python 3.10 (fix FTBFS)
|
||||
- Generate correct reference to parent class if class has `_name` attribute
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
From 8b2031c747e7c7e6b845ee2e3db47de617d33cc6 Mon Sep 17 00:00:00 2001
|
||||
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
|
||||
Date: Fri, 30 Jul 2021 01:27:38 +0900
|
||||
Subject: [PATCH] Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10
|
||||
|
||||
Recently, `types.Union` was renamed to `types.UnionType` on the HEAD
|
||||
of 3.10 (refs: python/cpython#27342). After this change, sphinx-build
|
||||
has been crashed because of ImportError.
|
||||
---
|
||||
sphinx/util/typing.py | 12 ++++++------
|
||||
1 files changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
|
||||
index f1723c035a..012d32e524 100644
|
||||
--- a/sphinx/util/typing.py
|
||||
+++ b/sphinx/util/typing.py
|
||||
@@ -33,10 +33,10 @@ def _evaluate(self, globalns: Dict, localns: Dict) -> Any:
|
||||
ref = _ForwardRef(self.arg)
|
||||
return ref._eval_type(globalns, localns)
|
||||
|
||||
-if sys.version_info > (3, 10):
|
||||
- from types import Union as types_Union
|
||||
-else:
|
||||
- types_Union = None
|
||||
+try:
|
||||
+ from types import UnionType # type: ignore # python 3.10 or above
|
||||
+except ImportError:
|
||||
+ UnionType = None
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
@@ -114,7 +114,7 @@ def restify(cls: Optional[Type]) -> str:
|
||||
return ':class:`%s`' % INVALID_BUILTIN_CLASSES[cls]
|
||||
elif inspect.isNewType(cls):
|
||||
return ':class:`%s`' % cls.__name__
|
||||
- elif types_Union and isinstance(cls, types_Union):
|
||||
+ elif UnionType and isinstance(cls, UnionType):
|
||||
if len(cls.__args__) > 1 and None in cls.__args__:
|
||||
args = ' | '.join(restify(a) for a in cls.__args__ if a)
|
||||
return 'Optional[%s]' % args
|
||||
@@ -337,7 +337,7 @@ def _stringify_py37(annotation: Any) -> str:
|
||||
elif hasattr(annotation, '__origin__'):
|
||||
# instantiated generic provided by a user
|
||||
qualname = stringify(annotation.__origin__)
|
||||
- elif types_Union and isinstance(annotation, types_Union): # types.Union (for py3.10+)
|
||||
+ elif UnionType and isinstance(annotation, UnionType): # types.Union (for py3.10+)
|
||||
qualname = 'types.Union'
|
||||
else:
|
||||
# we weren't able to extract the base type, appending arguments would
|
||||
@@ -1,26 +0,0 @@
|
||||
From b82d3ef05a75b6dad9679f8746db5ef89785c7c0 Mon Sep 17 00:00:00 2001
|
||||
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
|
||||
Date: Sun, 29 Aug 2021 15:40:49 +0900
|
||||
Subject: [PATCH] Fix #9589: autodoc: typing.Annotated has wrongly been
|
||||
rendered
|
||||
|
||||
At the HEAD of 3.10, the implementation of `typing.Annotated` has
|
||||
been changed to have __qualname__.
|
||||
---
|
||||
CHANGES | 4 ++--
|
||||
sphinx/util/typing.py | 2 ++
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
|
||||
index df5277ae7b..35f808211b 100644
|
||||
--- a/sphinx/util/typing.py
|
||||
+++ b/sphinx/util/typing.py
|
||||
@@ -306,6 +306,8 @@ def stringify(annotation: Any) -> str:
|
||||
return 'None'
|
||||
elif annotation in INVALID_BUILTIN_CLASSES:
|
||||
return INVALID_BUILTIN_CLASSES[annotation]
|
||||
+ elif str(annotation).startswith('typing.Annotated'): # for py310+
|
||||
+ pass
|
||||
elif (getattr(annotation, '__module__', None) == 'builtins' and
|
||||
getattr(annotation, '__qualname__', None)):
|
||||
return annotation.__qualname__
|
||||
4
rpminspect.yaml
Normal file
4
rpminspect.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
# exclude XML template (not always valid) from XML validity check:
|
||||
xml:
|
||||
ignore:
|
||||
- /usr/lib/python*/site-packages/sphinx/themes/basic/opensearch.xml
|
||||
2
sources
2
sources
@@ -1 +1 @@
|
||||
SHA512 (Sphinx-4.1.2.tar.gz) = 1fe998de7b8fc47989e186835748b7fb5d0b523db95434515b6af29b56d28372f2f92ab917c27cbed51aa0cad13175eda8bf4fc93a8726eb5e93e9bc6995e457
|
||||
SHA512 (Sphinx-5.3.0.tar.gz) = cd2321409f7566c6333d6fc5c4eb4ed2d07490923b0c8762a31f062d9e5d86bbd9bd2c2bb3b93a00b37f31940173404dba8259de940fe402a248cf66a72cd7ae
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
diff -ru Sphinx-1.7.6/tests/test_theming.py Sphinx-1.7.6_patched/tests/test_theming.py
|
||||
--- Sphinx-1.7.6/tests/test_theming.py 2018-07-16 11:24:40.000000000 +0200
|
||||
+++ Sphinx-1.7.6_patched/tests/test_theming.py 2018-07-20 15:17:35.049263077 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
@@ -25,7 +25,7 @@
|
||||
themes.append('alabaster')
|
||||
|
||||
# test Theme class API
|
||||
- assert set(app.html_themes.keys()) == set(themes)
|
||||
+ assert set(app.html_themes.keys()) >= set(themes)
|
||||
assert app.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
|
||||
assert app.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
|
||||
assert app.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'
|
||||
- assert set(app.registry.html_themes.keys()) == set(themes)
|
||||
+ assert set(app.registry.html_themes.keys()) >= set(themes)
|
||||
assert app.registry.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
|
||||
assert app.registry.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
|
||||
assert app.registry.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'
|
||||
|
||||
Reference in New Issue
Block a user