summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatoro Mahri <matoro_gentoo@matoro.tk>2023-12-17 22:56:42 -0500
committerMichał Górny <mgorny@gentoo.org>2023-12-18 22:27:31 +0100
commit4e22343fe386531e0a3069f51064257237649983 (patch)
treef1ac26f41f8702011ed083d9b670e3fe91bb3464 /dev-python/sphinx-panels
parentprofiles, 23.0 arm: fix typo (diff)
downloadgentoo-4e22343fe386531e0a3069f51064257237649983.tar.gz
gentoo-4e22343fe386531e0a3069f51064257237649983.tar.bz2
gentoo-4e22343fe386531e0a3069f51064257237649983.zip
dev-python/sphinx-panels: patch to fix tests for >=dev-python/sphinx-7
Patch only affects test files so no revbump. Bug: https://bugs.gentoo.org/918053 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Closes: https://github.com/gentoo/gentoo/pull/34342 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/sphinx-panels')
-rw-r--r--dev-python/sphinx-panels/files/sphinx-panels-0.6.0-sphinx-7.patch65
-rw-r--r--dev-python/sphinx-panels/sphinx-panels-0.6.0-r1.ebuild23
2 files changed, 84 insertions, 4 deletions
diff --git a/dev-python/sphinx-panels/files/sphinx-panels-0.6.0-sphinx-7.patch b/dev-python/sphinx-panels/files/sphinx-panels-0.6.0-sphinx-7.patch
new file mode 100644
index 000000000000..8bd3ebb0706b
--- /dev/null
+++ b/dev-python/sphinx-panels/files/sphinx-panels-0.6.0-sphinx-7.patch
@@ -0,0 +1,65 @@
+https://salsa.debian.org/python-team/packages/sphinx-panels/-/blob/debian/master/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
+
+---
+ tests/test_sphinx.py | 8 +++++++-
+ tests/test_sphinx/test_sources_dropdown_basic_.xml | 2 +-
+ tests/test_sphinx/test_sources_tabbed_basic_.xml | 2 +-
+ 3 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_sphinx.py b/tests/test_sphinx.py
+index 9efc2c2..35affa1 100644
+--- a/tests/test_sphinx.py
++++ b/tests/test_sphinx.py
+@@ -2,6 +2,7 @@ from pathlib import Path
+ import shutil
+
+ import pytest
++import sphinx
+ from sphinx.testing.path import path
+
+ from sphinx_panels.tabs import TabbedHtmlTransform
+@@ -15,7 +16,10 @@ 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):
++ 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",
+diff --git a/tests/test_sphinx/test_sources_dropdown_basic_.xml b/tests/test_sphinx/test_sources_dropdown_basic_.xml
+index b984330..4c42825 100644
+--- 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
+diff --git a/tests/test_sphinx/test_sources_tabbed_basic_.xml b/tests/test_sphinx/test_sources_tabbed_basic_.xml
+index b3f2d1a..f55e06e 100644
+--- 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
diff --git a/dev-python/sphinx-panels/sphinx-panels-0.6.0-r1.ebuild b/dev-python/sphinx-panels/sphinx-panels-0.6.0-r1.ebuild
index c076a2d8c2e1..b9a75044b5ab 100644
--- a/dev-python/sphinx-panels/sphinx-panels-0.6.0-r1.ebuild
+++ b/dev-python/sphinx-panels/sphinx-panels-0.6.0-r1.ebuild
@@ -3,13 +3,20 @@
EAPI=8
-PYTHON_COMPAT=( python3_{10..12} )
DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
inherit distutils-r1
DESCRIPTION="A sphinx extension for creating panels in a grid layout"
-HOMEPAGE="https://github.com/executablebooks/sphinx-panels"
-SRC_URI="https://github.com/executablebooks/sphinx-panels/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+HOMEPAGE="
+ https://github.com/executablebooks/sphinx-panels/
+ https://pypi.org/project/sphinx-panels/
+"
+SRC_URI="
+ https://github.com/executablebooks/sphinx-panels/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
LICENSE="MIT"
SLOT="0"
@@ -19,8 +26,16 @@ RDEPEND="
dev-python/docutils[${PYTHON_USEDEP}]
dev-python/sphinx[${PYTHON_USEDEP}]
"
+BDEPEND="
+ test? (
+ dev-python/pytest-regressions[${PYTHON_USEDEP}]
+ )
+"
-BDEPEND="test? ( dev-python/pytest-regressions[${PYTHON_USEDEP}] )"
+PATCHES=(
+ # https://github.com/executablebooks/sphinx-panels/pull/84
+ "${FILESDIR}/${P}-sphinx-7.patch"
+)
distutils_enable_tests pytest
distutils_enable_sphinx docs dev-python/sphinx-rtd-theme