From 55f39bbc6b6b9350aabe9cfaed31c67fd22c4191 Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Wed, 22 May 2024 19:25:36 -0700 Subject: [PATCH 1/3] fix _Opt deprecation warning closes #234 --- notfound/extension.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/notfound/extension.py b/notfound/extension.py index b2e276d..d6a0784 100644 --- a/notfound/extension.py +++ b/notfound/extension.py @@ -1,8 +1,8 @@ import html -import docutils.nodes import os import warnings +import docutils.nodes import sphinx from sphinx.environment.collectors import EnvironmentCollector from sphinx.errors import ExtensionError @@ -13,7 +13,6 @@ class BaseURIError(ExtensionError): """Exception for malformed base URI.""" - pass # https://www.sphinx-doc.org/en/stable/extdev/appapi.html#event-html-collect-pages @@ -167,7 +166,11 @@ def toctree(*args, **kwargs): # We have to overwrite them here to use our own `pathto` function. # The code is borrowed exactly from Sphinx 7.2.2, there is no changes. if sphinx.version_info >= (7, 2): - from sphinx.builders.html._assets import _CascadingStyleSheet, _file_checksum, _JavaScript + from sphinx.builders.html._assets import ( + _CascadingStyleSheet, + _file_checksum, + _JavaScript, + ) outdir = app.outdir @@ -266,14 +269,22 @@ def validate_configs(app, *args, **kwargs): Shows a warning if one of the configs is not valid. """ - default, rebuild, types = app.config.values.get('notfound_urls_prefix') - if app.config.notfound_urls_prefix != default: - if app.config.notfound_urls_prefix and not all([ - app.config.notfound_urls_prefix.startswith('/'), - app.config.notfound_urls_prefix.endswith('/'), - ]): - message = 'notfound_urls_prefix should start and end with "/" (slash)' - warnings.warn(message, UserWarning, stacklevel=2) + notfound_urls_prefix = app.config.notfound_urls_prefix + default = ( + app.config.values.get("notfound_urls_prefix").default + if sphinx.version_info >= (7, 2) + else app.config.values.get("notfound_urls_prefix")[0] + ) + + if ( + notfound_urls_prefix != default + and notfound_urls_prefix + and not ( + notfound_urls_prefix.startswith("/") or notfound_urls_prefix.endswith("/") + ) + ): + message = 'notfound_urls_prefix should start and end with "/" (slash)' + warnings.warn(message, UserWarning, stacklevel=2) def setup(app): From d8a3d47243e6711bf5df075a2cfa22b81f08c91d Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Mon, 27 May 2024 18:57:38 -0700 Subject: [PATCH 2/3] build(deps): docs --- docs/requirements.txt | 63 +++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 8f6aa25..b2fa9c7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,88 +1,75 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: # # pip-compile --extra=doc --output-file=docs/requirements.txt pyproject.toml # -alabaster==0.7.13 +alabaster==0.7.16 # via sphinx -anyascii==0.3.2 +astroid==3.2.2 # via sphinx-autoapi -astroid==2.15.6 - # via sphinx-autoapi -babel==2.12.1 +babel==2.15.0 # via sphinx -certifi==2023.7.22 +certifi==2024.2.2 # via requests -charset-normalizer==3.2.0 +charset-normalizer==3.3.2 # via requests -docutils==0.18.1 +docutils==0.20.1 # via # sphinx # sphinx-rtd-theme # sphinx-tabs -idna==3.4 +idna==3.7 # via requests imagesize==1.4.1 # via sphinx -jinja2==3.1.2 +jinja2==3.1.4 # via # sphinx # sphinx-autoapi -lazy-object-proxy==1.9.0 - # via astroid -markupsafe==2.1.3 +markupsafe==2.1.5 # via jinja2 -packaging==23.1 +packaging==24.0 # via sphinx -pygments==2.16.1 +pygments==2.18.0 # via # sphinx # sphinx-tabs pyyaml==6.0.1 # via sphinx-autoapi -requests==2.31.0 +requests==2.32.2 # via sphinx snowballstemmer==2.2.0 # via sphinx -sphinx==7.2.3 +sphinx==7.3.7 # via # sphinx-autoapi # sphinx-notfound-page (pyproject.toml) # sphinx-rtd-theme # sphinx-tabs - # sphinxcontrib-applehelp - # sphinxcontrib-devhelp - # sphinxcontrib-htmlhelp # sphinxcontrib-jquery - # sphinxcontrib-qthelp - # sphinxcontrib-serializinghtml # sphinxemoji -sphinx-autoapi==2.1.1 +sphinx-autoapi==3.1.1 # via sphinx-notfound-page (pyproject.toml) -sphinx-rtd-theme==1.3.0 +sphinx-rtd-theme==2.0.0 # via sphinx-notfound-page (pyproject.toml) -sphinx-tabs==3.4.1 +sphinx-tabs==3.4.5 # via sphinx-notfound-page (pyproject.toml) -sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-applehelp==1.0.8 # via sphinx -sphinxcontrib-devhelp==1.0.5 +sphinxcontrib-devhelp==1.0.6 # via sphinx -sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-htmlhelp==2.0.5 # via sphinx sphinxcontrib-jquery==4.1 # via sphinx-rtd-theme sphinxcontrib-jsmath==1.0.1 # via sphinx -sphinxcontrib-qthelp==1.0.6 +sphinxcontrib-qthelp==1.0.7 # via sphinx -sphinxcontrib-serializinghtml==1.1.9 +sphinxcontrib-serializinghtml==1.1.10 # via sphinx -sphinxemoji==0.2.0 +sphinxemoji==0.3.1 # via sphinx-notfound-page (pyproject.toml) -typing-extensions==4.7.1 - # via astroid -urllib3==2.0.4 +urllib3==2.2.1 # via requests -wrapt==1.15.0 - # via astroid From dcb05f441df9b4899abae29bcd22f3d5539112cf Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Mon, 27 May 2024 18:59:01 -0700 Subject: [PATCH 3/3] ci(docs): build on Python 3.12 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index de2a78f..363ff79 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: version: py312 docs: docker: - - image: 'cimg/python:3.11' + - image: 'cimg/python:3.12' steps: - checkout - run: pip install --user tox