Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0978bafd9 | ||
|
|
ca6027ecf0 | ||
|
|
7dfe865724 | ||
|
|
644aef964c | ||
|
|
2e80cab0b5 | ||
|
|
8aeee581aa |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -32,3 +32,7 @@
|
||||
/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
|
||||
|
||||
@@ -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])
|
||||
@@ -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__)
|
||||
@@ -24,11 +24,11 @@
|
||||
%global upstream_name Sphinx
|
||||
|
||||
Name: python-sphinx
|
||||
%global general_version 4.1.2
|
||||
%global general_version 4.4.0
|
||||
#global prerel ...
|
||||
%global upstream_version %{general_version}%{?prerel}
|
||||
Version: %{general_version}%{?prerel:~%{prerel}}
|
||||
Release: 3%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Epoch: 1
|
||||
Summary: Python documentation generator
|
||||
|
||||
@@ -44,23 +44,6 @@ 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
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@@ -381,6 +364,25 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
|
||||
|
||||
|
||||
%changelog
|
||||
* 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-4.4.0.tar.gz) = f5780a7da7a5d758b0e145ab9a7f191a9c65fd3ca4624ca3a04f0d161e3cd6c7133df53ff56e42f012687cbce0460178c2e7957974b5b929b341c98db996c640
|
||||
|
||||
@@ -5,8 +5,8 @@ diff -ru Sphinx-1.7.6/tests/test_theming.py Sphinx-1.7.6_patched/tests/test_them
|
||||
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