Files
gentoo/dev-python/sphinx-panels/files/sphinx-panels-0.6.0-sphinx-7.patch
Nicolas PARLANT b49bf814e0 dev-python/sphinx-panels: fix test w/ docutils-0.22
apply Debian' patch for docutils
rebase the patch for sphinx-7.2, testing.path is removed since 9.0

Closes: https://bugs.gentoo.org/962897
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1148
Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
2026-06-14 16:04:38 +02:00

56 lines
2.1 KiB
Diff

https://salsa.debian.org/python-team/packages/sphinx-panels/-/blob/debian/0.6.0-7/debian/patches/Make-the-tests-pass-with-Sphinx-7.x.patch
From: Dmitry Shachnev <mitya57@debian.org>
Date: Fri, 3 Nov 2023 23:25:11 +0300
Subject: Make the tests pass with Sphinx 7.x
Forwarded: https://github.com/executablebooks/sphinx-panels/pull/84
--- a/tests/test_sphinx.py
+++ b/tests/test_sphinx.py
@@ -2,7 +2,7 @@ from pathlib import Path
import shutil
import pytest
-from sphinx.testing.path import path
+import sphinx
from sphinx_panels.tabs import TabbedHtmlTransform
@@ -15,7 +15,11 @@ def sphinx_app_factory(make_app, tmp_path: Path, monkeypatch):
shutil.copytree(
(Path(__file__).parent / "sources" / src_folder), tmp_path / src_folder
)
- app = make_app(srcdir=path(str((tmp_path / src_folder).absolute())), **kwargs)
+ srcdir = (tmp_path / src_folder).absolute()
+ if sphinx.version_info < (7, 2):
+ from sphinx.testing.path import path
+ srcdir = path(str(srcdir))
+ app = make_app(srcdir=srcdir, **kwargs)
return app
yield _func
@@ -28,6 +32,8 @@ def test_sources(sphinx_app_factory, file_regression, folder):
assert app._warning.getvalue() == ""
doctree = app.env.get_and_resolve_doctree("index", app.builder)
doctree["source"] = "source"
+ if sphinx.version_info < (7, 1):
+ doctree["translation_progress"] = "{'total': 0, 'translated': 0}"
file_regression.check(
doctree.pformat(),
encoding="utf8",
--- a/tests/test_sphinx/test_sources_dropdown_basic_.xml
+++ b/tests/test_sphinx/test_sources_dropdown_basic_.xml
@@ -1,4 +1,4 @@
-<document source="source">
+<document source="source" translation_progress="{'total': 0, 'translated': 0}">
<section ids="title" names="title">
<title>
Title
--- a/tests/test_sphinx/test_sources_tabbed_basic_.xml
+++ b/tests/test_sphinx/test_sources_tabbed_basic_.xml
@@ -1,4 +1,4 @@
-<document source="source">
+<document source="source" translation_progress="{'total': 0, 'translated': 0}">
<section ids="title" names="title">
<title>
Title