Compare commits

..

1 Commits
main ... 1.1

3 changed files with 26 additions and 40 deletions

View File

@ -1,9 +1,3 @@
-------------------------------------------------------------------
Sun Jan 14 15:25:51 UTC 2024 - Dirk Müller <dmueller@suse.com>
- 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 <daniel.garcia@suse.com>
@ -24,4 +18,4 @@ Mon May 8 11:07:48 UTC 2023 - Torsten Gruner <simmphonie@opensuse.org>
-------------------------------------------------------------------
Fri May 5 06:14:05 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Initial release of 4.1
- Initial release of 4.1

View File

@ -1,7 +1,7 @@
#
# spec file
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2023 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 and gh#sphinx-contrib/jquery#28
Patch1: tests-with-sphinx-72-python312.patch
# PATCH-FIX-UPSTREAM tests-with-sphinx-72.patch gh#sphinx-contrib/jquery#27
Patch1: tests-with-sphinx-72.patch
BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module pip}
BuildRequires: python-rpm-macros

View File

@ -1,19 +1,12 @@
From ac97ce5202b05ddb6bf4e5b77151a8964b6bf632 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
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
@@ -4,11 +4,15 @@ from pathlib import Path
@@ -1,10 +1,9 @@
import base64
import hashlib
-from pathlib import Path
+from pathlib import Path, PosixPath
import pytest
import sphinx
@ -21,33 +14,32 @@ 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
+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
+
+
def run_blank_app(srcdir, **kwargs):
Path(srcdir, "conf.py").write_text("", encoding="ascii")
@@ -24,11 +28,13 @@ def run_blank_app(srcdir, **kwargs):
@pytest.fixture(scope="function")
-def blank_app(tmpdir, monkeypatch):
+def blank_app(tmp_path, monkeypatch):
def blank_app(tmpdir, monkeypatch):
def inner(**kwargs):
- return run_blank_app(path(tmpdir), **kwargs)
+ return run_blank_app(test_path(tmp_path), **kwargs)
+ return run_blank_app(Path(tmpdir), **kwargs)
- monkeypatch.setattr("sphinx.application.abspath", lambda x: x)
+ # Sphinx>=7.2 doesn't have abspath
+ if sphinx.version_info[:2] < (7, 2):
+ monkeypatch.setattr("sphinx.application.abspath", lambda x: x)
+ monkeypatch.setattr("sphinx.application._StrPath", FakePath)
yield inner
@@ -38,12 +44,14 @@ def test_jquery_installed_sphinx_ge_60_u
@@ -38,12 +47,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")
@ -64,7 +56,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 +64,12 @@ def test_jquery_installed_sphinx_ge_60(b
@@ -56,10 +67,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")