forked from pool/python-sphinxcontrib-jquery
- add tests-with-sphinx-71.patch to fix tests with sphinx 7.1+
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinxcontrib-jquery?expand=0&rev=4
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 4 10:52:33 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add tests-with-sphinx-71.patch to fix tests with sphinx 7.1+
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 8 11:07:48 UTC 2023 - Torsten Gruner <simmphonie@opensuse.org>
|
||||
|
||||
|
@@ -33,6 +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
|
||||
# Taken from https://github.com/sphinx-contrib/jquery/pull/26
|
||||
Patch1: tests-with-sphinx-71.patch
|
||||
BuildRequires: %{python_module flit-core}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: python-rpm-macros
|
||||
|
45
tests-with-sphinx-71.patch
Normal file
45
tests-with-sphinx-71.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
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] 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(-)
|
||||
|
||||
--- a/tests/test_jquery_installed.py
|
||||
+++ b/tests/test_jquery_installed.py
|
||||
@@ -38,12 +38,14 @@ def test_jquery_installed_sphinx_ge_60_use_sri(blank_app):
|
||||
out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"], "jquery_use_sri": True})
|
||||
|
||||
text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
|
||||
+ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
|
||||
assert ('<script '
|
||||
'integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" '
|
||||
- 'src="_static/jquery.js"></script>') in text
|
||||
+ f'src="_static/jquery.js{checksum}"></script>') in text
|
||||
+ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
|
||||
assert ('<script '
|
||||
'integrity="sha384-lSZeSIVKp9myfKbDQ3GkN/KHjUc+mzg17VKDN4Y2kUeBSJioB9QSM639vM9fuY//" '
|
||||
- 'src="_static/_sphinx_javascript_frameworks_compat.js"></script>') in text
|
||||
+ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
|
||||
|
||||
static_dir = out_dir / '_static'
|
||||
assert static_dir.joinpath('jquery.js').is_file()
|
||||
@@ -56,10 +58,12 @@ def test_jquery_installed_sphinx_ge_60(blank_app):
|
||||
out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"]})
|
||||
|
||||
text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
|
||||
+ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
|
||||
assert ('<script '
|
||||
- 'src="_static/jquery.js"></script>') in text
|
||||
+ f'src="_static/jquery.js{checksum}"></script>') in text
|
||||
+ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
|
||||
assert ('<script '
|
||||
- 'src="_static/_sphinx_javascript_frameworks_compat.js"></script>') in text
|
||||
+ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
|
||||
|
||||
static_dir = out_dir / '_static'
|
||||
assert static_dir.joinpath('jquery.js').is_file()
|
Reference in New Issue
Block a user