[packages/python3-sphinx_book_theme] - use system nodejs and vendored node modules
qboosh
qboosh at pld-linux.org
Fri Nov 7 22:11:05 CET 2025
commit 4fb8ba2f94c0094f9aa7d48d1feaa68182869694
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Nov 7 22:11:08 2025 +0100
- use system nodejs and vendored node modules
python3-sphinx_book_theme.spec | 51 ++++++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/python3-sphinx_book_theme.spec b/python3-sphinx_book_theme.spec
index 7a0b7f0..94e82e1 100644
--- a/python3-sphinx_book_theme.spec
+++ b/python3-sphinx_book_theme.spec
@@ -1,46 +1,47 @@
#
# Conditional build:
-%bcond_with tests # unit tests (not included in sdist)
+%bcond_with doc # Sphinx documentation (TODO: complete dependencies and finish)
+%bcond_with tests # unit tests (TODO: complete dependencies and finish)
Summary: A clean book theme for scientific explanations and documentation with Sphinx
Summary(pl.UTF-8): Przejrzysty motyw książkowy Sphinksa do opisów i dokumentacji naukowych
Name: python3-sphinx_book_theme
-# 1.1.3 requires Sphinx 5+ and sphinx-theme-builder
-# 1.0.1 requires Sphinx 4..6 and sphinx-theme-builder
-# 0.3.3 requires Sphinx 3..5 and sphinx-theme-builder
Version: 1.1.4
-Release: 0.1
+Release: 1
License: BSD
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/sphinx-book-theme/
Source0: https://files.pythonhosted.org/packages/source/s/sphinx-book-theme/sphinx_book_theme-%{version}.tar.gz
# Source0-md5: 31898c128bb5a711039afb2d3eb8d645
+Source1: sphinx_book_theme-1.1.4-vendor.tar.xz
+# Source1-md5: db9d7e1bd882878c330e967b7d606eac
URL: https://pypi.org/project/sphinx-book-theme/
+BuildRequires: nodejs >= 20
+BuildRequires: npm
BuildRequires: python3-build
BuildRequires: python3-installer
-BuildRequires: python3-modules >= 1:3.6
+BuildRequires: python3-modules >= 1:3.9
+BuildRequires: python3-nodeenv
+BuildRequires: python3-sphinx_theme_builder >= 0.2.0
%if %{with tests}
-BuildRequires: python3-PyYAML
-BuildRequires: python3-Sphinx >= 3
-BuildRequires: python3-Sphinx < 5
-BuildRequires: python3-bs4 >= 4.6.1
-BuildRequires: python3-bs4 < 5
-BuildRequires: python3-docutils >= 0.15
-BuildRequires: python3-docutils < 0.19
-BuildRequires: python3-sphinx_theme_builder
-%if "%{py3_ver}" == "3.6"
-BuildRequires: python3-importlib_resources >= 3.0
-%endif
-BuildRequires: python3-pydata_sphinx_theme >= 0.7.2
-BuildRequires: python3-pydata_sphinx_theme < 0.8
+BuildRequires: python3-Sphinx >= 6.1
+BuildRequires: python3-bs4
+BuildRequires: python3-defusedxml
+BuildRequires: python3-myst_nb
+BuildRequires: python3-pydata_sphinx_theme >= 0.15.4
+BuildRequires: python3-pytest
+BuildRequires: python3-pytest-regressions
+BuildRequires: python3-sphinx_thebe
%endif
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
+BuildRequires: rpmbuild(macros) >= 2.044
BuildRequires: sed >= 4.0
-Requires: python3-modules >= 1:3.6
+Requires: python3-modules >= 1:3.9
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define nodejs_version %(nodejs -v | sed s/v//)
+
%description
This is a lightweight Sphinx theme designed to mimic the look-and-feel
of an interactive book.
@@ -50,13 +51,19 @@ Lekki motyw Sphinksa zaprojektowany tak, aby naśladować interaktywną
książkę.
%prep
-%setup -q -n sphinx_book_theme-%{version}
+%setup -q -n sphinx_book_theme-%{version} -a1
+
+# Substitute the installed nodejs version for the requested version
+sed -i 's,^\(node-version = \)".*",\1"%{nodejs_version}",' pyproject.toml
%build
+%{__python3} -m nodeenv --node=system --prebuilt --clean-src $(pwd)/.nodeenv
+
%py3_build_pyproject
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="pytest_datadir.plugin,pytest_regressions.plugin" \
%{__python3} -m pytest tests
%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-sphinx_book_theme.git/commitdiff/4fb8ba2f94c0094f9aa7d48d1feaa68182869694
More information about the pld-cvs-commit
mailing list