14
0

- Add patch support-python314.patch:

* Support Python 3.14 ast changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-theme-builder?expand=0&rev=11
This commit is contained in:
2025-11-12 01:52:38 +00:00
committed by Git OBS Bridge
commit 5a2e5234e6
7 changed files with 246 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e4cf8722ae40c133d79bd41a0398d2f96228cb79c891e77d6b9745da386360fa
size 40784

View File

@@ -0,0 +1,33 @@
-------------------------------------------------------------------
Wed Nov 12 01:52:03 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python314.patch:
* Support Python 3.14 ast changes.
-------------------------------------------------------------------
Mon Aug 4 05:30:03 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-click-8.2.patch:
* Support click 8.2 changes.
-------------------------------------------------------------------
Wed Sep 25 05:20:18 UTC 2024 - ecsos <ecsos@opensuse.org>
- Add %{?sle15_python_module_pythons}
-------------------------------------------------------------------
Sun Jan 14 10:39:25 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 0.2.0b2:
* Adopt the newer copy of `copyfileobj_with_hashing`
* Correctly encode `RECORD` hashes
* Document a previously undocumented error case
* Document the `--pdb` flag
* Improve documentation to pass nit-picks
* Improve the `autobuild-failed` documentation
* Use tomllib on Python 3.11+
-------------------------------------------------------------------
Mon Mar 6 12:49:12 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Initial package (0.2.0b1)

View File

@@ -0,0 +1,95 @@
#
# spec file for package python-sphinx-theme-builder
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-sphinx-theme-builder
Version: 0.2.0b2
Release: 0
Summary: A tool for authoring Sphinx themes with a simple (opinionated) workflow
License: MIT
URL: https://github.com/pradyunsg/sphinx-theme-builder
Source: https://github.com/pradyunsg/sphinx-theme-builder/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE Support click 8.2 changes
Patch0: support-click-8.2.patch
# PATCH-FIX-UPSTREAM gh#pradyunsg/sphinx-theme-builder#51
Patch1: support-python314.patch
BuildRequires: %{python_module click}
BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pyproject-metadata}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module rich}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module sphinx-autobuild}
BuildRequires: %{python_module tomli >= 1.0.0 if %python-base < 3.11}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-build
Requires: python-click
Requires: python-nodeenv
Requires: python-packaging
Requires: python-pyproject-metadata
Requires: python-rich
Requires: python-setuptools
Requires: python-sphinx-autobuild
Requires: (python-tomli if python-base < 3.11)
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
Streamline the Sphinx theme development workflow, by building upon
existing standardised tools.
* simplified packaging experience
* simplified JavaScript tooling setup
* development server, with rebuild-on-save and automagical browser reloading
* consistent repository structure across themes
%prep
%autosetup -p1 -n sphinx-theme-builder-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/stb
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%post
%python_install_alternative stb
%postun
%python_uninstall_alternative stb
%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/stb
%{python_sitelib}/sphinx_theme_builder
%{python_sitelib}/sphinx_theme_builder-%{version}.dist-info
%changelog

65
support-click-8.2.patch Normal file
View File

@@ -0,0 +1,65 @@
Index: sphinx-theme-builder-0.2.0b2/tests/conftest.py
===================================================================
--- sphinx-theme-builder-0.2.0b2.orig/tests/conftest.py
+++ sphinx-theme-builder-0.2.0b2/tests/conftest.py
@@ -1,5 +1,6 @@
import contextlib
import errno
+import inspect
import os
import shutil
import stat
@@ -17,7 +18,10 @@ from click.testing import CliRunner
# Fixtures
@pytest.fixture
def runner() -> CliRunner:
- return CliRunner(mix_stderr=False)
+ if inspect.signature(click.testing.CliRunner).parameters.get("mix_stderr"):
+ return click.testing.CliRunner(mix_stderr=False)
+ else:
+ return click.testing.CliRunner()
@pytest.fixture
Index: sphinx-theme-builder-0.2.0b2/tests/workflow/test_cli.py
===================================================================
--- sphinx-theme-builder-0.2.0b2.orig/tests/workflow/test_cli.py
+++ sphinx-theme-builder-0.2.0b2/tests/workflow/test_cli.py
@@ -8,8 +8,8 @@ class TestCLIRoot:
def test_no_arguments(self, runner: CliRunner, cli: Group) -> None:
process = runner.invoke(cli, [])
- assert process.exit_code == 0
- assert process.stdout
+ assert process.exit_code in (0, 2)
+ assert process.stdout == ''
def test_help(self, runner: CliRunner, cli: Group) -> None:
process = runner.invoke(cli, ["--help"])
@@ -23,4 +23,4 @@ class TestCLIRoot:
process_one = runner.invoke(cli, [])
process_two = runner.invoke(cli, ["--help"])
- assert process_one.stdout == process_two.stdout
+ assert process_two.stdout in process_one.stderr
Index: sphinx-theme-builder-0.2.0b2/tests/workflow/test_new.py
===================================================================
--- sphinx-theme-builder-0.2.0b2.orig/tests/workflow/test_new.py
+++ sphinx-theme-builder-0.2.0b2/tests/workflow/test_new.py
@@ -8,8 +8,8 @@ class TestCLINew:
def test_no_arguments(self, runner: CliRunner, cli: Group) -> None:
process = runner.invoke(cli, [])
- assert process.exit_code == 0
- assert process.stdout
+ assert process.exit_code in (0, 2)
+ assert process.stdout == ''
def test_help(self, runner: CliRunner, cli: Group) -> None:
process = runner.invoke(cli, ["--help"])
@@ -23,4 +23,4 @@ class TestCLINew:
process_one = runner.invoke(cli, [])
process_two = runner.invoke(cli, ["--help"])
- assert process_one.stdout == process_two.stdout
+ assert process_two.stdout in process_one.stderr

26
support-python314.patch Normal file
View File

@@ -0,0 +1,26 @@
From bef651880a125419e5b53eb0a1b9c236d01f5228 Mon Sep 17 00:00:00 2001
From: Jerry James <loganjerry@gmail.com>
Date: Mon, 27 Jan 2025 17:04:02 -0700
Subject: [PATCH] Avoid ast.Str for python 3.14 compatibility
---
src/sphinx_theme_builder/_internal/project.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/sphinx_theme_builder/_internal/project.py b/src/sphinx_theme_builder/_internal/project.py
index b90e677..98eaf26 100644
--- a/src/sphinx_theme_builder/_internal/project.py
+++ b/src/sphinx_theme_builder/_internal/project.py
@@ -40,9 +40,10 @@ def get_version_using_ast(contents: bytes) -> Optional[str]:
and len(child.targets) == 1
and isinstance(child.targets[0], ast.Name)
and child.targets[0].id == "__version__"
- and isinstance(child.value, ast.Str)
+ and isinstance(child.value, ast.Constant)
+ and isinstance(child.value.value, str)
):
- version = child.value.s
+ version = child.value.value
break
return version