Compare commits

...

13 Commits
f35 ... f37

Author SHA1 Message Date
Karolina Surma
a9da38dc47 Fix rendering of double colons in Sphinx roles with docutils 0.18+ 2023-02-01 10:54:49 +01:00
Fedora Release Engineering
2fbf62bfba Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 22:27:44 +00:00
Karolina Surma
a0cc515b74 Update to 5.0.2 2022-06-30 10:49:45 +02:00
Python Maint
0b87836124 Rebuilt for Python 3.11 2022-06-13 21:14:17 +02:00
Python Maint
be9e7b1508 Bootstrap for Python 3.11 2022-06-13 18:04:49 +02:00
Karolina Surma
81f3c96c10 Update to 4.5.0 2022-04-20 11:25:50 +02:00
Miro Hrončok
055cf1292a Prepare spec for multiple flags in %py3_shebang_flags
See the relevant change of packaging guidelines:
https://pagure.io/packaging-committee/pull-request/1165

tl;dr If we ever add more flags, we want to remove s here, not all flags.
2022-03-23 12:31:47 +01:00
Karolina Surma
b0978bafd9 Update to 4.4.0 2022-02-11 16:46:34 +01:00
Charalampos Stratakis
ca6027ecf0 Add rpminspect file 2022-02-01 20:24:33 +01:00
Fedora Release Engineering
7dfe865724 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 15:38:10 +00:00
Karolina Surma
644aef964c Update to 4.3.1 2021-11-29 16:56:13 +01:00
Karolina Surma
2e80cab0b5 Update to 4.3.0 2021-11-19 15:38:40 +01:00
Karolina Surma
8aeee581aa Update to 4.2.0 2021-09-22 12:18:33 +02:00
11 changed files with 91 additions and 234 deletions

6
.gitignore vendored
View File

@@ -32,3 +32,9 @@
/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

View File

@@ -0,0 +1,27 @@
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

@@ -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])

View File

@@ -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">&lt;stdio.h&gt;</span>""")
+ if pygments_version < (2, 10, 0):
+ expected_expr = ("""<span class="cp">#include</span> """
+ """<span class="cpf">&lt;stdio.h&gt;</span>""")
+ else:
+ expected_expr = ("""<span class="cp">#include</span>"""
+ """<span class="w"> </span>"""
+ """<span class="cpf">&lt;stdio.h&gt;</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">&lt;STDIO.H&gt;</span>""")
+ if pygments_version < (2, 10, 0):
+ expected_expr = ("""<span class="cp">#include</span> """
+ """<span class="cpf">&lt;STDIO.H&gt;</span>""")
+ else:
+ expected_expr = ("""<span class="cp">#include</span>"""
+ """<span class="w"> </span>"""
+ """<span class="cpf">&lt;STDIO.H&gt;</span>""")
assert_count(expected_expr, result, 1)
# literal block in list item should be translated

View File

@@ -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__)

View File

@@ -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.0.2
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
@@ -44,23 +44,12 @@ 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
# 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
BuildArch: noarch
@@ -381,6 +370,45 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%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
* 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

View File

@@ -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

View File

@@ -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
View 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

View File

@@ -1 +1 @@
SHA512 (Sphinx-4.1.2.tar.gz) = 1fe998de7b8fc47989e186835748b7fb5d0b523db95434515b6af29b56d28372f2f92ab917c27cbed51aa0cad13175eda8bf4fc93a8726eb5e93e9bc6995e457
SHA512 (Sphinx-5.0.2.tar.gz) = d564697f0b82a9a59dd6a81e7822dbeac00fb6cc98cdc2422f04ec87c5133b5e03057ccdfdcfe38dccff41f6c53262d49f4ee6f77047c579aa2e55370bfe2dc6

View File

@@ -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'