diff --git a/.gitignore b/.gitignore index 8c5d9ff..bf51472 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,3 @@ /sphinx-7.3.7.tar.gz /sphinx-8.1.3.tar.gz /sphinx-8.2.3.tar.gz -/sphinx-9.1.0.tar.gz diff --git a/13527.patch b/13527.patch new file mode 100644 index 0000000..f253845 --- /dev/null +++ b/13527.patch @@ -0,0 +1,314 @@ +From 93312460e37be0ba1acbbefa553bfc25f4fc5ea9 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+aa-turner@users.noreply.github.com> +Date: Sun, 27 Apr 2025 21:00:40 +0100 +Subject: [PATCH 1/9] Fix tests for Python 3.14a7+ + +--- + tests/test_extensions/test_ext_autodoc.py | 2 +- + tests/test_extensions/test_ext_autodoc_configs.py | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py +index a06c1bbe30d..bdcd6ef2b95 100644 +--- a/tests/test_extensions/test_ext_autodoc.py ++++ b/tests/test_extensions/test_ext_autodoc.py +@@ -941,7 +941,7 @@ def test_autodoc_special_members(app): + actual = do_autodoc(app, 'class', 'target.Class', options) + assert list(filter(lambda l: '::' in l, actual)) == [ + '.. py:class:: Class(arg)', +- ' .. py:attribute:: Class.__annotations__', ++ ' .. py:attribute:: Class.__annotations_cache__', + ' .. py:attribute:: Class.__dict__', + ' .. py:method:: Class.__init__(arg)', + ' .. py:attribute:: Class.__module__', +diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py +index ab7539190e0..d520e7f9cfe 100644 +--- a/tests/test_extensions/test_ext_autodoc_configs.py ++++ b/tests/test_extensions/test_ext_autodoc_configs.py +@@ -1368,7 +1368,6 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', +- ' :type: int', + '', + ' docstring', + '', + +From 523f290134f644b115e18e347dce093fa0fbd662 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+aa-turner@users.noreply.github.com> +Date: Sun, 27 Apr 2025 21:03:35 +0100 +Subject: [PATCH 2/9] Fix tests for Python 3.14a7+ + +--- + tests/test_extensions/test_ext_autodoc_configs.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py +index d520e7f9cfe..2f8dc75d082 100644 +--- a/tests/test_extensions/test_ext_autodoc_configs.py ++++ b/tests/test_extensions/test_ext_autodoc_configs.py +@@ -1368,6 +1368,7 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', ++ ' :type: int', + '', + ' docstring', + '', +@@ -1440,7 +1441,6 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', +- ' :type: myint', + '', + ' docstring', + '', + +From a81bcf834822fac1cf96a2ab43c5b0d260ec532b Mon Sep 17 00:00:00 2001 +From: James Addison +Date: Tue, 6 May 2025 22:06:24 +0100 +Subject: [PATCH 3/9] Tests: make test expectations pyversion-conditional + +Relates-to commits 93312460e37be0ba1acbbefa553bfc25f4fc5ea9, 523f290134f644b115e18e347dce093fa0fbd662. +--- + tests/test_extensions/test_ext_autodoc.py | 6 +++++- + tests/test_extensions/test_ext_autodoc_configs.py | 10 +++++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py +index bdcd6ef2b95..d7cef59056e 100644 +--- a/tests/test_extensions/test_ext_autodoc.py ++++ b/tests/test_extensions/test_ext_autodoc.py +@@ -938,10 +938,14 @@ def test_autodoc_special_members(app): + } + if sys.version_info >= (3, 13, 0, 'alpha', 5): + options['exclude-members'] = '__static_attributes__,__firstlineno__' ++ if sys.version_info >= (3, 14, 0, 'alpha', 7): ++ annotations_attributes = [' .. py:attribute:: Class.__annotations_cache__'] ++ else: ++ annotations_attributes = [' .. py:attribute:: Class.__annotations__'] + actual = do_autodoc(app, 'class', 'target.Class', options) + assert list(filter(lambda l: '::' in l, actual)) == [ + '.. py:class:: Class(arg)', +- ' .. py:attribute:: Class.__annotations_cache__', ++ ] + annotations_attributes + [ + ' .. py:attribute:: Class.__dict__', + ' .. py:method:: Class.__init__(arg)', + ' .. py:attribute:: Class.__module__', +diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py +index 2f8dc75d082..f449bb57809 100644 +--- a/tests/test_extensions/test_ext_autodoc_configs.py ++++ b/tests/test_extensions/test_ext_autodoc_configs.py +@@ -1348,6 +1348,10 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + # default + options = {'members': None} + actual = do_autodoc(app, 'module', 'target.autodoc_type_aliases', options) ++ if sys.version_info >= (3, 14, 0, 'alpha', 7): ++ attr2_typeinfo = [] ++ else: ++ attr2_typeinfo = [' :type: int'] + assert list(actual) == [ + '', + '.. py:module:: target.autodoc_type_aliases', +@@ -1368,7 +1372,6 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', +- ' :type: int', + '', + ' docstring', + '', +@@ -1421,6 +1424,10 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + 'io.StringIO': 'my.module.StringIO', + } + actual = do_autodoc(app, 'module', 'target.autodoc_type_aliases', options) ++ if sys.version_info >= (3, 14, 0, 'alpha', 7): ++ attr2_typeinfo = [] ++ else: ++ attr2_typeinfo = [' :type: myint'] + assert list(actual) == [ + '', + '.. py:module:: target.autodoc_type_aliases', +@@ -1441,6 +1448,7 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', ++ ] + attr2_typeinfo + [ + '', + ' docstring', + '', + +From 26e7a6435ad9840345455f35f62c063cb588bba7 Mon Sep 17 00:00:00 2001 +From: James Addison +Date: Tue, 6 May 2025 22:16:42 +0100 +Subject: [PATCH 4/9] Tests: fixup: actually insert updated expectation + +Relates-to commit a81bcf834822fac1cf96a2ab43c5b0d260ec532b. +--- + tests/test_extensions/test_ext_autodoc_configs.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py +index f449bb57809..fe2561aea00 100644 +--- a/tests/test_extensions/test_ext_autodoc_configs.py ++++ b/tests/test_extensions/test_ext_autodoc_configs.py +@@ -1372,6 +1372,7 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', ++ ] + attr2_typeinfo + [ + '', + ' docstring', + '', + +From 52c7010c4b673898af115d3a86728274a8dd620d Mon Sep 17 00:00:00 2001 +From: James Addison +Date: Tue, 6 May 2025 22:19:30 +0100 +Subject: [PATCH 5/9] Tests: linting: use iterable unpacking as suggested by + `ruff` + +--- + tests/test_extensions/test_ext_autodoc_configs.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py +index fe2561aea00..39fdc454e31 100644 +--- a/tests/test_extensions/test_ext_autodoc_configs.py ++++ b/tests/test_extensions/test_ext_autodoc_configs.py +@@ -1372,7 +1372,7 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', +- ] + attr2_typeinfo + [ ++ *attr2_typeinfo, + '', + ' docstring', + '', +@@ -1449,7 +1449,7 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + '', + ' .. py:attribute:: Foo.attr2', + ' :module: target.autodoc_type_aliases', +- ] + attr2_typeinfo + [ ++ *attr2_typeinfo, + '', + ' docstring', + '', + +From 7b3ce9b642e636fe2ec58f1e090dc79d51b1f2f0 Mon Sep 17 00:00:00 2001 +From: James Addison +Date: Tue, 6 May 2025 22:21:24 +0100 +Subject: [PATCH 6/9] Tests: linting: use iterable unpacking as suggested by + `ruff` (uno mas) + +--- + tests/test_extensions/test_ext_autodoc.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py +index d7cef59056e..4f38634cf51 100644 +--- a/tests/test_extensions/test_ext_autodoc.py ++++ b/tests/test_extensions/test_ext_autodoc.py +@@ -945,7 +945,7 @@ def test_autodoc_special_members(app): + actual = do_autodoc(app, 'class', 'target.Class', options) + assert list(filter(lambda l: '::' in l, actual)) == [ + '.. py:class:: Class(arg)', +- ] + annotations_attributes + [ ++ *annotations_attributes, + ' .. py:attribute:: Class.__dict__', + ' .. py:method:: Class.__init__(arg)', + ' .. py:attribute:: Class.__module__', + +From 386ba32af878b23c5857be588f932fe2af4a2d88 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> +Date: Mon, 12 May 2025 17:36:04 +0100 +Subject: [PATCH 7/9] Style + +--- + tests/test_extensions/test_ext_autodoc.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py +index 4f38634cf51..012e708a2f3 100644 +--- a/tests/test_extensions/test_ext_autodoc.py ++++ b/tests/test_extensions/test_ext_autodoc.py +@@ -939,9 +939,9 @@ def test_autodoc_special_members(app): + if sys.version_info >= (3, 13, 0, 'alpha', 5): + options['exclude-members'] = '__static_attributes__,__firstlineno__' + if sys.version_info >= (3, 14, 0, 'alpha', 7): +- annotations_attributes = [' .. py:attribute:: Class.__annotations_cache__'] ++ annotations_attributes = (' .. py:attribute:: Class.__annotations_cache__',) + else: +- annotations_attributes = [' .. py:attribute:: Class.__annotations__'] ++ annotations_attributes = (' .. py:attribute:: Class.__annotations__',) + actual = do_autodoc(app, 'class', 'target.Class', options) + assert list(filter(lambda l: '::' in l, actual)) == [ + '.. py:class:: Class(arg)', + +From 1f381ec05015fcbc695d1f0991e77241daef49c7 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+aa-turner@users.noreply.github.com> +Date: Mon, 12 May 2025 17:38:28 +0100 +Subject: [PATCH 8/9] fstr + +--- + tests/test_extensions/test_ext_autodoc.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py +index 012e708a2f3..7aa12db3c32 100644 +--- a/tests/test_extensions/test_ext_autodoc.py ++++ b/tests/test_extensions/test_ext_autodoc.py +@@ -939,13 +939,13 @@ def test_autodoc_special_members(app): + if sys.version_info >= (3, 13, 0, 'alpha', 5): + options['exclude-members'] = '__static_attributes__,__firstlineno__' + if sys.version_info >= (3, 14, 0, 'alpha', 7): +- annotations_attributes = (' .. py:attribute:: Class.__annotations_cache__',) ++ ann_attr_name = '__annotations_cache__' + else: +- annotations_attributes = (' .. py:attribute:: Class.__annotations__',) ++ ann_attr_name = '__annotations__' + actual = do_autodoc(app, 'class', 'target.Class', options) + assert list(filter(lambda l: '::' in l, actual)) == [ + '.. py:class:: Class(arg)', +- *annotations_attributes, ++ f' .. py:attribute:: Class.{ann_attr_name}', + ' .. py:attribute:: Class.__dict__', + ' .. py:method:: Class.__init__(arg)', + ' .. py:attribute:: Class.__module__', + +From 0bd1f9d1615c20078677b48a09180c4b68e27796 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+aa-turner@users.noreply.github.com> +Date: Mon, 12 May 2025 17:40:13 +0100 +Subject: [PATCH 9/9] tuple + +--- + tests/test_extensions/test_ext_autodoc_configs.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autodoc_configs.py b/tests/test_extensions/test_ext_autodoc_configs.py +index 39fdc454e31..c88496ee506 100644 +--- a/tests/test_extensions/test_ext_autodoc_configs.py ++++ b/tests/test_extensions/test_ext_autodoc_configs.py +@@ -1349,9 +1349,9 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + options = {'members': None} + actual = do_autodoc(app, 'module', 'target.autodoc_type_aliases', options) + if sys.version_info >= (3, 14, 0, 'alpha', 7): +- attr2_typeinfo = [] ++ attr2_typeinfo = () + else: +- attr2_typeinfo = [' :type: int'] ++ attr2_typeinfo = (' :type: int',) + assert list(actual) == [ + '', + '.. py:module:: target.autodoc_type_aliases', +@@ -1426,9 +1426,9 @@ def test_autodoc_type_aliases(app: SphinxTestApp) -> None: + } + actual = do_autodoc(app, 'module', 'target.autodoc_type_aliases', options) + if sys.version_info >= (3, 14, 0, 'alpha', 7): +- attr2_typeinfo = [] ++ attr2_typeinfo = () + else: +- attr2_typeinfo = [' :type: myint'] ++ attr2_typeinfo = (' :type: myint',) + assert list(actual) == [ + '', + '.. py:module:: target.autodoc_type_aliases', diff --git a/13610.patch b/13610.patch new file mode 100644 index 0000000..7cebb25 --- /dev/null +++ b/13610.patch @@ -0,0 +1,49 @@ +From 69998bdf8848614eb52ddd80923ffde7af64c0a8 Mon Sep 17 00:00:00 2001 +From: James Addison +Date: Mon, 2 Jun 2025 21:55:15 +0100 +Subject: [PATCH] tests: update LaTeX label test expectations from docutils + r10151 + +--- + tests/test_builders/test_build_latex.py | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/tests/test_builders/test_build_latex.py b/tests/test_builders/test_build_latex.py +index 0d1c607462d..37e708a021e 100644 +--- a/tests/test_builders/test_build_latex.py ++++ b/tests/test_builders/test_build_latex.py +@@ -12,6 +12,7 @@ + from subprocess import CalledProcessError + from typing import TYPE_CHECKING + ++import docutils + import pygments + import pytest + +@@ -1959,10 +1960,16 @@ def test_latex_labels(app: SphinxTestApp) -> None: + + result = (app.outdir / 'projectnamenotset.tex').read_text(encoding='utf8') + ++ # ref: docutils r10151 ++ if docutils.__version_info__[:2] < (0, 22): ++ figure_id, table_id = 'id1', 'id2' ++ else: ++ figure_id, table_id = 'id2', 'id3' ++ + # figures + assert ( + r'\caption{labeled figure}' +- r'\label{\detokenize{index:id1}}' ++ r'\label{\detokenize{index:' + figure_id + '}}' + r'\label{\detokenize{index:figure2}}' + r'\label{\detokenize{index:figure1}}' + r'\end{figure}' +@@ -1988,7 +1995,7 @@ def test_latex_labels(app: SphinxTestApp) -> None: + # tables + assert ( + r'\sphinxcaption{table caption}' +- r'\label{\detokenize{index:id2}}' ++ r'\label{\detokenize{index:' + table_id + '}}' + r'\label{\detokenize{index:table2}}' + r'\label{\detokenize{index:table1}}' + ) in result diff --git a/13883.patch b/13883.patch new file mode 100644 index 0000000..480de01 --- /dev/null +++ b/13883.patch @@ -0,0 +1,30 @@ +From 4d842a2c4909fe360172826a46eb88b442f44858 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnter=20Milde?= +Date: Tue, 9 Sep 2025 16:17:15 +0200 +Subject: [PATCH] Fix test setup for directive tests. + +Set the "parent" attribute of RSTState instances to the `document` +instead of None. The attribute holds the state machines "current node" +which is initialized to the `document` in `RSTStateMachine.run()` and +required since Docutils 0.22.1 in `RSTState.nested_parse()` to correctly +support sections in nested parsing. +--- + tests/test_util/test_util_docutils_sphinx_directive.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_util/test_util_docutils_sphinx_directive.py b/tests/test_util/test_util_docutils_sphinx_directive.py +index ecfcab0..7a26e96 100644 +--- a/tests/test_util/test_util_docutils_sphinx_directive.py ++++ b/tests/test_util/test_util_docutils_sphinx_directive.py +@@ -38,7 +38,7 @@ def make_directive_and_state( + inliner = Inliner() + inliner.init_customizations(state.document.settings) + state.inliner = inliner +- state.parent = None ++ state.parent = state.document + state.memo = SimpleNamespace( + document=state.document, + language=english, +-- +2.51.1 + diff --git a/14474.patch b/14474.patch deleted file mode 100644 index b4417aa..0000000 --- a/14474.patch +++ /dev/null @@ -1,166 +0,0 @@ -From d1fd6eb79e7949aa802d8849aa9ce311be79f2d2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Sun, 7 Jun 2026 11:27:41 +0200 -Subject: [PATCH 1/6] Fix `test_search.py` with long-word splitting - ---- - tests/test_search.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/test_search.py b/tests/test_search.py -index f94ae987bb7..b6b72bcfff7 100644 ---- a/tests/test_search.py -+++ b/tests/test_search.py -@@ -144,7 +144,7 @@ def test_stemmer(app: SphinxTestApp) -> None: - searchindex = load_searchindex(app.outdir / 'searchindex.js') - print(searchindex) - assert is_registered_term(searchindex, 'findthisstemmedkey') -- assert is_registered_term(searchindex, 'intern') -+ assert is_registered_term(searchindex, 'internat') - - - @pytest.mark.sphinx('html', testroot='search') - -From 469773d068aadc85c6a1dda17b9db0334cca8db2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Sun, 7 Jun 2026 11:30:08 +0200 -Subject: [PATCH 2/6] probably more fixes - ---- - tests/roots/test-search/index.rst | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/roots/test-search/index.rst b/tests/roots/test-search/index.rst -index b38fd0271f6..c618633c345 100644 ---- a/tests/roots/test-search/index.rst -+++ b/tests/roots/test-search/index.rst -@@ -19,6 +19,7 @@ International - - .. tip:: - :class: no-search -+ - bat cat - - .. toctree:: - -From 6f824176535f4b873cbdfe7c9e99d5f23262a857 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Sun, 7 Jun 2026 11:39:03 +0200 -Subject: [PATCH 3/6] better fix - ---- - tests/test_search.py | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/tests/test_search.py b/tests/test_search.py -index b6b72bcfff7..b55788091b2 100644 ---- a/tests/test_search.py -+++ b/tests/test_search.py -@@ -76,6 +76,14 @@ def is_registered_term(index: Any, keyword: str) -> bool: - return index['terms'].get(keyword, []) != [] - - -+def is_registered_prefix(index: Any, prefix: str) -> bool: -+ terms = index["terms"] -+ for key, value in terms.items(): -+ if key.startswith(prefix) and value != []: -+ return True -+ return False -+ -+ - FILE_CONTENTS = """\ - section_title - ============= -@@ -144,7 +152,7 @@ def test_stemmer(app: SphinxTestApp) -> None: - searchindex = load_searchindex(app.outdir / 'searchindex.js') - print(searchindex) - assert is_registered_term(searchindex, 'findthisstemmedkey') -- assert is_registered_term(searchindex, 'internat') -+ assert is_registered_prefix(searchindex, 'intern') - - - @pytest.mark.sphinx('html', testroot='search') - -From c638919f7ea87104c25a77508e15163cfb466b30 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Sun, 7 Jun 2026 11:40:31 +0200 -Subject: [PATCH 4/6] fixup - ---- - tests/test_search.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/test_search.py b/tests/test_search.py -index b55788091b2..57cf310f036 100644 ---- a/tests/test_search.py -+++ b/tests/test_search.py -@@ -77,7 +77,7 @@ def is_registered_term(index: Any, keyword: str) -> bool: - - - def is_registered_prefix(index: Any, prefix: str) -> bool: -- terms = index["terms"] -+ terms = index['terms'] - for key, value in terms.items(): - if key.startswith(prefix) and value != []: - return True - -From 55f34f425547c521eaa982c1f01ee87e7fbdc4e7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Sun, 7 Jun 2026 11:41:09 +0200 -Subject: [PATCH 5/6] fixup - ---- - tests/test_search.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/tests/test_search.py b/tests/test_search.py -index 57cf310f036..3643794f8b8 100644 ---- a/tests/test_search.py -+++ b/tests/test_search.py -@@ -78,10 +78,10 @@ def is_registered_term(index: Any, keyword: str) -> bool: - - def is_registered_prefix(index: Any, prefix: str) -> bool: - terms = index['terms'] -- for key, value in terms.items(): -- if key.startswith(prefix) and value != []: -- return True -- return False -+ return any( -+ key.startswith(prefix) and value != [] -+ for key, value in terms.items() -+ ) - - - FILE_CONTENTS = """\ - -From 6510fb585219bc218a32f7d520fa40a540828aad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Sun, 7 Jun 2026 11:41:34 +0200 -Subject: [PATCH 6/6] ruff - ---- - tests/test_search.py | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/tests/test_search.py b/tests/test_search.py -index 3643794f8b8..64ec4670085 100644 ---- a/tests/test_search.py -+++ b/tests/test_search.py -@@ -78,10 +78,7 @@ def is_registered_term(index: Any, keyword: str) -> bool: - - def is_registered_prefix(index: Any, prefix: str) -> bool: - terms = index['terms'] -- return any( -- key.startswith(prefix) and value != [] -- for key, value in terms.items() -- ) -+ return any(k.startswith(prefix) and v != [] for k, v in terms.items()) - - - FILE_CONTENTS = """\ diff --git a/14507.patch b/14507.patch deleted file mode 100644 index 3cea526..0000000 --- a/14507.patch +++ /dev/null @@ -1,29 +0,0 @@ -From b9386884a3a4d65db1d69b83026339c5d72442d5 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Mon, 29 Jun 2026 11:00:42 +0200 -Subject: [PATCH] Fix test_gettext_literalblock_additional to use the correct - test root - -test-root doesn't contain the source file for literalblock.pot. The test -passed sequentially because other tests using test root 'intl' left the -file in the same srcdir. With pytest-xdist, the test started correctly failing, -as no leftover file was available during the test run. -Using the test root 'intl', which contains literalblock.txt, fixes the -test. ---- - tests/test_builders/test_build_gettext.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/test_builders/test_build_gettext.py b/tests/test_builders/test_build_gettext.py -index 30798cc5070..8a1827ba281 100644 ---- a/tests/test_builders/test_build_gettext.py -+++ b/tests/test_builders/test_build_gettext.py -@@ -288,7 +288,7 @@ def test_gettext_prolog_epilog_substitution_excluded(app: SphinxTestApp) -> None - - @pytest.mark.sphinx( - 'gettext', -- testroot='root', -+ testroot='intl', - srcdir='gettext', - confoverrides={ - 'gettext_compact': False, diff --git a/8962398b761c3d85a.patch b/8962398b761c3d85a.patch new file mode 100644 index 0000000..3b49f67 --- /dev/null +++ b/8962398b761c3d85a.patch @@ -0,0 +1,29 @@ +From 8962398b761c3d85a7c74b6f789b3ffb127bde0c Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> +Date: Thu, 6 Mar 2025 16:03:44 +0000 +Subject: [PATCH] autosummary: Update test for Python 3.14.0a5+ (#13418) + +`types.UnionType` and `typing.Union` have been merged. +--- + tests/test_extensions/test_ext_autosummary.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/tests/test_extensions/test_ext_autosummary.py b/tests/test_extensions/test_ext_autosummary.py +index 35dc7d180ef..c807ddba3d1 100644 +--- a/tests/test_extensions/test_ext_autosummary.py ++++ b/tests/test_extensions/test_ext_autosummary.py +@@ -447,8 +447,12 @@ def test_autosummary_generate_content_for_module_imported_members(app): + ] + assert context['functions'] == ['bar'] + assert context['all_functions'] == ['_quux', 'bar'] +- assert context['classes'] == ['Class', 'Foo'] +- assert context['all_classes'] == ['Class', 'Foo', '_Baz'] ++ if sys.version_info >= (3, 14, 0, 'alpha', 5): ++ assert context['classes'] == ['Class', 'Foo', 'Union'] ++ assert context['all_classes'] == ['Class', 'Foo', 'Union', '_Baz'] ++ else: ++ assert context['classes'] == ['Class', 'Foo'] ++ assert context['all_classes'] == ['Class', 'Foo', '_Baz'] + assert context['exceptions'] == ['Exc'] + assert context['all_exceptions'] == ['Exc', '_Exc'] + assert context['attributes'] == ['CONSTANT1', 'qux', 'quuz', 'non_imported_member'] diff --git a/Make-the-first-party-extensions-optional.patch b/Make-the-first-party-extensions-optional.patch index 501e4d8..d7b039e 100644 --- a/Make-the-first-party-extensions-optional.patch +++ b/Make-the-first-party-extensions-optional.patch @@ -1,24 +1,21 @@ -From 7b731f7ceb8161b11a529f182bf567b77993bdeb Mon Sep 17 00:00:00 2001 +From f3fba803e1c39232f86acc9a21657cad171ce71b Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 5 Mar 2025 12:14:49 +0100 Subject: [PATCH] Make the first party extensions optional, add [extensions] extra -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit Co-authored-by: Miro HronĨok --- - pyproject.toml | 35 ++++++++++++++++---- + pyproject.toml | 33 ++++++++++++++++---- sphinx/application.py | 6 ++-- sphinx/registry.py | 10 +++--- - sphinx/testing/fixtures.py | 7 ++++ + sphinx/testing/fixtures.py | 7 +++++ tests/test_builders/test_build_html_maths.py | 3 ++ tests/test_writers/test_api_translator.py | 2 ++ - 6 files changed, 50 insertions(+), 13 deletions(-) + 6 files changed, 48 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml -index 1195b04..9a7213f 100644 +index c4b1b6d..4e59e90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,12 +67,6 @@ classifiers = [ @@ -33,12 +30,11 @@ index 1195b04..9a7213f 100644 - "sphinxcontrib-serializinghtml>=1.1.9", "Jinja2>=3.1", "Pygments>=2.17", - "docutils>=0.21,<0.23", -@@ -87,6 +81,34 @@ dependencies = [ - ] + "docutils>=0.20,<0.22", +@@ -88,8 +82,35 @@ dependencies = [ dynamic = ["version"] -+[project.optional-dependencies] + [project.optional-dependencies] +applehelp = [ + "sphinxcontrib-applehelp>=1.0.7", +] @@ -65,23 +61,17 @@ index 1195b04..9a7213f 100644 + "sphinx[serializinghtml]", + "sphinx[qthelp]", +] -+ - [[project.authors]] - name = "Adam Turner" - email = "aa-turner@users.noreply.github.com" -@@ -104,6 +126,7 @@ sphinx-autogen = "sphinx.ext.autosummary.generate:main" - [dependency-groups] docs = [ "sphinxcontrib-websupport", + "sphinx[extensions]", ] lint = [ - "ruff==0.14.9", + "ruff==0.9.9", diff --git a/sphinx/application.py b/sphinx/application.py -index 5349c36..4da1635 100644 +index fe0e8bd..dcb3d75 100644 --- a/sphinx/application.py +++ b/sphinx/application.py -@@ -292,7 +292,7 @@ class Sphinx: +@@ -284,7 +284,7 @@ class Sphinx: # load all built-in extension modules, first-party extension modules, # and first-party themes for extension in builtin_extensions: @@ -90,7 +80,7 @@ index 5349c36..4da1635 100644 # load all user-given extension modules for extension in self.config.extensions: -@@ -494,7 +494,7 @@ class Sphinx: +@@ -478,7 +478,7 @@ class Sphinx: # ---- general extensibility interface ------------------------------------- @@ -99,7 +89,7 @@ index 5349c36..4da1635 100644 """Import and setup a Sphinx extension module. Load the extension given by the module *name*. Use this if your -@@ -502,7 +502,7 @@ class Sphinx: +@@ -486,7 +486,7 @@ class Sphinx: called twice. """ logger.debug('[app] setting up extension: %r', extname) @@ -109,10 +99,10 @@ index 5349c36..4da1635 100644 @staticmethod def require_sphinx(version: tuple[int, int] | str) -> None: diff --git a/sphinx/registry.py b/sphinx/registry.py -index da72924..b6f6122 100644 +index ce52a03..3bc90d5 100644 --- a/sphinx/registry.py +++ b/sphinx/registry.py -@@ -528,7 +528,7 @@ class SphinxComponentRegistry: +@@ -519,7 +519,7 @@ class SphinxComponentRegistry: def add_html_theme(self, name: str, theme_path: str | os.PathLike[str]) -> None: self.html_themes[name] = _StrPath(theme_path) @@ -121,7 +111,7 @@ index da72924..b6f6122 100644 """Load a Sphinx extension.""" if extname in app.extensions: # already loaded return -@@ -549,10 +549,12 @@ class SphinxComponentRegistry: +@@ -540,10 +540,12 @@ class SphinxComponentRegistry: try: mod = import_module(extname) except ImportError as err: @@ -138,7 +128,7 @@ index da72924..b6f6122 100644 setup: _ExtensionSetupFunc | None = getattr(mod, 'setup', None) if setup is None: diff --git a/sphinx/testing/fixtures.py b/sphinx/testing/fixtures.py -index c6fdebe..e9f98a8 100644 +index ec143fa..e6d9da1 100644 --- a/sphinx/testing/fixtures.py +++ b/sphinx/testing/fixtures.py @@ -31,6 +31,7 @@ DEFAULT_ENABLED_MARKERS = [ @@ -163,10 +153,10 @@ index c6fdebe..e9f98a8 100644 pargs: dict[int, Any] = {} diff --git a/tests/test_builders/test_build_html_maths.py b/tests/test_builders/test_build_html_maths.py -index 8654ca9..8ad006f 100644 +index cc21142..16382e3 100644 --- a/tests/test_builders/test_build_html_maths.py +++ b/tests/test_builders/test_build_html_maths.py -@@ -40,6 +40,7 @@ def test_html_math_renderer_is_imgmath(app: SphinxTestApp) -> None: +@@ -37,6 +37,7 @@ def test_html_math_renderer_is_imgmath(app: SphinxTestApp) -> None: assert app.builder.math_renderer_name == 'imgmath' @@ -174,7 +164,7 @@ index 8654ca9..8ad006f 100644 @pytest.mark.sphinx( 'html', testroot='basic', -@@ -67,6 +68,7 @@ def test_html_math_renderer_is_duplicated2(app: SphinxTestApp) -> None: +@@ -62,6 +63,7 @@ def test_html_math_renderer_is_duplicated2(app: SphinxTestApp) -> None: assert app.builder.math_renderer_name == 'imgmath' # The another one is chosen @@ -182,7 +172,7 @@ index 8654ca9..8ad006f 100644 @pytest.mark.sphinx( 'html', testroot='basic', -@@ -80,6 +82,7 @@ def test_html_math_renderer_is_chosen(app: SphinxTestApp) -> None: +@@ -75,6 +77,7 @@ def test_html_math_renderer_is_chosen(app: SphinxTestApp) -> None: assert app.builder.math_renderer_name == 'imgmath' @@ -211,5 +201,5 @@ index 1220192..8e8bb33 100644 def test_json_set_translator_for_json(app: SphinxTestApp) -> None: translator_class = app.builder.get_translator_class() -- -2.52.0 +2.48.1 diff --git a/e01e42f5fc738815b.patch b/e01e42f5fc738815b.patch new file mode 100644 index 0000000..a42c216 --- /dev/null +++ b/e01e42f5fc738815b.patch @@ -0,0 +1,40 @@ +From e01e42f5fc738815b8499c4ede30c6caf130f0a4 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+aa-turner@users.noreply.github.com> +Date: Wed, 19 Mar 2025 20:11:35 +0000 +Subject: [PATCH] Fix ``INVALID_BUILTIN_CLASSES`` test for Python 3.14.0a6+ + +--- + tests/test_util/test_util_typing.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_util/test_util_typing.py b/tests/test_util/test_util_typing.py +index 35ee240f7b8..8a561c378ed 100644 +--- a/tests/test_util/test_util_typing.py ++++ b/tests/test_util/test_util_typing.py +@@ -205,7 +205,7 @@ def test_is_invalid_builtin_class() -> None: + zipfile.Path, + zipfile.CompleteDirs, + ) +- if sys.version_info[:2] >= (3, 13): ++ if sys.version_info[:2] == (3, 13): + invalid_types += ( + # pathlib + Path, +@@ -217,7 +217,7 @@ def test_is_invalid_builtin_class() -> None: + ) + + invalid_names = {(cls.__module__, cls.__qualname__) for cls in invalid_types} +- if sys.version_info[:2] < (3, 13): ++ if sys.version_info[:2] != (3, 13): + invalid_names |= { + ('pathlib._local', 'Path'), + ('pathlib._local', 'PosixPath'), +@@ -231,7 +231,7 @@ def test_is_invalid_builtin_class() -> None: + ('zipfile._path', 'Path'), + ('zipfile._path', 'CompleteDirs'), + } +- assert _INVALID_BUILTIN_CLASSES.keys() == invalid_names ++ assert set(_INVALID_BUILTIN_CLASSES) == invalid_names + + + def test_restify_type_hints_containers(): diff --git a/python-sphinx.spec b/python-sphinx.spec index e656d49..2b29abd 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -22,7 +22,7 @@ %bcond latex_tests 1 Name: python-sphinx -%global general_version 9.1.0 +%global general_version 8.2.3 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -41,13 +41,6 @@ Source: %{pypi_source sphinx %{upstream_version}} # which causes that test to fail. Patch: sphinx-test_theming.patch -# Fix for test_stemmer failing with Python 3.15+, merged upstream -Patch: https://github.com/sphinx-doc/sphinx/pull/14474.patch - -# Fix test_gettext_literalblock_additional failure with pytest-xdist: -# the test used testroot='root' which lacks literalblock.txt -Patch: https://github.com/sphinx-doc/sphinx/pull/14507.patch - # Make the first party extensions optional # This removes the runtime dependencies on: # - sphinxcontrib.applehelp @@ -64,6 +57,14 @@ Patch: https://github.com/sphinx-doc/sphinx/pull/14507.patch # https://github.com/sphinx-doc/sphinx/pull/11747 Patch: Make-the-first-party-extensions-optional.patch +# Compatibility with Python 3.14 +Patch: https://github.com/sphinx-doc/sphinx/commit/8962398b761c3d85a.patch +Patch: https://github.com/sphinx-doc/sphinx/commit/e01e42f5fc738815b.patch +Patch: https://github.com/sphinx-doc/sphinx/pull/13527.patch +# Compatibility with docutils 0.22+ +Patch: https://github.com/sphinx-doc/sphinx/pull/13610.patch +Patch: https://github.com/sphinx-doc/sphinx/pull/13883.patch + BuildArch: noarch BuildRequires: make @@ -92,10 +93,6 @@ BuildRequires: texinfo BuildRequires: ImageMagick %endif -%if %{undefined rhel} -BuildRequires: python%{python3_pkgversion}-pytest-xdist -%endif - %if %{undefined rhel} && %{with latex_tests} BuildRequires: texlive-collection-fontsrecommended BuildRequires: texlive-collection-latex @@ -365,11 +362,8 @@ This package contains documentation in the HTML format. sed -i -e '/pytest-xdist/d' pyproject.toml %endif -# sphinx 9.1.0 requires pytest >= 9, which we don't have in Fedora yet -sed -i '/"pytest>=/ s/>=[^",]*//' pyproject.toml - -# docutils moves faster than sphinx -%pyproject_patch_dependency docutils:drop_upper +# Support for docutils 0.22+ +sed -i -e 's/docutils>=0.20,<0.22/docutils>=0.20,<0.23/' pyproject.toml # Drop test-dependency on defusedxml, # use xml from the standard library instead. @@ -393,12 +387,12 @@ _EOF %endif %if %{without imagemagick_tests} -rm -r tests/test_ext_imgconverter/ +rm tests/test_extensions/test_ext_imgconverter.py %endif %generate_buildrequires -%pyproject_buildrequires %{?with_tests:-g test} +%pyproject_buildrequires -r %{?with_tests:-x test} %build @@ -491,7 +485,7 @@ k="${k} and not test_term_in_heading_and_section and not test_IndexBuilder" k="${k} and not test_check_js_search_indexes" %endif -%pytest -k "${k}" %{!?rhel:-n auto} +%pytest -k "${k}" %endif %files -n python%{python3_pkgversion}-sphinx -f sphinx.lang diff --git a/sources b/sources index 0c7eb51..df7d90d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sphinx-9.1.0.tar.gz) = 2c8b16935e14a8f827110461c530275f431949159eef47380198115d8abadaafdca06680c09722c0df7fd8ed8e16dbe1e3aa62a774164b7987247f6d8f8a20d3 +SHA512 (sphinx-8.2.3.tar.gz) = e7cbe251e4f44eb59ef6fd84d3918b1b29941943b75265da75aa9533379746e76331ac8a3ba8c1694840adeebd6886e0fc8eebf5407271aaeddf39594d8e1523