diff --git a/python-sphinxcontrib-jquery.changes b/python-sphinxcontrib-jquery.changes index adc3dea..7604c4f 100644 --- a/python-sphinxcontrib-jquery.changes +++ b/python-sphinxcontrib-jquery.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Jan 14 15:25:51 UTC 2024 - Dirk Müller + +- drop tests-with-sphinx-72.patch in order to +- add tests-with-sphinx-72-python312.patch: build with python 312+ + ------------------------------------------------------------------- Mon Sep 4 12:04:08 UTC 2023 - Daniel Garcia @@ -18,4 +24,4 @@ Mon May 8 11:07:48 UTC 2023 - Torsten Gruner ------------------------------------------------------------------- Fri May 5 06:14:05 UTC 2023 - Steve Kowalik -- Initial release of 4.1 +- Initial release of 4.1 diff --git a/python-sphinxcontrib-jquery.spec b/python-sphinxcontrib-jquery.spec index 884c3c4..e2361d7 100644 --- a/python-sphinxcontrib-jquery.spec +++ b/python-sphinxcontrib-jquery.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -33,8 +33,8 @@ Summary: Extension to include jQuery on newer Sphinx releases License: 0BSD URL: https://github.com/sphinx-contrib/jquery/ Source: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-jquery/sphinxcontrib-jquery-4.1.tar.gz -# PATCH-FIX-UPSTREAM tests-with-sphinx-72.patch gh#sphinx-contrib/jquery#27 -Patch1: tests-with-sphinx-72.patch +# PATCH-FIX-UPSTREAM tests-with-sphinx-72.patch gh#sphinx-contrib/jquery#27 and gh#sphinx-contrib/jquery#28 +Patch1: tests-with-sphinx-72-python312.patch BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip} BuildRequires: python-rpm-macros diff --git a/tests-with-sphinx-72.patch b/tests-with-sphinx-72-python312.patch similarity index 68% rename from tests-with-sphinx-72.patch rename to tests-with-sphinx-72-python312.patch index b122dae..e053623 100644 --- a/tests-with-sphinx-72.patch +++ b/tests-with-sphinx-72-python312.patch @@ -1,12 +1,19 @@ +From ac97ce5202b05ddb6bf4e5b77151a8964b6bf632 Mon Sep 17 00:00:00 2001 +From: Dmitry Shachnev +Date: Mon, 31 Jul 2023 15:22:24 +0300 +Subject: [PATCH 1/4] Make the tests pass with Sphinx 7.1 + +Fixes #25. +--- + .github/workflows/test.yml | 5 ++++- + tests/test_jquery_installed.py | 12 ++++++++---- + 2 files changed, 12 insertions(+), 5 deletions(-) + Index: sphinxcontrib-jquery-4.1/tests/test_jquery_installed.py =================================================================== --- sphinxcontrib-jquery-4.1.orig/tests/test_jquery_installed.py +++ sphinxcontrib-jquery-4.1/tests/test_jquery_installed.py -@@ -1,10 +1,9 @@ - import base64 - import hashlib --from pathlib import Path -+from pathlib import Path, PosixPath +@@ -4,11 +4,15 @@ from pathlib import Path import pytest import sphinx @@ -14,32 +21,33 @@ Index: sphinxcontrib-jquery-4.1/tests/test_jquery_installed.py from sphinx.testing.util import SphinxTestApp from sphinxcontrib.jquery import _FILES, _ROOT_DIR # NoQA -@@ -23,12 +22,22 @@ def run_blank_app(srcdir, **kwargs): - return Path(srcdir, "_build", "html") + ++if sphinx.version_info[:2] >= (7, 2): ++ test_path = Path ++else: ++ from sphinx.testing.path import path as test_path ++ + + def run_blank_app(srcdir, **kwargs): + Path(srcdir, "conf.py").write_text("", encoding="ascii") +@@ -24,11 +28,13 @@ def run_blank_app(srcdir, **kwargs): -+class FakePath(PosixPath): -+ @classmethod -+ def _from_parts(cls, args, **kwargs): -+ cls._path = args[0] -+ return PosixPath._from_parts(args, **kwargs) -+ -+ def resolve(self, *args, **kwargs): -+ return self._path -+ -+ @pytest.fixture(scope="function") - def blank_app(tmpdir, monkeypatch): +-def blank_app(tmpdir, monkeypatch): ++def blank_app(tmp_path, monkeypatch): def inner(**kwargs): - return run_blank_app(path(tmpdir), **kwargs) -+ return run_blank_app(Path(tmpdir), **kwargs) ++ return run_blank_app(test_path(tmp_path), **kwargs) - monkeypatch.setattr("sphinx.application.abspath", lambda x: x) -+ monkeypatch.setattr("sphinx.application._StrPath", FakePath) ++ # Sphinx>=7.2 doesn't have abspath ++ if sphinx.version_info[:2] < (7, 2): ++ monkeypatch.setattr("sphinx.application.abspath", lambda x: x) yield inner -@@ -38,12 +47,14 @@ def test_jquery_installed_sphinx_ge_60_u +@@ -38,12 +44,14 @@ def test_jquery_installed_sphinx_ge_60_u out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"], "jquery_use_sri": True}) text = out_dir.joinpath("index.html").read_text(encoding="utf-8") @@ -56,7 +64,7 @@ Index: sphinxcontrib-jquery-4.1/tests/test_jquery_installed.py static_dir = out_dir / '_static' assert static_dir.joinpath('jquery.js').is_file() -@@ -56,10 +67,12 @@ def test_jquery_installed_sphinx_ge_60(b +@@ -56,10 +64,12 @@ def test_jquery_installed_sphinx_ge_60(b out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"]}) text = out_dir.joinpath("index.html").read_text(encoding="utf-8")