diff --git a/Make-the-tests-pass-with-Sphinx-7.3.x.patch b/Make-the-tests-pass-with-Sphinx-7.3.x.patch deleted file mode 100644 index 1d4d4f5715b62e86e67df4084024be8c3306e14a..0000000000000000000000000000000000000000 --- a/Make-the-tests-pass-with-Sphinx-7.3.x.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 2c7cd9adb7e23071fd803abe8729b9143d8dccd1 Mon Sep 17 00:00:00 2001 -From: Dmitry Shachnev -Date: Mon, 5 Aug 2024 11:54:24 +0300 -Subject: [PATCH] Make the tests pass with Sphinx 7.3.x (#245) - -Commit https://github.com/sphinx-doc/sphinx/commit/6471027d1936f0a0 was -included in Sphinx 7.4, not 7.3. ---- - tests/test_urls.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tests/test_urls.py b/tests/test_urls.py -index d5a4031..d5a10a5 100644 ---- a/tests/test_urls.py -+++ b/tests/test_urls.py -@@ -64,7 +64,7 @@ def test_default_settings(app, status, warning): - else: - cssclass = "" - -- if sphinx.version_info < (7, 3): -+ if sphinx.version_info < (7, 4): - alt = "Logo" - else: - alt = "Logo of Python" -@@ -144,7 +144,7 @@ def test_urls_prefix_setting(app, status, warning): - else: - cssclass = "" - -- if sphinx.version_info < (7, 3): -+ if sphinx.version_info < (7, 4): - alt = "Logo" - else: - alt = "Logo of Python" -@@ -187,7 +187,7 @@ def test_urls_prefix_setting_none(app, status, warning): - else: - cssclass = "" - -- if sphinx.version_info < (7, 3): -+ if sphinx.version_info < (7, 4): - alt = "Logo" - else: - alt = "Logo of Python" diff --git a/Make-the-tests-pass-with-Sphinx-8.1.patch b/Make-the-tests-pass-with-Sphinx-8.1.patch deleted file mode 100644 index 802ad6227203dc2f2e447f4f797b327eb4a59527..0000000000000000000000000000000000000000 --- a/Make-the-tests-pass-with-Sphinx-8.1.patch +++ /dev/null @@ -1,147 +0,0 @@ -From 8af414e0f76dddd64143090a7eb9ff9d3f1de2d1 Mon Sep 17 00:00:00 2001 -From: Dmitry Shachnev -Date: Wed, 4 Dec 2024 15:33:24 +0300 -Subject: [PATCH] Make the tests pass with Sphinx 8.1 (#250) - -* Make the tests pass with Sphinx 8.1 - -See https://github.com/sphinx-doc/sphinx/pull/12776 which changed the -default theme from alabaster to basic and broke the tests. - -Fixes #249. - -* Sphinx master dropped support for Python 3.10 - -See https://github.com/sphinx-doc/sphinx/pull/13000. - -* Add explicit docstrings to OrphanMetadataCollector members without :event: ---- - .circleci/config.yml | 1 + - notfound/extension.py | 8 ++++++++ - tests/test_urls.py | 15 ++++++++++++++- - tox.ini | 3 ++- - 4 files changed, 25 insertions(+), 2 deletions(-) - -diff --git a/.circleci/config.yml b/.circleci/config.yml -index 74869c4..f912e34 100644 ---- a/.circleci/config.yml -+++ b/.circleci/config.yml -@@ -37,6 +37,7 @@ jobs: - steps: - - run-tox: - version: py310 -+ sphinx-version: "5,6,7,8" - py311: - docker: - - image: 'cimg/python:3.11' -diff --git a/notfound/extension.py b/notfound/extension.py -index c89afaf..221b85d 100644 ---- a/notfound/extension.py -+++ b/notfound/extension.py -@@ -249,9 +249,17 @@ class OrphanMetadataCollector(EnvironmentCollector): - """ - - def clear_doc(self, app, env, docname): -+ """Remove specified data of a document. -+ -+ This method is called on the removal of the document. -+ """ - return None - - def process_doc(self, app, doctree): -+ """Process a document and gather specific data from it. -+ -+ This method is called after the document is read. -+ """ - metadata = app.env.metadata[app.config.notfound_pagename] - metadata.update({'orphan': True, 'nosearch': True}) - -diff --git a/tests/test_urls.py b/tests/test_urls.py -index d5a10a5..21ffb53 100644 ---- a/tests/test_urls.py -+++ b/tests/test_urls.py -@@ -52,7 +52,13 @@ def test_404_page_not_created(app, status, warning): - path = app.outdir / '404.html' - assert not path.exists() - --@pytest.mark.sphinx(srcdir=srcdir) -+@pytest.mark.sphinx( -+ srcdir=srcdir, -+ # Sphinx changed the default theme to basic in version 8.1.0 -+ # (https://github.com/sphinx-doc/sphinx/pull/12776), but our -+ # tests depend heavily on the specifics of alabaster. -+ confoverrides={'html_theme': 'alabaster'}, -+) - def test_default_settings(app, status, warning): - app.build() - path = app.outdir / '404.html' -@@ -130,6 +136,7 @@ def test_pagename_setting(app, status, warning): - srcdir=srcdir, - confoverrides={ - 'notfound_urls_prefix': '/language/version/', -+ 'html_theme': 'alabaster', - }, - ) - def test_urls_prefix_setting(app, status, warning): -@@ -173,6 +180,7 @@ def test_urls_prefix_setting(app, status, warning): - srcdir=srcdir, - confoverrides={ - 'notfound_urls_prefix': None, -+ 'html_theme': 'alabaster', - }, - ) - def test_urls_prefix_setting_none(app, status, warning): -@@ -248,6 +256,7 @@ def test_template_setting(app, status, warning): - srcdir=rstsrcdir, - confoverrides={ - 'version': '2.5.1', -+ 'html_theme': 'alabaster', - }, - ) - def test_custom_404_rst_source(app, status, warning): -@@ -359,6 +368,7 @@ def test_image_absolute_url(app, status, warning): - @pytest.mark.sphinx( - srcdir=srcdir, - buildername='dirhtml', -+ confoverrides={'html_theme': 'alabaster'}, - ) - def test_urls_for_dirhtml_builder(app, status, warning): - app.build() -@@ -409,6 +419,7 @@ def test_sphinx_resource_urls(app, status, warning): - srcdir=srcdir, - confoverrides={ - 'notfound_urls_prefix': '/ja/default/', -+ 'html_theme': 'alabaster', - }, - ) - def test_toctree_urls_notfound_default(app, status, warning): -@@ -435,6 +446,7 @@ def test_toctree_urls_notfound_default(app, status, warning): - - @pytest.mark.sphinx( - srcdir=srcdir, -+ confoverrides={'html_theme': 'alabaster'}, - ) - def test_toctree_links(app, status, warning): - app.build() -@@ -456,6 +468,7 @@ def test_toctree_links(app, status, warning): - srcdir=srcdir, - confoverrides={ - 'notfound_urls_prefix': '/pt-br/stable/', -+ 'html_theme': 'alabaster', - }, - ) - def test_toctree_links_custom_settings(app, status, warning): -diff --git a/tox.ini b/tox.ini -index a2107a8..02644d9 100644 ---- a/tox.ini -+++ b/tox.ini -@@ -6,7 +6,8 @@ envlist = - docs - py{38}-sphinx{5,6} - py{39}-sphinx{5,6,7} -- py{310,311,312}-sphinx{5,6,7,8,latest,dev} -+ py{310}-sphinx{5,6,7,8} -+ py{311,312}-sphinx{5,6,7,8,latest,dev} - - [testenv] - deps = diff --git a/python-sphinx-notfound-page.spec b/python-sphinx-notfound-page.spec index 010c207d3db31731426db3587f0ba43bcd36bb38..0c66409ea3f814ce670c5d955d0276e902039385 100644 --- a/python-sphinx-notfound-page.spec +++ b/python-sphinx-notfound-page.spec @@ -5,17 +5,13 @@ %global desc Create a custom 404 page with absolute URLs hardcoded Name: python-%{pypi_name} -Version: 1.0.4 -Release: 2 +Version: 1.1.0 +Release: 1 Summary: Create a custom 404 page with absolute URLs hardcoded License: MIT URL: https://pypi.python.org/pypi/%{pypi_name} -Source0: https://github.com/%{project_owner}/%{pypi_name}/archive/%{version}/%{pypi_name}-%{version}.tar.gz +Source0: https://github.com/%{project_owner}/%{pypi_name}/archive/%{version}/%{srcname}-%{version}.tar.gz -# https://github.com/readthedocs/sphinx-notfound-page/commit/2c7cd9adb7e23071fd803abe8729b9143d8dccd1 -Patch0: Make-the-tests-pass-with-Sphinx-7.3.x.patch -# https://github.com/readthedocs/sphinx-notfound-page/commit/8af414e0f76dddd64143090a7eb9ff9d3f1de2d1 -Patch1: Make-the-tests-pass-with-Sphinx-8.1.patch BuildArch: noarch @@ -41,7 +37,7 @@ Requires: python%{python3_pkgversion}-sphinx %prep -%autosetup -n %{pypi_name}-%{version} -p1 +%autosetup -n %{srcname}-%{version} -p1 %build %pyproject_build @@ -50,7 +46,7 @@ Requires: python%{python3_pkgversion}-sphinx %pyproject_install %check -PYTHONPATH=$PWD py.test-%{python3_version} -v . +%tox %files -n python%{python3_pkgversion}-%{pypi_name} %license LICENSE @@ -59,6 +55,12 @@ PYTHONPATH=$PWD py.test-%{python3_version} -v . %{python3_sitelib}/%{importname}/ %changelog +* Tue Apr 22 2025 zhangxianjun - 1.1.0-1 +- update to 1.1.0 + *Fix tests with sphinx 7.3.x and 8.1 + *Use READTHEDOCS_CANONICAL_URL for notfound_urls_prefix + *Docs: update requirements + * Tue Jan 21 2025 yaoxin <1024769339@qq.com> - 1.0.4-2 - Fix tests with sphinx 7.3.x and 8.x diff --git a/sphinx-notfound-page-1.0.4.tar.gz b/sphinx-notfound-page-1.0.4.tar.gz deleted file mode 100644 index 2ab55496d3be80e1ee962b778ab63062e2f3e7fc..0000000000000000000000000000000000000000 Binary files a/sphinx-notfound-page-1.0.4.tar.gz and /dev/null differ diff --git a/sphinx_notfound_page-1.1.0.tar.gz b/sphinx_notfound_page-1.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8662451f36644b8c91ca27177c44bae8d0a32282 Binary files /dev/null and b/sphinx_notfound_page-1.1.0.tar.gz differ