commit f130014aefa6a6558b49b38bcac89b6e11b859c0b309f78e945bea20242cfa25 Author: Adrian Schröter Date: Fri May 3 23:07:17 2024 +0200 Sync from SUSE:SLFO:Main python-sphinxcontrib-jquery revision 932e9ff009b088c538b334a17e743f5f diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-sphinxcontrib-jquery.changes b/python-sphinxcontrib-jquery.changes new file mode 100644 index 0000000..adc3dea --- /dev/null +++ b/python-sphinxcontrib-jquery.changes @@ -0,0 +1,21 @@ +------------------------------------------------------------------- +Mon Sep 4 12:04:08 UTC 2023 - Daniel Garcia + +- remove tests-with-sphinx-71.patch. +- Add tests-with-sphinx-72.patch to fix tests with sphinx 7.2. + gh#sphinx-contrib/jquery#27 + +------------------------------------------------------------------- +Mon Sep 4 10:52:33 UTC 2023 - Dirk Müller + +- add tests-with-sphinx-71.patch to fix tests with sphinx 7.1+ + +------------------------------------------------------------------- +Mon May 8 11:07:48 UTC 2023 - Torsten Gruner + +- Switch to mulitbuild to avoid build loop dependency + +------------------------------------------------------------------- +Fri May 5 06:14:05 UTC 2023 - Steve Kowalik + +- Initial release of 4.1 diff --git a/python-sphinxcontrib-jquery.spec b/python-sphinxcontrib-jquery.spec new file mode 100644 index 0000000..884c3c4 --- /dev/null +++ b/python-sphinxcontrib-jquery.spec @@ -0,0 +1,82 @@ +# +# spec file +# +# 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 +# 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/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif + +%{?sle15_python_module_pythons} +Name: python-sphinxcontrib-jquery%{psuffix} +Version: 4.1 +Release: 0 +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 +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} +BuildRequires: python-rpm-macros +# SECTION test requirements +%if %{with test} +BuildRequires: %{python_module Sphinx >= 1.8} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module sphinxcontrib-jquery = %{version}} +%endif +# /SECTION +BuildRequires: fdupes +Requires: python-Sphinx >= 1.8 +BuildArch: noarch +%python_subpackages + +%description +Extension to include jQuery on newer Sphinx releases + +%prep +%autosetup -p1 -n sphinxcontrib-jquery-%{version} + +%if !%{with test} +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%if %{with test} +%check +%pytest +%endif + +%if !%{with test} +%files %{python_files} +%doc AUTHORS CHANGES.rst README.rst +%dir %{python_sitelib}/sphinxcontrib +%dir %{python_sitelib}/sphinxcontrib/jquery +%{python_sitelib}/sphinxcontrib/jquery/* +%{python_sitelib}/sphinxcontrib_jquery-%{version}*info +%endif + +%changelog diff --git a/sphinxcontrib-jquery-4.1.tar.gz b/sphinxcontrib-jquery-4.1.tar.gz new file mode 100644 index 0000000..6a5aa38 --- /dev/null +++ b/sphinxcontrib-jquery-4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a +size 122331 diff --git a/tests-with-sphinx-72.patch b/tests-with-sphinx-72.patch new file mode 100644 index 0000000..b122dae --- /dev/null +++ b/tests-with-sphinx-72.patch @@ -0,0 +1,73 @@ +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 + + import pytest + import sphinx +-from sphinx.testing.path import path + 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") + + ++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 inner(**kwargs): +- return run_blank_app(path(tmpdir), **kwargs) ++ return run_blank_app(Path(tmpdir), **kwargs) + +- monkeypatch.setattr("sphinx.application.abspath", lambda x: x) ++ monkeypatch.setattr("sphinx.application._StrPath", FakePath) + yield inner + + +@@ -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") ++ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else '' + assert ('') in text ++ f'src="_static/jquery.js{checksum}">') in text ++ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else '' + assert ('') in text ++ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}">') in text + + 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 + 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 ('') in text ++ f'src="_static/jquery.js{checksum}">') in text ++ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else '' + assert ('') in text ++ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}">') in text + + static_dir = out_dir / '_static' + assert static_dir.joinpath('jquery.js').is_file()