[packages/python3-sphinx-version-warning] - patch: module install dir is not writable, use outdir _static dir
qboosh
qboosh at pld-linux.org
Sun Dec 14 10:08:45 CET 2025
commit afb8a9788f26f6b712dc96fc9dbb6fe35146d741
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Dec 14 10:08:58 2025 +0100
- patch: module install dir is not writable, use outdir _static dir
python3-sphinx-version-warning.spec | 2 ++
sphinx-version-warning-writable.patch | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+)
---
diff --git a/python3-sphinx-version-warning.spec b/python3-sphinx-version-warning.spec
index e8513e3..0ce89be 100644
--- a/python3-sphinx-version-warning.spec
+++ b/python3-sphinx-version-warning.spec
@@ -8,6 +8,7 @@ Group: Libraries/Python
#Source0Download: https://pypi.org/simple/sphinx-version-warning/
Source0: https://files.pythonhosted.org/packages/source/s/sphinx-version-warning/sphinx-version-warning-%{version}.tar.gz
# Source0-md5: b17e016b32add34e5deaa80b4a9af799
+Patch0: sphinx-version-warning-writable.patch
URL: https://pypi.org/project/sphinx-version-warning/
BuildRequires: python3-modules >= 1:3.2
BuildRequires: python3-setuptools
@@ -42,6 +43,7 @@ Dokumentacja API modułu Pythona sphinx-version-warning.
%prep
%setup -q -n sphinx-version-warning-%{version}
+%patch -P0 -p1
%build
%py3_build
diff --git a/sphinx-version-warning-writable.patch b/sphinx-version-warning-writable.patch
new file mode 100644
index 0000000..2da4ee6
--- /dev/null
+++ b/sphinx-version-warning-writable.patch
@@ -0,0 +1,20 @@
+--- sphinx-version-warning-1.1.2/versionwarning/signals.py.orig 2018-10-31 12:11:01.000000000 +0100
++++ sphinx-version-warning-1.1.2/versionwarning/signals.py 2025-12-14 09:50:05.443887142 +0100
+@@ -61,13 +61,13 @@ def generate_versionwarning_data_json(ap
+ },
+ }, indent=4)
+
+- data_path = os.path.join(STATIC_PATH, 'data')
++ writable_static_path = os.path.join(app.outdir, "_static")
++ data_path = os.path.join(writable_static_path, 'data')
+ if not os.path.exists(data_path):
+- os.mkdir(data_path)
++ os.makedirs(data_path, exist_ok=True)
+
+ with open(os.path.join(data_path, JSON_DATA_FILENAME), 'w') as f:
+ f.write(data)
+
+- # Add the path where ``versionwarning-data.json`` file and
+- # ``versionwarning.js`` are saved
++ # Add the path where ``versionwarning.js`` is saved
+ config.html_static_path.append(STATIC_PATH)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-sphinx-version-warning.git/commitdiff/afb8a9788f26f6b712dc96fc9dbb6fe35146d741
More information about the pld-cvs-commit
mailing list