From 749fcacb0fa6165015b5d36031daa21ec25855d0 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 31 Aug 2025 14:58:37 -0400 Subject: [PATCH] dev-python/sphinx: allow newer docutils Upstream pins to max bounds, due IIRC to tight coupling with format specifics of docutils output. We just stabled a newer docutils, and it is incompatible with sphinx RDEPEND. Upstream allows the newer version in git only. There are no corresponding changes other than an earlier testfix. Backporting that is sufficient to pass all tests with a loosened RDEPEND. Signed-off-by: Eli Schwartz --- .../sphinx-8.2.3-testfix-docutils-0.22.patch | 50 +++++++++++++++++++ ...nx-8.2.3.ebuild => sphinx-8.2.3-r1.ebuild} | 5 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 dev-python/sphinx/files/sphinx-8.2.3-testfix-docutils-0.22.patch rename dev-python/sphinx/{sphinx-8.2.3.ebuild => sphinx-8.2.3-r1.ebuild} (96%) diff --git a/dev-python/sphinx/files/sphinx-8.2.3-testfix-docutils-0.22.patch b/dev-python/sphinx/files/sphinx-8.2.3-testfix-docutils-0.22.patch new file mode 100644 index 0000000000000..516559fd3ee31 --- /dev/null +++ b/dev-python/sphinx/files/sphinx-8.2.3-testfix-docutils-0.22.patch @@ -0,0 +1,50 @@ +From 68d56109ff50dd81dd31d4a01e3dccbd006c50ee Mon Sep 17 00:00:00 2001 +From: James Addison <55152140+jayaddison@users.noreply.github.com> +Date: Mon, 2 Jun 2025 22:02:48 +0000 +Subject: [PATCH] Tests: update LaTeX label test expectations from Docutils + r10151 (#13610) + +Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> +--- + 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/dev-python/sphinx/sphinx-8.2.3.ebuild b/dev-python/sphinx/sphinx-8.2.3-r1.ebuild similarity index 96% rename from dev-python/sphinx/sphinx-8.2.3.ebuild rename to dev-python/sphinx/sphinx-8.2.3-r1.ebuild index e686bff12650a..8b8a1f23a8364 100644 --- a/dev-python/sphinx/sphinx-8.2.3.ebuild +++ b/dev-python/sphinx/sphinx-8.2.3-r1.ebuild @@ -30,7 +30,7 @@ IUSE="doc latex" RDEPEND=" >=dev-python/alabaster-0.7.14[${PYTHON_USEDEP}] >=dev-python/babel-2.13[${PYTHON_USEDEP}] - =dev-python/docutils-0.20[${PYTHON_USEDEP}] >=dev-python/imagesize-1.3[${PYTHON_USEDEP}] >=dev-python/jinja2-3.1[${PYTHON_USEDEP}] @@ -73,6 +73,9 @@ BDEPEND=" PATCHES=( "${FILESDIR}/sphinx-3.2.1-doc-link.patch" "${FILESDIR}/${P}-fix-python3.14.patch" # patch collection, merged upstream + # https://github.com/sphinx-doc/sphinx/pull/13610 + # test assumptions for docutils 0.22 + "${FILESDIR}"/${P}-testfix-docutils-0.22.patch ) distutils_enable_tests pytest