From 4522a14ac223be4690f9aed22a96ce4d2b4f5814 Mon Sep 17 00:00:00 2001 From: tigro Date: Tue, 17 Dec 2024 22:07:52 +0300 Subject: [PATCH] import python-sphinx-7.2.6-10.el10 --- .gitignore | 2 +- .python-sphinx.metadata | 2 +- SOURCES/11774.patch | 69 ++++ ...autodoc-build-with-extension-modules.patch | 25 -- ...Fix-autodoc-tests-with-Python-3.12.3.patch | 51 +++ ...-the-first-party-extensions-optional.patch | 204 ++++++++++ SOURCES/Patch-out-snowballstemmer.patch | 265 +++++++++++++ SOURCES/sphinx-test_theming.diff | 12 +- SPECS/python-sphinx.spec | 353 +++++++++++++----- 9 files changed, 863 insertions(+), 120 deletions(-) create mode 100644 SOURCES/11774.patch delete mode 100644 SOURCES/Enable-autodoc-build-with-extension-modules.patch create mode 100644 SOURCES/Fix-autodoc-tests-with-Python-3.12.3.patch create mode 100644 SOURCES/Make-the-first-party-extensions-optional.patch create mode 100644 SOURCES/Patch-out-snowballstemmer.patch diff --git a/.gitignore b/.gitignore index a1a936b..37f4a79 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/Sphinx-3.4.3.tar.gz +SOURCES/sphinx-7.2.6.tar.gz diff --git a/.python-sphinx.metadata b/.python-sphinx.metadata index 01de47b..1f9fed0 100644 --- a/.python-sphinx.metadata +++ b/.python-sphinx.metadata @@ -1 +1 @@ -e72412976b8b47cb5a55cc1cb5ec2fdfe358ed7c SOURCES/Sphinx-3.4.3.tar.gz +f7327207321395a710e8b4edbe9e585e2511e1e7 SOURCES/sphinx-7.2.6.tar.gz diff --git a/SOURCES/11774.patch b/SOURCES/11774.patch new file mode 100644 index 0000000..47370b2 --- /dev/null +++ b/SOURCES/11774.patch @@ -0,0 +1,69 @@ +From bc8939b34037f81b8610f3b26caec128ee20a2f4 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +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 diff --git a/SOURCES/Enable-autodoc-build-with-extension-modules.patch b/SOURCES/Enable-autodoc-build-with-extension-modules.patch deleted file mode 100644 index ea31b62..0000000 --- a/SOURCES/Enable-autodoc-build-with-extension-modules.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 924b2e2cee46753d26a8419f273ffe045bbfb9bb Mon Sep 17 00:00:00 2001 -From: Karolina Surma -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 - diff --git a/SOURCES/Fix-autodoc-tests-with-Python-3.12.3.patch b/SOURCES/Fix-autodoc-tests-with-Python-3.12.3.patch new file mode 100644 index 0000000..4d78a38 --- /dev/null +++ b/SOURCES/Fix-autodoc-tests-with-Python-3.12.3.patch @@ -0,0 +1,51 @@ +From 22caeb2631922c3f5e3f4bb45d8c1610edb6ef74 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +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=, *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 + diff --git a/SOURCES/Make-the-first-party-extensions-optional.patch b/SOURCES/Make-the-first-party-extensions-optional.patch new file mode 100644 index 0000000..ad3985a --- /dev/null +++ b/SOURCES/Make-the-first-party-extensions-optional.patch @@ -0,0 +1,204 @@ +From 9699465414515f0eba76d05069e755b5bcf34eef Mon Sep 17 00:00:00 2001 +From: Karolina Surma +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 +--- + 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 + diff --git a/SOURCES/Patch-out-snowballstemmer.patch b/SOURCES/Patch-out-snowballstemmer.patch new file mode 100644 index 0000000..d4b3b52 --- /dev/null +++ b/SOURCES/Patch-out-snowballstemmer.patch @@ -0,0 +1,265 @@ +From ec721111162a24a960b8c725340e183f970d4a1c Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +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 + diff --git a/SOURCES/sphinx-test_theming.diff b/SOURCES/sphinx-test_theming.diff index 966528a..30994a1 100644 --- a/SOURCES/sphinx-test_theming.diff +++ b/SOURCES/sphinx-test_theming.diff @@ -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'] == str(app.srcdir / 'test_theme' / 'test-theme') + assert app.registry.html_themes['ziptheme'] == str(app.srcdir / 'ziptheme.zip') + assert app.registry.html_themes['staticfiles'] == str(app.srcdir / 'test_theme' / 'staticfiles') diff --git a/SPECS/python-sphinx.spec b/SPECS/python-sphinx.spec index cf7f6bd..bc070b1 100644 --- a/SPECS/python-sphinx.spec +++ b/SPECS/python-sphinx.spec @@ -1,58 +1,71 @@ -# When bootstrapping sphinx, we don't yet have sphinxcontrib-websupport -# Without it we have warnings in docs, but it's not a hard dependency -%bcond_without websupport +# When bootstrapping sphinx in Fedora, we don't yet have sphinxcontrib-* +# Without the packages, 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 sphinxcontrib %{undefined rhel} # Also, we don't have all the tests requirements -%bcond_without tests +%bcond tests 1 # Unset -s on python shebang to allow RPM-installed sphinx to be used # with user-installed modules (#1903763) -%global py3_shebang_flags %nil +%undefine _py3_shebang_s # No internet in Koji -%bcond_with internet +%bcond internet 0 -%if 0%{?rhel} > 7 # Build without BuildRequires ImageMagick, to skip imgconverter tests -%bcond_with imagemagick_tests -%else -%bcond_without imagemagick_tests -%endif +%bcond imagemagick_tests %{undefined rhel} +# Same for filelock -- we don't want it in RHEL just to run a handful of tests here +%bcond filelock_tests %{undefined rhel} # During texlive updates, sometimes the latex environment is unstable -%bcond_without latex_tests - -%global upstream_name Sphinx +%bcond latex_tests 1 Name: python-sphinx -%global general_version 3.4.3 +%global general_version 7.2.6 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 8%{?dist} +Release: 10%{?dist} Epoch: 1 Summary: Python documentation generator -# Unless otherwise noted, the license for code is BSD -# sphinx/util/inspect.py has bits licensed with PSF license v2 (Python) +# Unless otherwise noted, the license for code is BSD-2-Clause # sphinx/themes/haiku/static/haiku.css_t has bits licensed with MIT -# JS: JQuery, Underscore, css3-mediaqueries are available under MIT -License: BSD and Python and MIT +License: BSD-2-Clause AND MIT URL: https://www.sphinx-doc.org/ -Source0: %{pypi_source %{upstream_name} %{upstream_version}} +Source: %{pypi_source sphinx %{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 - -# Fix autodoc build with extension modules: -# additionally to AttributeError catch also PycodeError -# Upstream has replaced one with another in Sphinx 3.5.x and later, -# but to prevent any compatibility issues it's safer to only extend -# the list of exceptions. Upstream fix: -# https://github.com/sphinx-doc/sphinx/commit/50295f18c25020e15e9bc398a0689 -# Bug: https://issues.redhat.com/browse/RHEL-5664 -Patch2: Enable-autodoc-build-with-extension-modules.patch +Patch: sphinx-test_theming.diff + +# Make the first party extensions optional +# This removes the runtime dependencies on: +# - sphinxcontrib.applehelp +# - sphinxcontrib.devhelp +# - sphinxcontrib.jsmath +# - sphinxcontrib.htmlhelp +# - sphinxcontrib.serializinghtml +# - sphinxcontrib.qthelp +# 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 @@ -60,13 +73,15 @@ BuildRequires: make BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros -%if %{with websupport} +%if %{with sphinxcontrib} +# 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 %endif -# for fixes -BuildRequires: dos2unix - %if %{with tests} # tests import _testcapi BuildRequires: python%{python3_pkgversion}-test @@ -149,14 +164,15 @@ Summary: Python documentation generator Recommends: graphviz Recommends: ImageMagick -# Bundled JavaScript -Provides: bundled(jquery) = 3.5.1 -Provides: bundled(underscore) = 1.3.1 -Provides: bundled(css3-mediaqueries) = 1.0 - -# Obsolete and provide the locale package for a clean upgrade path from RHEL 8->9 -Obsoletes: python-sphinx-locale < 1:2 -Provides: python-sphinx-locale = %{epoch}:%{version}-%{release} +# Upstream Requires those, but we have a patch to remove the dependency. +# We keep them Recommended to preserve the default user experience. +%if %{with sphinxcontrib} +# applehelp and jsmath have been orphaned +Recommends: python%{python3_pkgversion}-sphinxcontrib-devhelp +Recommends: python%{python3_pkgversion}-sphinxcontrib-htmlhelp +Recommends: python%{python3_pkgversion}-sphinxcontrib-serializinghtml +Recommends: python%{python3_pkgversion}-sphinxcontrib-qthelp +%endif %description -n python%{python3_pkgversion}-sphinx Sphinx is a tool that makes it easy to create intelligent and @@ -238,7 +254,7 @@ builder. %package doc Summary: Documentation for %{name} -License: BSD +License: BSD-2-Clause Recommends: python%{python3_pkgversion}-sphinx = %{epoch}:%{version}-%{release} %description doc @@ -249,32 +265,36 @@ 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 -%autosetup -n %{upstream_name}-%{upstream_version} -p1 - -# fix line encoding of bundled jquery.js -dos2unix -k ./sphinx/themes/basic/static/jquery.js +%autosetup -n sphinx-%{upstream_version} -p1 %if %{without imagemagick_tests} 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 +%if %{without filelock_tests} +sed -i '/filelock/d' pyproject.toml +rm tests/test_build_linkcheck.py tests/test_ext_intersphinx.py +%endif + +%if %{defined rhel} # unwanted dependency in RHEL, https://bugzilla.redhat.com/show_bug.cgi?id=1945182 -sed -i '/html5lib/d' setup.py +sed -i '/html5lib/d' pyproject.toml +%endif -# Fix broken links in the bundled underscore.js library -sed -i 's|http://documentcloud.github.com/underscore|https://underscorejs.org|' \ - ./sphinx/themes/basic/static/underscore* +# Sphinx' tests import from each other, this feature is not supported by +# the 'importlib' import mode in pytest. Upstream mitigates this by invoking +# `python -m pytest` rather than `pytest` directly, but in the context of the +# 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 -%pyproject_buildrequires %{?with_tests:-x test} +%pyproject_buildrequires -r %{?with_tests:-x test} %build @@ -286,6 +306,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 @@ -312,12 +336,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} @@ -351,16 +369,30 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib %if %{with tests} %check # Currently, all linkcheck tests and test_latex_images need internet -# Ignored files use html5lib +# test_build_latex_doc needs internet to download pictures, +# 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 \ +%if %{defined rhel} --ignore tests/test_build_html.py \ --ignore tests/test_build_latex.py \ --ignore tests/test_build_texinfo.py \ --ignore tests/test_domain_std.py \ -%if %{without internet} - -k "not linkcheck and not test_latex_images" \ + --ignore tests/test_smartquotes.py \ %endif -; +${k+-k }"${k-}" %endif @@ -370,7 +402,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/* @@ -383,32 +415,179 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib %files doc %license LICENSE -%doc html reST +%doc html %changelog -* Tue Nov 21 2023 Karolina Surma - 1:3.4.3-8 -- Fix autodoc build with the compiled extension modules -Resolves: RHEL-5664 +* Tue Dec 17 2024 Arkady L. Shane - 7.2.6-10 +- Rebuilt for MSVSphere 10 + +* Tue Oct 29 2024 Troy Dawson - 1:7.2.6-10 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Thu Aug 22 2024 Karolina Surma - 1:7.2.6-9 +- Fix build with Python 3.12.3+ + +* Mon Jun 24 2024 Troy Dawson - 1:7.2.6-8 +- Bump release for June 2024 mass rebuild + +* Mon Jun 10 2024 Lumír Balhar - 1:7.2.6-7 +- Replace snowballstemmer with a dummy implementation + +* Wed Jan 24 2024 Karolina Surma - 1:7.2.6-6 +- Suppress traceback when importing the weakened sphinxcontrib* dependencies + +* Mon Jan 22 2024 Fedora Release Engineering - 1:7.2.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Dec 12 2023 Karolina Surma - 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 - 1:7.2.6-3 +- On Fedora, BuildRequire the sphinxcontrib packages to build the documentation + +* Wed Nov 08 2023 Miro Hrončok - 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 - 1:7.2.6-1 +- Update to 7.2.6 +- Fixes rhbz#2232469 + +* Thu Sep 21 2023 Karolina Surma - 1:7.1.2-2 +- Fix FTBFS with Pygments 2.16+ + +* Mon Aug 14 2023 Karolina Surma - 1:7.1.2-1 +- Update to 7.1.2 +- Fixes rhbz#2225274 + +* Mon Aug 07 2023 Karolina Surma - 1:7.0.1-1 +- Update to 7.0.1 + +* Thu Jul 27 2023 Miro Hrončok - 1:6.2.1-4 +- Don't use filelock to test this package on RHEL + +* Fri Jul 21 2023 Fedora Release Engineering - 1:6.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jul 13 2023 Karolina Surma - 1:6.2.1-2 +- Don't use websupport to build documentation on RHEL + +* Mon Jun 26 2023 Karolina Surma - 1:6.2.1-1 +- Update to 6.2.1 +- Fixes rhbz#2188968 + +* Fri Jun 16 2023 Python Maint - 1:6.1.3-4 +- Rebuilt for Python 3.12 + +* Tue Jun 13 2023 Python Maint - 1:6.1.3-3 +- Bootstrap for Python 3.12 + +* Wed May 31 2023 Yaakov Selkowitz - 1:6.1.3-2 +- Avoid html5lib test dependency in RHEL builds + +* Fri Mar 10 2023 Karolina Surma - 1:6.1.3-1 +- Update to 6.1.3 +- Fixes rhbz#2135122 + +* Thu Mar 09 2023 Karolina Surma - 1:5.3.0-4 +- Fix tests related to missing setuptools and Babel 2.12 +- Fixes rhbz#2176685 + +* Tue Jan 31 2023 Karolina Surma - 1:5.3.0-3 +- Fix tests with python-pygments 2.14+ + +* Fri Jan 20 2023 Fedora Release Engineering - 1:5.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 08 2022 Karolina Surma - 1:5.3.0-1 +- Update to 5.3.0 +- Fixes rhbz#2129546 + +* Mon Aug 15 2022 Karolina Surma - 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 - 1:5.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 21 2022 Karolina Surma - 1:5.0.2-1 +- Update to 5.0.2 + +* Mon Jun 13 2022 Python Maint - 1:4.5.0-3 +- Rebuilt for Python 3.11 + +* Mon Jun 13 2022 Python Maint - 1:4.5.0-2 +- Bootstrap for Python 3.11 + +* Fri Apr 01 2022 Karolina Surma - 1:4.5.0-1 +- Update to 4.5.0 +- Fixes rhbz#2068924 + +* Tue Feb 01 2022 Karolina Surma - 1:4.4.0-1 +- Update to 4.4.0 +- Fixes rhbz#2033955 + +* Fri Jan 21 2022 Fedora Release Engineering - 1:4.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Nov 29 2021 Karolina Surma - 1:4.3.1-1 +- Update to 4.3.1 +- Fixes rhbz#2027059 + +* Fri Nov 19 2021 Karolina Surma - 1:4.3.0-1 +- Update to 4.3.0 +- Fixes rhbz#2022111 + +* Fri Sep 17 2021 Karolina Surma - 1:4.2.0-1 +- Update to 4.2.0 +- Fixes rhbz#2003427 + +* Thu Sep 16 2021 Karolina Surma - 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 - 1:4.1.2-2 +- Patch python-sphinx to work with python-pygments >=2.10 + +* Mon Aug 02 2021 Karolina Surma - 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 - 1:4.0.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 11 2021 Karolina Surma - 1:4.0.2-1 +- Update to 4.0.2 +- Fixes rhbz#1948279 -* Fri Oct 08 2021 Charalampos Stratakis - 1:3.4.3-7 -- Obsolete and provide the python-sphinx-locale package to fix the upgrade path -Related: rhbz#1985219 +* Thu Jun 03 2021 Python Maint - 1:3.5.4-3 +- Rebuilt for Python 3.10 -* Wed Oct 06 2021 Charalampos Stratakis - 1:3.4.3-6 -- Fix broken links in the bundled underscore.js library -Resolves: rhbz#1985219 +* Wed Jun 02 2021 Python Maint - 1:3.5.4-2 +- Bootstrap for Python 3.10 -* Tue Aug 10 2021 Mohan Boddu - 1:3.4.3-5 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 +* Mon May 10 2021 Karolina Surma - 1:3.5.4-1 +- Update to 3.5.4 +- Fixes rhbz#1949477 -* Fri Apr 16 2021 Mohan Boddu - 1:3.4.3-4 -- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 +* Thu Apr 01 2021 Karolina Surma - 1:3.5.3-1 +- Update to 3.5.3 +- Fixes rhbz#1941161 -* Wed Mar 31 2021 Miro Hrončok - 1:3.4.3-3 -- Remove a dependency on html5lib -Resolves: rhbz#1945182 +* Wed Mar 10 2021 Charalampos Stratakis - 1:3.5.2-1 +- Update 3.5.2 +- Fixes rhbz#1928459 * Wed Jan 27 2021 Fedora Release Engineering - 1:3.4.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild