Compare commits

...

No commits in common. 'cs10' and 'c9' have entirely different histories.
cs10 ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/sphinx-7.2.6.tar.gz SOURCES/Sphinx-3.4.3.tar.gz

@ -1 +1 @@
f7327207321395a710e8b4edbe9e585e2511e1e7 SOURCES/sphinx-7.2.6.tar.gz e72412976b8b47cb5a55cc1cb5ec2fdfe358ed7c SOURCES/Sphinx-3.4.3.tar.gz

@ -1,69 +0,0 @@
From bc8939b34037f81b8610f3b26caec128ee20a2f4 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Tue, 28 Nov 2023 14:43:58 +0100
Subject: [PATCH] Adjust the expected string to match Python 3.11+ changed
output
---
tests/test_ext_autodoc_configs.py | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/tests/test_ext_autodoc_configs.py b/tests/test_ext_autodoc_configs.py
index 45bc729b73e..0994c08e899 100644
--- a/tests/test_ext_autodoc_configs.py
+++ b/tests/test_ext_autodoc_configs.py
@@ -11,6 +11,7 @@
from .test_ext_autodoc import do_autodoc
IS_PYPY = platform.python_implementation() == 'PyPy'
+IS_PY311_AND_LATER = sys.version_info >= (3, 11)
@contextmanager
@@ -1627,7 +1628,10 @@ def test_autodoc_default_options(app):
assert ' Iterate squares of each value.' in actual
if not IS_PYPY:
assert ' .. py:attribute:: CustomIter.__weakref__' in actual
- assert ' list of weak references to the object (if defined)' in actual
+ if IS_PY311_AND_LATER:
+ assert ' list of weak references to the object' in actual
+ else:
+ assert ' list of weak references to the object (if defined)' in actual
# :exclude-members: None - has no effect. Unlike :members:,
# :special-members:, etc. where None == "include all", here None means
@@ -1651,7 +1655,10 @@ def test_autodoc_default_options(app):
assert ' Iterate squares of each value.' in actual
if not IS_PYPY:
assert ' .. py:attribute:: CustomIter.__weakref__' in actual
- assert ' list of weak references to the object (if defined)' in actual
+ if IS_PY311_AND_LATER:
+ assert ' list of weak references to the object' in actual
+ else:
+ assert ' list of weak references to the object (if defined)' in actual
assert ' .. py:method:: CustomIter.snafucate()' in actual
assert ' Makes this snafucated.' in actual
@@ -1698,7 +1705,10 @@ def test_autodoc_default_options_with_values(app):
assert ' Iterate squares of each value.' in actual
if not IS_PYPY:
assert ' .. py:attribute:: CustomIter.__weakref__' not in actual
- assert ' list of weak references to the object (if defined)' not in actual
+ if IS_PY311_AND_LATER:
+ assert ' list of weak references to the object' not in actual
+ else:
+ assert ' list of weak references to the object (if defined)' not in actual
# with :exclude-members:
app.config.autodoc_default_options = {
@@ -1722,6 +1732,9 @@ def test_autodoc_default_options_with_values(app):
assert ' Iterate squares of each value.' in actual
if not IS_PYPY:
assert ' .. py:attribute:: CustomIter.__weakref__' not in actual
- assert ' list of weak references to the object (if defined)' not in actual
+ if IS_PY311_AND_LATER:
+ assert ' list of weak references to the object' not in actual
+ else:
+ assert ' list of weak references to the object (if defined)' not in actual
assert ' .. py:method:: CustomIter.snafucate()' not in actual
assert ' Makes this snafucated.' not in actual

@ -0,0 +1,25 @@
From 924b2e2cee46753d26a8419f273ffe045bbfb9bb Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Tue, 21 Nov 2023 11:27:42 +0100
Subject: [PATCH] Enable autodoc build with extension modules
---
sphinx/ext/autodoc/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
index 54e91a1..dba5769 100644
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1871,7 +1871,7 @@ class DataDocumenter(GenericAliasMixin, NewTypeMixin, TypeVarMixin,
for (classname, attrname), annotation in analyzer.annotations.items():
if classname == '' and attrname not in annotations:
annotations[attrname] = annotation
- except AttributeError:
+ except (AttributeError, PycodeError):
pass
def import_object(self, raiseerror: bool = False) -> bool:
--
2.41.0

@ -1,51 +0,0 @@
From 22caeb2631922c3f5e3f4bb45d8c1610edb6ef74 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Thu, 22 Aug 2024 12:33:34 +0200
Subject: [PATCH] Fix autodoc tests with Python 3.12.3+
---
tests/test_ext_autodoc.py | 5 ++++-
tests/test_ext_autodoc_configs.py | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py
index 7062763..5f63214 100644
--- a/tests/test_ext_autodoc.py
+++ b/tests/test_ext_autodoc.py
@@ -1407,7 +1407,10 @@ def test_enum_class(app):
options = {"members": None}
actual = do_autodoc(app, 'class', 'target.enums.EnumCls', options)
- if sys.version_info[:2] >= (3, 12):
+ if sys.version_info[:3] >= (3, 12, 3):
+ args = ('(value, names=<not given>, *values, module=None, '
+ 'qualname=None, type=None, start=1, boundary=None)')
+ elif sys.version_info[:2] >= (3, 12):
args = ('(value, names=None, *values, module=None, '
'qualname=None, type=None, start=1, boundary=None)')
elif sys.version_info[:2] >= (3, 11):
diff --git a/tests/test_ext_autodoc_configs.py b/tests/test_ext_autodoc_configs.py
index 0994c08..a240c4b 100644
--- a/tests/test_ext_autodoc_configs.py
+++ b/tests/test_ext_autodoc_configs.py
@@ -1273,7 +1273,7 @@ def test_autodoc_type_aliases(app):
' docstring',
'',
'',
- '.. py:function:: mult(x: int, y: int) -> int',
+ '.. py:function:: mult(x: myint, y: myint) -> myint',
' mult(x: float, y: float) -> float',
' :module: target.autodoc_type_aliases',
'',
@@ -1344,7 +1344,7 @@ def test_autodoc_type_aliases(app):
' docstring',
'',
'',
- '.. py:function:: mult(x: myint, y: myint) -> myint',
+ '.. py:function:: mult(x: myint, y: myint) -> myint',
' mult(x: float, y: float) -> float',
' :module: target.autodoc_type_aliases',
'',
--
2.46.0

@ -1,204 +0,0 @@
From 9699465414515f0eba76d05069e755b5bcf34eef Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Mon, 15 Jan 2024 16:19:32 +0100
Subject: [PATCH] Make the first party extensions optional, add [extensions]
extra
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
---
pyproject.toml | 33 +++++++++++++++++++++++++++------
sphinx/application.py | 6 +++---
sphinx/registry.py | 9 ++++++---
sphinx/testing/fixtures.py | 6 ++++++
tests/test_api_translator.py | 2 ++
tests/test_build_html.py | 3 +++
6 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 8f93701..41c28c5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -55,12 +55,6 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
- "sphinxcontrib-applehelp",
- "sphinxcontrib-devhelp",
- "sphinxcontrib-jsmath",
- "sphinxcontrib-htmlhelp>=2.0.0",
- "sphinxcontrib-serializinghtml>=1.1.9",
- "sphinxcontrib-qthelp",
"Jinja2>=3.0",
"Pygments>=2.14",
"docutils>=0.18.1,<0.21",
@@ -76,8 +70,35 @@ dependencies = [
dynamic = ["version"]
[project.optional-dependencies]
+applehelp = [
+ "sphinxcontrib-applehelp",
+]
+devhelp = [
+ "sphinxcontrib-devhelp",
+]
+jsmath = [
+ "sphinxcontrib-jsmath",
+]
+htmlhelp = [
+ "sphinxcontrib-htmlhelp>=2.0.0",
+]
+serializinghtml = [
+ "sphinxcontrib-serializinghtml>=1.1.9",
+]
+qthelp = [
+ "sphinxcontrib-qthelp",
+]
+extensions = [
+ "sphinx[applehelp]",
+ "sphinx[devhelp]",
+ "sphinx[jsmath]",
+ "sphinx[htmlhelp]",
+ "sphinx[serializinghtml]",
+ "sphinx[qthelp]",
+]
docs = [
"sphinxcontrib-websupport",
+ "sphinx[extensions]",
]
lint = [
"flake8>=3.5.0",
diff --git a/sphinx/application.py b/sphinx/application.py
index d5fbaa9..b030dab 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -226,7 +226,7 @@ class Sphinx:
# load all built-in extension modules, first-party extension modules,
# and first-party themes
for extension in builtin_extensions:
- self.setup_extension(extension)
+ self.setup_extension(extension, skip_nonimportable=extension in _first_party_extensions)
# load all user-given extension modules
for extension in self.config.extensions:
@@ -395,7 +395,7 @@ class Sphinx:
# ---- general extensibility interface -------------------------------------
- def setup_extension(self, extname: str) -> None:
+ def setup_extension(self, extname: str, skip_nonimportable: bool = False) -> None:
"""Import and setup a Sphinx extension module.
Load the extension given by the module *name*. Use this if your
@@ -403,7 +403,7 @@ class Sphinx:
called twice.
"""
logger.debug('[app] setting up extension: %r', extname)
- self.registry.load_extension(self, extname)
+ self.registry.load_extension(self, extname, skip_nonimportable=skip_nonimportable)
@staticmethod
def require_sphinx(version: tuple[int, int] | str) -> None:
diff --git a/sphinx/registry.py b/sphinx/registry.py
index 501661d..96d4554 100644
--- a/sphinx/registry.py
+++ b/sphinx/registry.py
@@ -430,7 +430,7 @@ class SphinxComponentRegistry:
def add_html_theme(self, name: str, theme_path: str) -> None:
self.html_themes[name] = theme_path
- def load_extension(self, app: Sphinx, extname: str) -> None:
+ def load_extension(self, app: Sphinx, extname: str, skip_nonimportable: bool = False) -> None:
"""Load a Sphinx extension."""
if extname in app.extensions: # already loaded
return
@@ -446,9 +446,12 @@ class SphinxComponentRegistry:
try:
mod = import_module(extname)
except ImportError as err:
+ msg = __('Could not import extension %s')
+ if skip_nonimportable:
+ logger.debug(msg % extname)
+ return
logger.verbose(__('Original exception:\n') + traceback.format_exc())
- raise ExtensionError(__('Could not import extension %s') % extname,
- err) from err
+ raise ExtensionError(msg % extname, err) from err
setup = getattr(mod, 'setup', None)
if setup is None:
diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py
index 0cc4882..f57f709 100644
--- a/sphinx/testing/fixtures.py
+++ b/sphinx/testing/fixtures.py
@@ -22,6 +22,7 @@ DEFAULT_ENABLED_MARKERS = [
'sphinx(builder, testroot=None, freshenv=False, confoverrides=None, tags=None,'
' docutilsconf=None, parallel=0): arguments to initialize the sphinx test application.'
),
+ 'sphinxcontrib(...): required sphinxcontrib.* extensions',
'test_params(shared_result=...): test parameters.',
]
@@ -67,6 +68,11 @@ def app_params(request: Any, test_params: dict, shared_result: SharedResult,
sphinx.application.Sphinx initialization
"""
+ # ##### process pytest.mark.sphinxcontrib
+ for info in reversed(list(request.node.iter_markers("sphinxcontrib"))):
+ for arg in info.args:
+ pytest.importorskip("sphinxcontrib." + arg)
+
# ##### process pytest.mark.sphinx
pargs = {}
diff --git a/tests/test_api_translator.py b/tests/test_api_translator.py
index 9f2bd44..81575b7 100644
--- a/tests/test_api_translator.py
+++ b/tests/test_api_translator.py
@@ -36,6 +36,7 @@ def test_singlehtml_set_translator_for_singlehtml(app, status, warning):
assert translator_class.__name__ == 'ConfSingleHTMLTranslator'
+@pytest.mark.sphinxcontrib('serializinghtml')
@pytest.mark.sphinx('pickle', testroot='api-set-translator')
def test_pickle_set_translator_for_pickle(app, status, warning):
translator_class = app.builder.get_translator_class()
@@ -43,6 +44,7 @@ def test_pickle_set_translator_for_pickle(app, status, warning):
assert translator_class.__name__ == 'ConfPickleTranslator'
+@pytest.mark.sphinxcontrib('serializinghtml')
@pytest.mark.sphinx('json', testroot='api-set-translator')
def test_json_set_translator_for_json(app, status, warning):
translator_class = app.builder.get_translator_class()
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index 07f101d..c512a33 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -1544,6 +1544,7 @@ def test_html_math_renderer_is_imgmath(app, status, warning):
assert app.builder.math_renderer_name == 'imgmath'
+@pytest.mark.sphinxcontrib('serializinghtml', 'jsmath')
@pytest.mark.sphinx('html', testroot='basic',
confoverrides={'extensions': ['sphinxcontrib.jsmath',
'sphinx.ext.imgmath']})
@@ -1564,6 +1565,7 @@ def test_html_math_renderer_is_duplicated2(app, status, warning):
assert app.builder.math_renderer_name == 'imgmath' # The another one is chosen
+@pytest.mark.sphinxcontrib('jsmath')
@pytest.mark.sphinx('html', testroot='basic',
confoverrides={'extensions': ['sphinxcontrib.jsmath',
'sphinx.ext.imgmath'],
@@ -1572,6 +1574,7 @@ def test_html_math_renderer_is_chosen(app, status, warning):
assert app.builder.math_renderer_name == 'imgmath'
+@pytest.mark.sphinxcontrib('jsmath')
@pytest.mark.sphinx('html', testroot='basic',
confoverrides={'extensions': ['sphinxcontrib.jsmath',
'sphinx.ext.mathjax'],
--
2.43.0

@ -1,265 +0,0 @@
From ec721111162a24a960b8c725340e183f970d4a1c Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Mon, 10 Jun 2024 16:53:08 +0200
Subject: [PATCH] Patch-out snowballstemmer and replace it with a dummy
implementation
---
pyproject.toml | 1 -
sphinx/search/da.py | 2 +-
sphinx/search/de.py | 2 +-
sphinx/search/dummystemmer.py | 8 ++++++++
sphinx/search/en.py | 2 +-
sphinx/search/es.py | 2 +-
sphinx/search/fi.py | 2 +-
sphinx/search/fr.py | 2 +-
sphinx/search/hu.py | 2 +-
sphinx/search/it.py | 2 +-
sphinx/search/nl.py | 2 +-
sphinx/search/no.py | 2 +-
sphinx/search/pt.py | 2 +-
sphinx/search/ro.py | 2 +-
sphinx/search/ru.py | 2 +-
sphinx/search/sv.py | 2 +-
sphinx/search/tr.py | 2 +-
sphinx/search/zh.py | 2 +-
18 files changed, 24 insertions(+), 17 deletions(-)
create mode 100644 sphinx/search/dummystemmer.py
diff --git a/pyproject.toml b/pyproject.toml
index 0d19435..32cf5bf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -58,7 +58,6 @@ dependencies = [
"Jinja2>=3.0",
"Pygments>=2.14",
"docutils>=0.18.1,<0.21",
- "snowballstemmer>=2.0",
"babel>=2.9",
"alabaster>=0.7,<0.8",
"imagesize>=1.3",
diff --git a/sphinx/search/da.py b/sphinx/search/da.py
index 9b5b9f5..0ff9a56 100644
--- a/sphinx/search/da.py
+++ b/sphinx/search/da.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/de.py b/sphinx/search/de.py
index 1c253fd..76af961 100644
--- a/sphinx/search/de.py
+++ b/sphinx/search/de.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/dummystemmer.py b/sphinx/search/dummystemmer.py
new file mode 100644
index 0000000..46f8fb7
--- /dev/null
+++ b/sphinx/search/dummystemmer.py
@@ -0,0 +1,8 @@
+# Dummy stemmer implementation doing nothing
+
+class stemmer:
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def stemWord(self, word):
+ return word
diff --git a/sphinx/search/en.py b/sphinx/search/en.py
index caa6f66..1e3fbb8 100644
--- a/sphinx/search/en.py
+++ b/sphinx/search/en.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage
diff --git a/sphinx/search/es.py b/sphinx/search/es.py
index c5d9a5c..96956be 100644
--- a/sphinx/search/es.py
+++ b/sphinx/search/es.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/fi.py b/sphinx/search/fi.py
index 70114f8..5de87ad 100644
--- a/sphinx/search/fi.py
+++ b/sphinx/search/fi.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/fr.py b/sphinx/search/fr.py
index 01319dd..9b43d74 100644
--- a/sphinx/search/fr.py
+++ b/sphinx/search/fr.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/hu.py b/sphinx/search/hu.py
index eed08db..4dde945 100644
--- a/sphinx/search/hu.py
+++ b/sphinx/search/hu.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/it.py b/sphinx/search/it.py
index 7bf712b..9e44732 100644
--- a/sphinx/search/it.py
+++ b/sphinx/search/it.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/nl.py b/sphinx/search/nl.py
index a610b12..f85bec7 100644
--- a/sphinx/search/nl.py
+++ b/sphinx/search/nl.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/no.py b/sphinx/search/no.py
index a69380b..8f9be62 100644
--- a/sphinx/search/no.py
+++ b/sphinx/search/no.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/pt.py b/sphinx/search/pt.py
index 908a417..ee266ef 100644
--- a/sphinx/search/pt.py
+++ b/sphinx/search/pt.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/ro.py b/sphinx/search/ro.py
index b6c9d67..ee77c77 100644
--- a/sphinx/search/ro.py
+++ b/sphinx/search/ro.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Set
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage
diff --git a/sphinx/search/ru.py b/sphinx/search/ru.py
index b8412c1..bda63bd 100644
--- a/sphinx/search/ru.py
+++ b/sphinx/search/ru.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/sv.py b/sphinx/search/sv.py
index 88cc560..52e4983 100644
--- a/sphinx/search/sv.py
+++ b/sphinx/search/sv.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage, parse_stop_word
diff --git a/sphinx/search/tr.py b/sphinx/search/tr.py
index f4a865c..934fd41 100644
--- a/sphinx/search/tr.py
+++ b/sphinx/search/tr.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Set
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage
diff --git a/sphinx/search/zh.py b/sphinx/search/zh.py
index 2a3a6e7..e3ee9d0 100644
--- a/sphinx/search/zh.py
+++ b/sphinx/search/zh.py
@@ -6,7 +6,7 @@ import os
import re
from typing import TYPE_CHECKING, Dict, List
-import snowballstemmer
+from . import dummystemmer as snowballstemmer
from sphinx.search import SearchLanguage
--
2.45.2

@ -1,12 +1,12 @@
diff -ru Sphinx-1.7.6/tests/test_theming.py Sphinx-1.7.6_patched/tests/test_theming.py 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/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 +++ Sphinx-1.7.6_patched/tests/test_theming.py 2018-07-20 15:17:35.049263077 +0200
@@ -25,7 +25,7 @@ @@ -31,7 +31,7 @@
themes.append('alabaster') themes.append('alabaster')
# test Theme class API # test Theme class API
- assert set(app.registry.html_themes.keys()) == set(themes) - assert set(app.html_themes.keys()) == set(themes)
+ assert set(app.registry.html_themes.keys()) >= set(themes) + assert set(app.html_themes.keys()) >= set(themes)
assert app.registry.html_themes['test-theme'] == str(app.srcdir / 'test_theme' / 'test-theme') assert app.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
assert app.registry.html_themes['ziptheme'] == str(app.srcdir / 'ziptheme.zip') assert app.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
assert app.registry.html_themes['staticfiles'] == str(app.srcdir / 'test_theme' / 'staticfiles') assert app.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'

@ -1,71 +1,58 @@
# When bootstrapping sphinx in Fedora, we don't yet have sphinxcontrib-* # When bootstrapping sphinx, we don't yet have sphinxcontrib-websupport
# Without the packages, we have warnings in docs, but it's not a hard dependency # Without it we have warnings in docs, but it's not a hard dependency
# We don't want to support sphinxcontrib-* in RHEL, hence disabling the dependencies %bcond_without websupport
%bcond sphinxcontrib %{undefined rhel}
# Also, we don't have all the tests requirements # Also, we don't have all the tests requirements
%bcond tests 1 %bcond_without tests
# Unset -s on python shebang to allow RPM-installed sphinx to be used # Unset -s on python shebang to allow RPM-installed sphinx to be used
# with user-installed modules (#1903763) # with user-installed modules (#1903763)
%undefine _py3_shebang_s %global py3_shebang_flags %nil
# No internet in Koji # No internet in Koji
%bcond internet 0 %bcond_with internet
%if 0%{?rhel} > 7
# Build without BuildRequires ImageMagick, to skip imgconverter tests # Build without BuildRequires ImageMagick, to skip imgconverter tests
%bcond imagemagick_tests %{undefined rhel} %bcond_with imagemagick_tests
# Same for filelock -- we don't want it in RHEL just to run a handful of tests here %else
%bcond filelock_tests %{undefined rhel} %bcond_without imagemagick_tests
%endif
# During texlive updates, sometimes the latex environment is unstable # During texlive updates, sometimes the latex environment is unstable
%bcond latex_tests 1 %bcond_without latex_tests
%global upstream_name Sphinx
Name: python-sphinx Name: python-sphinx
%global general_version 7.2.6 %global general_version 3.4.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: 10%{?dist} Release: 8%{?dist}
Epoch: 1 Epoch: 1
Summary: Python documentation generator Summary: Python documentation generator
# Unless otherwise noted, the license for code is BSD-2-Clause # 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
License: BSD-2-Clause AND MIT # JS: JQuery, Underscore, css3-mediaqueries are available under MIT
License: BSD and Python and MIT
URL: https://www.sphinx-doc.org/ URL: https://www.sphinx-doc.org/
Source: %{pypi_source sphinx %{upstream_version}} Source0: %{pypi_source %{upstream_name} %{upstream_version}}
# Allow extra themes to exist. We pull in python3-sphinx-theme-alabaster # Allow extra themes to exist. We pull in python3-sphinx-theme-alabaster
# which causes that test to fail. # which causes that test to fail.
Patch: sphinx-test_theming.diff Patch1: sphinx-test_theming.diff
# Make the first party extensions optional # Fix autodoc build with extension modules:
# This removes the runtime dependencies on: # additionally to AttributeError catch also PycodeError
# - sphinxcontrib.applehelp # Upstream has replaced one with another in Sphinx 3.5.x and later,
# - sphinxcontrib.devhelp # but to prevent any compatibility issues it's safer to only extend
# - sphinxcontrib.jsmath # the list of exceptions. Upstream fix:
# - sphinxcontrib.htmlhelp # https://github.com/sphinx-doc/sphinx/commit/50295f18c25020e15e9bc398a0689
# - sphinxcontrib.serializinghtml # Bug: https://issues.redhat.com/browse/RHEL-5664
# - sphinxcontrib.qthelp Patch2: Enable-autodoc-build-with-extension-modules.patch
# The majority of Fedora RPM packages does not need any of those.
# By removing the dependencies, we minimize the stuff that's pulled into
# the buildroots of 700+ of packages.
#
# This is a downstream-only change - rejected upstream.
# https://github.com/sphinx-doc/sphinx/pull/11747
Patch: Make-the-first-party-extensions-optional.patch
# Fix the expected test docstring to match output in Python 3.11.7, 3.12.1 and later
# Proposed upstream.
Patch: https://github.com/sphinx-doc/sphinx/pull/11774.patch
# Downstream-only patch replacing snowballstemmer
# with a dummy implementation doing nothing.
Patch: Patch-out-snowballstemmer.patch
# Account for the changes is enum and type aliases representations
Patch: Fix-autodoc-tests-with-Python-3.12.3.patch
BuildArch: noarch BuildArch: noarch
@ -73,15 +60,13 @@ BuildRequires: make
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros BuildRequires: pyproject-rpm-macros
%if %{with sphinxcontrib} %if %{with websupport}
# applehelp and jsmath have been orphaned, we cannot use the [docs] extra directly
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-devhelp
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-htmlhelp
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-serializinghtml
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-qthelp
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
@ -164,15 +149,14 @@ Summary: Python documentation generator
Recommends: graphviz Recommends: graphviz
Recommends: ImageMagick Recommends: ImageMagick
# Upstream Requires those, but we have a patch to remove the dependency. # Bundled JavaScript
# We keep them Recommended to preserve the default user experience. Provides: bundled(jquery) = 3.5.1
%if %{with sphinxcontrib} Provides: bundled(underscore) = 1.3.1
# applehelp and jsmath have been orphaned Provides: bundled(css3-mediaqueries) = 1.0
Recommends: python%{python3_pkgversion}-sphinxcontrib-devhelp
Recommends: python%{python3_pkgversion}-sphinxcontrib-htmlhelp # Obsolete and provide the locale package for a clean upgrade path from RHEL 8->9
Recommends: python%{python3_pkgversion}-sphinxcontrib-serializinghtml Obsoletes: python-sphinx-locale < 1:2
Recommends: python%{python3_pkgversion}-sphinxcontrib-qthelp Provides: python-sphinx-locale = %{epoch}:%{version}-%{release}
%endif
%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
@ -254,7 +238,7 @@ builder.
%package doc %package doc
Summary: Documentation for %{name} Summary: Documentation for %{name}
License: BSD-2-Clause License: BSD
Recommends: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release} Recommends: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release}
%description doc %description doc
@ -265,36 +249,32 @@ Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be documentation, but has now been cleaned up in the hope that it will be
useful to many other projects. useful to many other projects.
This package contains documentation in the HTML format. This package contains documentation in reST and HTML formats.
%prep %prep
%autosetup -n sphinx-%{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
%if %{without filelock_tests} # Don't measure coverage:
sed -i '/filelock/d' pyproject.toml sed -i '/pytest-cov/d' setup.py
rm tests/test_build_linkcheck.py tests/test_ext_intersphinx.py # Not needed on recent Pythons, https://github.com/sphinx-doc/sphinx/pull/8483
%endif sed -i '/typed_ast/d' setup.py
%if %{defined rhel}
# unwanted dependency in RHEL, https://bugzilla.redhat.com/show_bug.cgi?id=1945182 # unwanted dependency in RHEL, https://bugzilla.redhat.com/show_bug.cgi?id=1945182
sed -i '/html5lib/d' pyproject.toml sed -i '/html5lib/d' setup.py
%endif
# Sphinx' tests import from each other, this feature is not supported by # Fix broken links in the bundled underscore.js library
# the 'importlib' import mode in pytest. Upstream mitigates this by invoking sed -i 's|http://documentcloud.github.com/underscore|https://underscorejs.org|' \
# `python -m pytest` rather than `pytest` directly, but in the context of the ./sphinx/themes/basic/static/underscore*
# RPM build we explicitly want to test the installed library rather than the
# one from PWD.
# https://github.com/sphinx-doc/sphinx/issues/11740
sed -i '/"--import-mode=importlib",/d' pyproject.toml
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires -r %{?with_tests:-x test} %pyproject_buildrequires %{?with_tests:-x test}
%build %build
@ -306,10 +286,6 @@ export SPHINXBUILD="%{python3} ../sphinx/cmd/build.py"
make html SPHINXBUILD="$SPHINXBUILD" make html SPHINXBUILD="$SPHINXBUILD"
make man SPHINXBUILD="$SPHINXBUILD" make man SPHINXBUILD="$SPHINXBUILD"
rm -rf _build/html/.buildinfo 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 .. mv _build/html ..
popd popd
@ -336,6 +312,12 @@ do
done done
popd 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; # Move language files to /usr/share;
# patch to support this incorporated in 0.6.6 # patch to support this incorporated in 0.6.6
pushd %{buildroot}%{python3_sitelib} pushd %{buildroot}%{python3_sitelib}
@ -369,30 +351,16 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%if %{with tests} %if %{with tests}
%check %check
# Currently, all linkcheck tests and test_latex_images need internet # Currently, all linkcheck tests and test_latex_images need internet
# test_build_latex_doc needs internet to download pictures, # Ignored files use html5lib
# but fails also with it enabled, we decided to skip it entirely
# In RHEL builds, skip tests which use html5lib (excluded above)
# Without snowballstememr, some tests have to be skipped as well.
k="${k-}${k+ and }not test_meta_keys_are_handled_for_language_en"
k="${k-}${k+ and }not test_stemmer"
k="${k-}${k+ and }not test_term_in_heading_and_section"
k="${k-}${k+ and }not test_IndexBuilder"
%if %{without internet}
k="${k-}${k+ and }not linkcheck"
k="${k-}${k+ and }not test_latex_images"
k="${k-}${k+ and }not test_build_latex_doc"
%endif
%pytest \ %pytest \
%if %{defined rhel}
--ignore tests/test_build_html.py \ --ignore tests/test_build_html.py \
--ignore tests/test_build_latex.py \ --ignore tests/test_build_latex.py \
--ignore tests/test_build_texinfo.py \ --ignore tests/test_build_texinfo.py \
--ignore tests/test_domain_std.py \ --ignore tests/test_domain_std.py \
--ignore tests/test_smartquotes.py \ %if %{without internet}
-k "not linkcheck and not test_latex_images" \
%endif %endif
${k+-k }"${k-}" ;
%endif %endif
@ -402,7 +370,7 @@ ${k+-k }"${k-}"
%{_bindir}/sphinx-* %{_bindir}/sphinx-*
%{python3_sitelib}/sphinx/ %{python3_sitelib}/sphinx/
%dir %{python3_sitelib}/sphinxcontrib/ %dir %{python3_sitelib}/sphinxcontrib/
%{python3_sitelib}/sphinx-%{upstream_version}.dist-info/ %{python3_sitelib}/Sphinx-%{upstream_version}.dist-info/
%dir %{_datadir}/sphinx/ %dir %{_datadir}/sphinx/
%dir %{_datadir}/sphinx/locale %dir %{_datadir}/sphinx/locale
%dir %{_datadir}/sphinx/locale/* %dir %{_datadir}/sphinx/locale/*
@ -415,176 +383,32 @@ ${k+-k }"${k-}"
%files doc %files doc
%license LICENSE %license LICENSE
%doc html %doc html reST
%changelog %changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:7.2.6-10 * Tue Nov 21 2023 Karolina Surma <ksurma@redhat.com> - 1:3.4.3-8
- Bump release for October 2024 mass rebuild: - Fix autodoc build with the compiled extension modules
Resolves: RHEL-64018 Resolves: RHEL-5664
* Thu Aug 22 2024 Karolina Surma <ksurma@redhat.com> - 1:7.2.6-9
- Fix build with Python 3.12.3+
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:7.2.6-8
- Bump release for June 2024 mass rebuild
* Mon Jun 10 2024 Lumír Balhar <lbalhar@redhat.com> - 1:7.2.6-7
- Replace snowballstemmer with a dummy implementation
* Wed Jan 24 2024 Karolina Surma <ksurma@redhat.com> - 1:7.2.6-6
- Suppress traceback when importing the weakened sphinxcontrib* dependencies
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:7.2.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Dec 12 2023 Karolina Surma <ksurma@redhat.com> - 1:7.2.6-4
- Fix the tests run when building with Python 3.11.7, 3.12.1 and later
* Thu Nov 16 2023 Miro Hrončok <mhroncok@redhat.com> - 1:7.2.6-3
- On Fedora, BuildRequire the sphinxcontrib packages to build the documentation
* Wed Nov 08 2023 Miro Hrončok <mhroncok@redhat.com> - 1:7.2.6-2
- Weaken the runtime dependency on:
- python3-sphinxcontrib-applehelp
- python3-sphinxcontrib-devhelp
- python3-sphinxcontrib-jsmath
- python3-sphinxcontrib-htmlhelp
- python3-sphinxcontrib-serializinghtml
- python3-sphinxcontrib-qthelp
- Packages that want to use them during build need to BuildRequire them explicitly
* Thu Oct 26 2023 Karolina Surma <ksurma@redhat.com> - 1:7.2.6-1
- Update to 7.2.6
- Fixes rhbz#2232469
* Thu Sep 21 2023 Karolina Surma <ksurma@redhat.com> - 1:7.1.2-2
- Fix FTBFS with Pygments 2.16+
* Mon Aug 14 2023 Karolina Surma <ksurma@redhat.com> - 1:7.1.2-1
- Update to 7.1.2
- Fixes rhbz#2225274
* Mon Aug 07 2023 Karolina Surma <ksurma@redhat.com> - 1:7.0.1-1
- Update to 7.0.1
* Thu Jul 27 2023 Miro Hrončok <mhroncok@redhat.com> - 1:6.2.1-4
- Don't use filelock to test this package on RHEL
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:6.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jul 13 2023 Karolina Surma <ksurma@redhat.com> - 1:6.2.1-2
- Don't use websupport to build documentation on RHEL
* Mon Jun 26 2023 Karolina Surma <ksurma@redhat.com> - 1:6.2.1-1
- Update to 6.2.1
- Fixes rhbz#2188968
* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 1:6.1.3-4
- Rebuilt for Python 3.12
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 1:6.1.3-3
- Bootstrap for Python 3.12
* Wed May 31 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1:6.1.3-2
- Avoid html5lib test dependency in RHEL builds
* 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
- Fix tests related to missing setuptools and Babel 2.12
- Fixes rhbz#2176685
* 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
- Enable previously deselected test
* Wed Aug 18 2021 Karolina Surma <ksurma@redhat.com> - 1:4.1.2-2
- Patch python-sphinx to work with python-pygments >=2.10
* Mon Aug 02 2021 Karolina Surma <ksurma@redhat.com> - 1:4.1.2-1
- Update to 4.1.2
- Fixes rhbz#1979326
- Backport commit to fix python-sphinx with Python 3.10-rc1
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 11 2021 Karolina Surma <ksurma@redhat.com> - 1:4.0.2-1
- Update to 4.0.2
- Fixes rhbz#1948279
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 1:3.5.4-3 * Fri Oct 08 2021 Charalampos Stratakis <cstratak@redhat.com> - 1:3.4.3-7
- Rebuilt for Python 3.10 - Obsolete and provide the python-sphinx-locale package to fix the upgrade path
Related: rhbz#1985219
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 1:3.5.4-2 * Wed Oct 06 2021 Charalampos Stratakis <cstratak@redhat.com> - 1:3.4.3-6
- Bootstrap for Python 3.10 - Fix broken links in the bundled underscore.js library
Resolves: rhbz#1985219
* Mon May 10 2021 Karolina Surma <ksurma@redhat.com> - 1:3.5.4-1 * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.4.3-5
- Update to 3.5.4 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
- Fixes rhbz#1949477 Related: rhbz#1991688
* Thu Apr 01 2021 Karolina Surma <ksurma@redhat.com> - 1:3.5.3-1 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.4.3-4
- Update to 3.5.3 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
- Fixes rhbz#1941161
* Wed Mar 10 2021 Charalampos Stratakis <cstratak@redhat.com> - 1:3.5.2-1 * Wed Mar 31 2021 Miro Hrončok <mhroncok@redhat.com> - 1:3.4.3-3
- Update 3.5.2 - Remove a dependency on html5lib
- Fixes rhbz#1928459 Resolves: rhbz#1945182
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.4.3-2 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save