[packages/python3-sphinx_panels] - some updates to allow installation with Sphinx 5+ (probably not fully functional, migration to sph
qboosh
qboosh at pld-linux.org
Mon Oct 27 21:47:43 CET 2025
commit 5b205c1a8d94b8e3eea8ad852375ae337b122ec5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon Oct 27 21:47:31 2025 +0100
- some updates to allow installation with Sphinx 5+ (probably not fully functional, migration to sphinx-design is encouraged)
python3-sphinx_panels.spec | 7 +++++-
sphinx_panels-PR83.patch | 53 ++++++++++++++++++++++++++++++++++++++++++++
sphinx_panels-requires.patch | 29 ++++++++++++++++++++++++
3 files changed, 88 insertions(+), 1 deletion(-)
---
diff --git a/python3-sphinx_panels.spec b/python3-sphinx_panels.spec
index df46da2..13eec8b 100644
--- a/python3-sphinx_panels.spec
+++ b/python3-sphinx_panels.spec
@@ -9,6 +9,9 @@ Group: Libraries/Python
Source0: https://files.pythonhosted.org/packages/source/s/sphinx-panels/sphinx-panels-%{version}.tar.gz
# Source0-md5: f2e926a14ad27d66d59fc329339d496e
Patch0: sphinx_panels-deprecated.patch
+Patch1: sphinx_panels-requires.patch
+# https://github.com/executablebooks/sphinx-panels/pulls
+Patch2: sphinx_panels-PR83.patch
URL: https://pypi.org/project/sphinx-panels/
BuildRequires: python3-modules >= 1:3.2
BuildRequires: python3-setuptools
@@ -28,7 +31,9 @@ zoptymalizowanych pod kątem HTML+CSS.
%prep
%setup -q -n sphinx-panels-%{version}
-%patch -P 0 -p1
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
%build
%py3_build
diff --git a/sphinx_panels-PR83.patch b/sphinx_panels-PR83.patch
new file mode 100644
index 0000000..c0d1f53
--- /dev/null
+++ b/sphinx_panels-PR83.patch
@@ -0,0 +1,53 @@
+From f90ca048d9bd4341a94528c73f99dd511abc695b Mon Sep 17 00:00:00 2001
+From: Jochen Sprickerhof <git at jochen.sprickerhof.de>
+Date: Tue, 3 Jan 2023 18:14:22 +0100
+Subject: [PATCH] Use non deprecated importlib files API
+
+https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy
+---
+ sphinx_panels/__init__.py | 17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/sphinx_panels/__init__.py b/sphinx_panels/__init__.py
+index bf1f575..52b5d6d 100644
+--- a/sphinx_panels/__init__.py
++++ b/sphinx_panels/__init__.py
+@@ -1,13 +1,8 @@
+ """"A sphinx extension to add a ``panels`` directive."""
+ import hashlib
++import importlib.resources as resources
+ from pathlib import Path
+
+-try:
+- import importlib.resources as resources
+-except ImportError:
+- # python < 3.7
+- import importlib_resources as resources
+-
+ from docutils import nodes
+ from docutils.parsers.rst import directives, Directive
+ from sphinx.application import Sphinx
+@@ -59,7 +54,9 @@ def update_css(app: Sphinx):
+ old_resources = {path.name for path in static_path.glob("*") if path.is_file()}
+
+ # Add core CSS
+- css_files = [r for r in resources.contents(css_module) if r.endswith(".css")]
++ css_files = [
++ r.name for r in resources.files(css_module).iterdir() if r.name.endswith(".css")
++ ]
+ if app.config.panels_add_boostrap_css is not None:
+ LOGGER.warning(
+ "`panels_add_boostrap_css` will be deprecated. Please use"
+@@ -72,8 +69,10 @@ def update_css(app: Sphinx):
+ for filename in css_files:
+ app.add_css_file(filename)
+ if not (static_path / filename).exists():
+- content = resources.read_text(css_module, filename)
+- (static_path / filename).write_text(content)
++ with (resources.files(css_module) / filename).open(
++ encoding="utf-8", errors="strict"
++ ) as fp:
++ (static_path / filename).write_text(fp.read())
+ app.env.panels_css_changed = True
+ if filename in old_resources:
+ old_resources.remove(filename)
diff --git a/sphinx_panels-requires.patch b/sphinx_panels-requires.patch
new file mode 100644
index 0000000..5bac088
--- /dev/null
+++ b/sphinx_panels-requires.patch
@@ -0,0 +1,29 @@
+--- sphinx-panels-0.6.0/setup.py.orig 2021-06-03 23:37:02.000000000 +0200
++++ sphinx-panels-0.6.0/setup.py 2025-10-27 21:38:12.151803655 +0100
+@@ -26,19 +26,19 @@ setup(
+ include_package_data=True,
+ install_requires=[
+ "docutils",
+- "sphinx>=2,<5",
++ "sphinx>=2",
+ 'importlib-resources~=3.0.0; python_version < "3.7"',
+ ],
+ extras_require={
+ "themes": [
+ "sphinx-rtd-theme",
+- "pydata-sphinx-theme~=0.4.0",
+- "sphinx-book-theme~=0.0.36",
+- "myst-parser~=0.12.9",
++ "pydata-sphinx-theme>=0.4.0",
++ "sphinx-book-theme>=0.0.36",
++ "myst-parser>=0.12.9",
+ ],
+- "code_style": ["pre-commit~=2.7.0"],
+- "testing": ["pytest~=6.0.1", "pytest-regressions~=2.0.1"],
+- "live-dev": ["sphinx-autobuild", "web-compile~=0.2.0"],
++ "code_style": ["pre-commit>=2.7.0"],
++ "testing": ["pytest>=6.0.1", "pytest-regressions>=2.0.1"],
++ "live-dev": ["sphinx-autobuild", "web-compile>=0.2.0"],
+ },
+ classifiers=[
+ "License :: OSI Approved :: MIT License",
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-sphinx_panels.git/commitdiff/5b205c1a8d94b8e3eea8ad852375ae337b122ec5
More information about the pld-cvs-commit
mailing list