From a85d453e5cbbdef9ef7a68a97579f1b6ddddae4a Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:05:21 +0000 Subject: [PATCH 01/33] Updated files with 'repo_helper'. (#172) Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com> --- README.rst | 2 +- doc-source/index.rst | 2 +- tox.ini | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 8726af9..9c1153a 100644 --- a/README.rst +++ b/README.rst @@ -109,7 +109,7 @@ sphinx-toolbox :target: https://github.com/sphinx-toolbox/sphinx-toolbox/commit/master :alt: GitHub last commit -.. |maintained| image:: https://img.shields.io/maintenance/yes/2024 +.. |maintained| image:: https://img.shields.io/maintenance/yes/2025 :alt: Maintenance .. |pypi-downloads| image:: https://img.shields.io/pypi/dm/sphinx-toolbox diff --git a/doc-source/index.rst b/doc-source/index.rst index d5e8d8a..56f04f2 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -114,7 +114,7 @@ sphinx-toolbox :last-commit: :alt: GitHub last commit - .. |maintained| maintained-shield:: 2024 + .. |maintained| maintained-shield:: 2025 :alt: Maintenance .. |pypi-downloads| pypi-shield:: diff --git a/tox.ini b/tox.ini index 33557e9..25d501c 100644 --- a/tox.ini +++ b/tox.ini @@ -230,11 +230,13 @@ toplevel = sphinx_toolbox package = sphinx_toolbox [testenv:py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0}] +download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 [testenv:py313-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0}] +download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 From 262d19b01680fffae6ac62285f1f8a7c8440b411 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 19 Feb 2025 14:07:35 +0000 Subject: [PATCH 02/33] Make `sphinx.util.typing.ForwardRef` type annotation a string. --- sphinx_toolbox/more_autodoc/typehints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx_toolbox/more_autodoc/typehints.py b/sphinx_toolbox/more_autodoc/typehints.py index edc3293..17acd23 100644 --- a/sphinx_toolbox/more_autodoc/typehints.py +++ b/sphinx_toolbox/more_autodoc/typehints.py @@ -904,7 +904,7 @@ def setup(app: Sphinx) -> SphinxExtMetadata: def _resolve_forwardref( - fr: Union[ForwardRef, sphinx.util.typing.ForwardRef], + fr: Union[ForwardRef, "sphinx.util.typing.ForwardRef"], module: str, ) -> object: """ From f92da9aa8d1401be3be5d05d265a055023b577ef Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 19 Feb 2025 14:12:32 +0000 Subject: [PATCH 03/33] Test on Sphinx 8.1 and 8.2 --- .github/workflows/python_ci.yml | 8 ++++---- .github/workflows/python_ci_linux.yml | 8 ++++---- .github/workflows/python_ci_macos.yml | 8 ++++---- pyproject.toml | 2 +- repo_helper.yml | 19 ++++++++++++++++++- tox.ini | 22 +++++++++++----------- 6 files changed, 42 insertions(+), 25 deletions(-) diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 0154c4e..3a3e043 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -31,10 +31,10 @@ jobs: - {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} - {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: False} - - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.13", testenvs: "py313-dev-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: True} + - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1},build", experimental: False} + - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.13", testenvs: "py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} - {python-version: "pypy-3.9-v7.3.15", testenvs: "pypy39-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: True} diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 3f5e27c..a0aa2bd 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -32,10 +32,10 @@ jobs: - {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} - {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: False} - - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.13", testenvs: "py313-dev-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: True} + - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1},build", experimental: False} + - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.13", testenvs: "py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} - {python-version: "pypy-3.9", testenvs: "pypy39-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: True} diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 09f5af5..d3c87a6 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -31,10 +31,10 @@ jobs: - {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} - {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: False} - - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: False} - - {python-version: "3.13", testenvs: "py313-dev-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0},build", experimental: True} + - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1},build", experimental: False} + - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.13", testenvs: "py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} - {python-version: "pypy-3.9", testenvs: "pypy39-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: True} diff --git a/pyproject.toml b/pyproject.toml index ec38e75..a90c8df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ base-classifiers = [ "Topic :: Utilities", "Typing :: Typed", ] -python-versions = [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12",] +python-versions = [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13",] python-implementations = [ "CPython", "PyPy",] platforms = [ "Windows", "macOS", "Linux",] license-key = "MIT" diff --git a/repo_helper.yml b/repo_helper.yml index 6f8378f..cfb471d 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -35,6 +35,8 @@ python_versions: - 7.3 - 7.4 - 8.0 + - 8.1 + - 8.2 - latest 3.8: matrix_exclude: @@ -43,15 +45,22 @@ python_versions: - 7.3 - 7.4 - 8.0 + - 8.1 + - 8.2 - latest 3.9: matrix_exclude: sphinx: - 8.0 + - 8.1 + - 8.2 "3.10": + matrix_exclude: + sphinx: + - 8.2 "3.11": "3.12": - 3.13-dev: + "3.13": matrix_exclude: sphinx: - 3.2 @@ -89,6 +98,8 @@ python_versions: - 7.3 - 7.4 - 8.0 + - 8.1 + - 8.2 - latest pypy38: matrix_exclude: @@ -104,6 +115,8 @@ python_versions: - 7.3 - 7.4 - 8.0 + - 8.1 + - 8.2 - latest pypy39: matrix_exclude: @@ -116,6 +129,8 @@ python_versions: - 4.1 - 4.2 - 8.0 + - 8.1 + - 8.2 - latest additional_ignore: @@ -180,6 +195,8 @@ third_party_version_matrix: - 7.3 - 7.4 - 8.0 + - 8.1 + - 8.2 # - latest classifiers: diff --git a/tox.ini b/tox.ini index 25d501c..4eb46dd 100644 --- a/tox.ini +++ b/tox.ini @@ -24,10 +24,10 @@ envlist = py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3} py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1} py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4} - py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0} - py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0} - py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0} - py313-dev-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0} + py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1} + py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} + py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} + py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3} pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1} pypy39-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4} @@ -46,10 +46,10 @@ test = py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3} py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1} py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4} - py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0} - py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0} - py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0} - py313-dev-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0} + py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1} + py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} + py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} + py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3} pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1} pypy39-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4} @@ -62,7 +62,7 @@ setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 -[testenv:py313-dev] +[testenv:py313] download = True setenv = PYTHONDEVMODE=1 @@ -229,13 +229,13 @@ ignore = W002 toplevel = sphinx_toolbox package = sphinx_toolbox -[testenv:py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0}] +[testenv:py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2}] download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 -[testenv:py313-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0}] +[testenv:py313-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2}] download = True setenv = PYTHONDEVMODE=1 From 9b61843f9e4d062323a5945f080aedebc0a662d2 Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:58:33 +0000 Subject: [PATCH 04/33] Run Linux tests on Ubuntu 22.04 (#179) Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com> --- .github/workflows/mypy.yml | 2 +- .github/workflows/python_ci_linux.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 10c6f30..bd74787 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: - os: ['ubuntu-20.04', 'windows-2019'] + os: ['ubuntu-22.04', 'windows-2019'] fail-fast: false steps: diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index a0aa2bd..6e5d72c 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -19,8 +19,8 @@ permissions: jobs: tests: - name: "ubuntu-20.04 / Python ${{ matrix.config.python-version }}" - runs-on: "ubuntu-20.04" + name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}" + runs-on: "ubuntu-22.04" continue-on-error: ${{ matrix.config.experimental }} env: USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9' @@ -84,7 +84,7 @@ jobs: Coverage: needs: tests - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v4" @@ -133,7 +133,7 @@ jobs: Deploy: needs: tests - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: Checkout πŸ›ŽοΈ uses: "actions/checkout@v4" From 7000df36360144bea710be7cb46a252e4e0f9c8d Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Thu, 20 Feb 2025 16:55:43 +0000 Subject: [PATCH 05/33] Bump version v3.8.2 -> v3.8.3 --- .bumpversion.cfg | 2 +- .github/workflows/conda_ci.yml | 2 +- README.rst | 2 +- doc-source/index.rst | 2 +- pyproject.toml | 2 +- repo_helper.yml | 2 +- sphinx_toolbox/__init__.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 55230e6..2e2e8c9 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.8.2 +current_version = 3.8.3 commit = True tag = True diff --git a/.github/workflows/conda_ci.yml b/.github/workflows/conda_ci.yml index fe2abc6..73951cd 100644 --- a/.github/workflows/conda_ci.yml +++ b/.github/workflows/conda_ci.yml @@ -58,7 +58,7 @@ jobs: - name: "Install package" run: | - $CONDA/bin/conda install -c file://$(pwd)/conda-bld sphinx-toolbox=3.8.2=py_1 -y || exit 1 + $CONDA/bin/conda install -c file://$(pwd)/conda-bld sphinx-toolbox=3.8.3=py_1 -y || exit 1 - name: "Run Tests" run: | diff --git a/README.rst b/README.rst index 9c1153a..40cf0d8 100644 --- a/README.rst +++ b/README.rst @@ -101,7 +101,7 @@ sphinx-toolbox .. |language| image:: https://img.shields.io/github/languages/top/sphinx-toolbox/sphinx-toolbox :alt: GitHub top language -.. |commits-since| image:: https://img.shields.io/github/commits-since/sphinx-toolbox/sphinx-toolbox/v3.8.2 +.. |commits-since| image:: https://img.shields.io/github/commits-since/sphinx-toolbox/sphinx-toolbox/v3.8.3 :target: https://github.com/sphinx-toolbox/sphinx-toolbox/pulse :alt: GitHub commits since tagged version diff --git a/doc-source/index.rst b/doc-source/index.rst index 56f04f2..b6262be 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -107,7 +107,7 @@ sphinx-toolbox :alt: GitHub top language .. |commits-since| github-shield:: - :commits-since: v3.8.2 + :commits-since: v3.8.3 :alt: GitHub commits since tagged version .. |commits-latest| github-shield:: diff --git a/pyproject.toml b/pyproject.toml index a90c8df..55643e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "whey" [project] name = "sphinx-toolbox" -version = "3.8.2" +version = "3.8.3" description = "Box of handy tools for Sphinx 🧰 πŸ“”" readme = "README.rst" keywords = [ "documentation", "sphinx", "sphinx-extension",] diff --git a/repo_helper.yml b/repo_helper.yml index cfb471d..d9e7bf3 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -7,7 +7,7 @@ email: 'dominic@davis-foster.co.uk' username: 'sphinx-toolbox' assignee: 'domdfcoding' primary_conda_channel: 'domdfcoding' -version: '3.8.2' +version: '3.8.3' license: 'MIT' short_desc: 'Box of handy tools for Sphinx 🧰 πŸ“”' diff --git a/sphinx_toolbox/__init__.py b/sphinx_toolbox/__init__.py index f9a682d..71460ec 100644 --- a/sphinx_toolbox/__init__.py +++ b/sphinx_toolbox/__init__.py @@ -57,7 +57,7 @@ __author__: str = "Dominic Davis-Foster" __copyright__: str = "2020 Dominic Davis-Foster" __license__: str = "MIT License" -__version__: str = "3.8.2" +__version__: str = "3.8.3" __email__: str = "dominic@davis-foster.co.uk" __all__ = ("setup", ) From 40122286b427c6ff6be4d692b94a05431a8c0ac8 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 24 Feb 2025 16:50:59 +0000 Subject: [PATCH 06/33] Actually test on Sphinx 8.1 --- sphinx_toolbox/more_autodoc/variables.py | 7 +- sphinx_toolbox/more_autosummary/__init__.py | 80 ++++++++++++++----- sphinx_toolbox/testing.py | 4 + .../test_latex_output.tex | 35 +++++--- .../test_html_output_autoprotocol_html_.html | 6 +- .../test_html_output_generic_bases_.html | 6 +- .../test_html_output_generic_bases_37_.html | 2 +- .../test_output_github_index_html_.html | 6 +- tests/test_output/test_output.py | 1 + .../test_html_output_assets_html_.html | 6 +- ...st_html_output_augment_defaults_html_.html | 6 +- ...st_html_output_autodoc_ellipsis_html_.html | 6 +- ...test_html_output_autonamedtuple_3_10_.html | 6 +- ...test_html_output_autonamedtuple_html_.html | 6 +- ...st_html_output_autonamedtuple_pep563_.html | 6 +- .../test_html_output_autoprotocol_html_.html | 6 +- .../test_html_output_autotypeddict_html_.html | 6 +- .../test_html_output_changeset_html_.html | 6 +- .../test_html_output_code_block_html_.html | 6 +- .../test_html_output_collapse_html_.html | 6 +- .../test_html_output_confval_html_.html | 6 +- .../test_html_output_decorators_html_.html | 6 +- ...ml_output_documentation_summary_html_.html | 6 +- ...tput_documentation_summary_meta_html_.html | 6 +- .../test_html_output_example_html_.html | 6 +- .../test_html_output_flake8_html_.html | 6 +- ...st_html_output_footnote_symbols_html_.html | 6 +- .../test_html_output_formatting_html_.html | 6 +- .../test_html_output_generic_bases_.html | 6 +- .../test_html_output_genericalias_.html | 6 +- .../test_html_output_github_html_.html | 6 +- .../test_html_output_installation_html_.html | 6 +- .../test_html_output_instancevar_html_.html | 6 +- .../test_html_output_latex_html_.html | 6 +- .../test_html_output_no_docstring_html_.html | 6 +- .../test_html_output_overloads_html_.html | 6 +- .../test_html_output_pre_commit_html_.html | 6 +- .../test_html_output_regex_html_.html | 6 +- .../test_html_output_shields_html_.html | 6 +- .../test_html_output_sourcelink_html_.html | 6 +- .../test_html_output_typevars_html_.html | 6 +- .../test_html_output_variables_html_.html | 6 +- .../test_html_output_wikipedia_html_.html | 6 +- .../test_output_/test_latex_output.tex | 61 ++++++++------ ...test_latex_output_autosummary_col_type.tex | 61 ++++++++------ ...test_latex_output_better_header_layout.tex | 61 ++++++++------ .../test_latex_output_latex_layout.tex | 61 ++++++++------ .../test_sidebar_links_output.html | 6 +- .../test_output_github_index_html_.html | 6 +- .../test_output_sphinx_index_html_.html | 6 +- tox.ini | 10 +++ 51 files changed, 414 insertions(+), 209 deletions(-) diff --git a/sphinx_toolbox/more_autodoc/variables.py b/sphinx_toolbox/more_autodoc/variables.py index 7d96538..731ea1a 100644 --- a/sphinx_toolbox/more_autodoc/variables.py +++ b/sphinx_toolbox/more_autodoc/variables.py @@ -657,12 +657,17 @@ def import_object(self, raiseerror: bool = False) -> bool: with mock(self.env.config.autodoc_mock_imports): try: + if sphinx.version_info >= (8, 1): + kwargs = {} + else: + kwargs = {"warningiserror": self.env.config.autodoc_warningiserror} + ret = import_object( self.modname, self.objpath[:-1], "class", attrgetter=self.get_attr, - warningiserror=self.env.config.autodoc_warningiserror + **kwargs, ) self.module, _, _, self.parent = ret return True diff --git a/sphinx_toolbox/more_autosummary/__init__.py b/sphinx_toolbox/more_autosummary/__init__.py index 5434827..8f9d21d 100644 --- a/sphinx_toolbox/more_autosummary/__init__.py +++ b/sphinx_toolbox/more_autosummary/__init__.py @@ -317,29 +317,71 @@ def import_by_name(self, name: str, prefixes: List[Optional[str]]) -> Tuple[str, real_name = re.sub(rf"((?:{modname}\.)+)", f"{modname}.", real_name) return real_name, obj, parent, modname - def create_documenter( - self, - app: Sphinx, - obj: Any, - parent: Any, - full_name: str, - ) -> Documenter: - """ - Get an :class:`autodoc.Documenter` class suitable for documenting the given object. + if sphinx.version_info >= (8, 2): - :param app: The Sphinx application. - :param obj: The object being documented. - :param parent: The parent of the object (e.g. a module or a class). - :param full_name: The full name of the object. + def create_documenter( + self, + obj: Any, + parent: Any, + full_name: str, + *, + registry: Any = None, + ) -> Documenter: + """ + Get an :class:`autodoc.Documenter` class suitable for documenting the given object. - .. versionchanged:: 1.3.0 + :param app: The Sphinx application. + :param obj: The object being documented. + :param parent: The parent of the object (e.g. a module or a class). + :param full_name: The full name of the object. + :param registry: - Now selects the appropriate documenter for attributes rather than - falling back to :class:`~sphinx.ext.autodoc.DataDocumenter`. - """ + .. versionchanged:: 1.3.0 + + Now selects the appropriate documenter for attributes rather than + falling back to :class:`~sphinx.ext.autodoc.DataDocumenter`. + + .. versionchanged:: 3.9.0 + + Function arguments now mirror those from Sphinx 8.2 or + older versions depending on the Sphinx version installed. + """ + + # 3rd party + from sphinx.ext.autosummary import _get_documenter + doccls = _get_documenter(obj, parent, registry=registry) + return doccls(self.bridge, full_name) + + else: + + def create_documenter( + self, + app: Sphinx, + obj: Any, + parent: Any, + full_name: str, + ) -> Documenter: + """ + Get an :class:`autodoc.Documenter` class suitable for documenting the given object. + + :param app: The Sphinx application. + :param obj: The object being documented. + :param parent: The parent of the object (e.g. a module or a class). + :param full_name: The full name of the object. + + .. versionchanged:: 1.3.0 + + Now selects the appropriate documenter for attributes rather than + falling back to :class:`~sphinx.ext.autodoc.DataDocumenter`. + + .. versionchanged:: 3.9.0 + + Function arguments now mirror those from Sphinx 8.2 or + older versions depending on the Sphinx version installed. + """ - doccls = get_documenter(app, obj, parent) - return doccls(self.bridge, full_name) + doccls = get_documenter(app, obj, parent) + return doccls(self.bridge, full_name) def get_table(self, items: List[Tuple[str, str, str, str]]) -> List[nodes.Node]: """ diff --git a/sphinx_toolbox/testing.py b/sphinx_toolbox/testing.py index 17ce381..709163f 100644 --- a/sphinx_toolbox/testing.py +++ b/sphinx_toolbox/testing.py @@ -748,6 +748,10 @@ def test_page(page: BeautifulSoup, html_regression: HTMLRegressionFixture): for div in page.select("div.sphinxsidebar"): div.extract() + for div in page.select("div.related"): + if div["aria-label"] == "Related": + div.extract() + if sphinx.version_info >= (4, 3): # pragma: no cover for div in page.select("span.w"): div.extract() diff --git a/tests/test_autosummary_widths_/test_latex_output.tex b/tests/test_autosummary_widths_/test_latex_output.tex index 8a8fc4c..f8e7c7c 100644 --- a/tests/test_autosummary_widths_/test_latex_output.tex +++ b/tests/test_autosummary_widths_/test_latex_output.tex @@ -14,6 +14,7 @@ <%- macro sphinx6x_2nd(char) -%> <% if (7, 2) > sphinx_version >= (6, 2) %>,<><% endif %> <%- endmacro -%> +<%- set sphinx81_linebreak = "\n" if sphinx_version >= (8, 1) else "" -%> %% Generated by Sphinx. \def\sphinxdocclass{report} \documentclass[letterpaper,10pt,english]{sphinxmanual} @@ -258,7 +259,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{Template}}}{\<< sphinxparam >>{\DUrole{n<>}{template}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxbfcode{\sphinxupquote{class<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{Template}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<>}{template}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> A string class for supporting \$\sphinxhyphen{}substitutions. @@ -272,7 +274,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{capwords}}}{\<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<< sphinx6x_2nd('n') >>}{s}}<% else %>s}<% endif %>\sphinxoptional{<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<>}{sep}}<% else %>sep}<% endif %>}}{{ +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{capwords}}}<< sphinx81_linebreak >>{\<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<< sphinx6x_2nd('n') >>}{s}}<% else %>s}<% endif %>\sphinxoptional{<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<>}{sep}}<% else %>sep}<% endif %>}}<< sphinx81_linebreak >>{{ <%- if sphinx_version >= (4, 4) %> $\rightarrow$ string}} <%- else %> $\rightarrow$ {\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}} <%- endif -%> @@ -423,7 +426,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class<% if sphinx_version >= (4, 3) %>\DUrole{w<< sphinx6x_2nd('w') >>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{TextWrapper}}}{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{initial\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{subsequent\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{expand\_tabs}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{replace\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{fix\_sentence\_endings}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{False}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_long\_words}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{drop\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_on\_hyphens}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{tabsize}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{8}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{*}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{max\_lines}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{placeholder}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{} {[}...{]}\textquotesingle{}}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxbfcode{\sphinxupquote{class<% if sphinx_version >= (4, 3) %>\DUrole{w<< sphinx6x_2nd('w') >>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{TextWrapper}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{initial\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{subsequent\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{expand\_tabs}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{replace\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{fix\_sentence\_endings}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{False}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_long\_words}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{drop\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_on\_hyphens}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{tabsize}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{8}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{*}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{max\_lines}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{placeholder}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{} {[}...{]}\textquotesingle{}}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Object for wrapping/filling text. The public interface consists of @@ -552,8 +556,9 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fill}}}{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<< sphinx6x_2nd('p') >>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ -<%- if sphinx_version >= (4, 4) %>string}}}{{ $\rightarrow$ string}} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxbfcode{\sphinxupquote{fill}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<< sphinx6x_2nd('p') >>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ +<%- if sphinx_version >= (4, 4) %>string}}}<< sphinx81_linebreak >>{{ $\rightarrow$ string}} <%- else %>{\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}}}{{ $\rightarrow$ {\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}} <%- endif %> <%- if sphinx_version > (4, 5) %> @@ -572,9 +577,10 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{wrap}}}{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxbfcode{\sphinxupquote{wrap}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ <%- if sphinx_version >= (4, 4) -%> -string}}}{{ $\rightarrow$ \DUrole{p<>}{{[}}string\DUrole{p<>}{{]}}}} +string}}}<< sphinx81_linebreak >>{{ $\rightarrow$ \DUrole{p<>}{{[}}string\DUrole{p<>}{{]}}}} <%- else -%> {\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}}}{{ $\rightarrow$ \DUrole{p<>}{{[}}{\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}\DUrole{p}{{]}}}} <%- endif -%> @@ -599,7 +605,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{dedent}}}{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{dedent}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Remove any common leading whitespace from every line in \sphinxtitleref{text}. @@ -623,7 +630,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{fill}}}{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{fill}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Fill a single paragraph of text, returning a new string. @@ -643,7 +651,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{indent}}}{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{prefix}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{predicate}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{indent}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{prefix}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{predicate}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Adds <>prefix<> to the beginning of selected lines in β€˜text’. @@ -662,7 +671,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{shorten}}}{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{shorten}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Collapse and truncate the given text to fit in the given width. @@ -687,7 +697,8 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{wrap}}}{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}{} +\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> +<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{wrap}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Wrap a single paragraph of text, returning a list of wrapped lines. diff --git a/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html b/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html index 3e97599..7bf20fc 100644 --- a/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html +++ b/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html @@ -24,7 +24,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -484,7 +484,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_.html b/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_.html index ecc42ef..25638f2 100644 --- a/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_.html +++ b/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -192,7 +192,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_37_.html b/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_37_.html index ecc42ef..da06f48 100644 --- a/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_37_.html +++ b/tests/test_issues_output/test_source_output_/test_html_output_generic_bases_37_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} diff --git a/tests/test_issues_output/test_source_output_/test_output_github_index_html_.html b/tests/test_issues_output/test_source_output_/test_output_github_index_html_.html index 087b864..4770463 100644 --- a/tests/test_issues_output/test_source_output_/test_output_github_index_html_.html +++ b/tests/test_issues_output/test_source_output_/test_output_github_index_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -112,7 +112,9 @@

.

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output.py b/tests/test_output/test_output.py index 566fd30..7294569 100644 --- a/tests/test_output/test_output.py +++ b/tests/test_output/test_output.py @@ -197,6 +197,7 @@ def test_html_output( raise exception +@pytest.mark.skipif(sphinx.version_info >= (8, 1), reason="Currently failing on Sphinx 8.1") @pytest.mark.usefixtures("pre_commit_hooks") def test_sidebar_links_output( testing_app: Sphinx, diff --git a/tests/test_output/test_output_/test_html_output_assets_html_.html b/tests/test_output/test_output_/test_html_output_assets_html_.html index 6cdeb21..042ee61 100644 --- a/tests/test_output/test_output_/test_html_output_assets_html_.html +++ b/tests/test_output/test_output_/test_html_output_assets_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -61,7 +61,9 @@

missing.txt

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_augment_defaults_html_.html b/tests/test_output/test_output_/test_html_output_augment_defaults_html_.html index 6540a88..129e029 100644 --- a/tests/test_output/test_output_/test_html_output_augment_defaults_html_.html +++ b/tests/test_output/test_output_/test_html_output_augment_defaults_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -133,7 +133,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_autodoc_ellipsis_html_.html b/tests/test_output/test_output_/test_html_output_autodoc_ellipsis_html_.html index d14867e..6e11ecb 100644 --- a/tests/test_output/test_output_/test_html_output_autodoc_ellipsis_html_.html +++ b/tests/test_output/test_output_/test_html_output_autodoc_ellipsis_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -231,7 +231,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_autonamedtuple_3_10_.html b/tests/test_output/test_output_/test_html_output_autonamedtuple_3_10_.html index 27660a0..e275d7c 100644 --- a/tests/test_output/test_output_/test_html_output_autonamedtuple_3_10_.html +++ b/tests/test_output/test_output_/test_html_output_autonamedtuple_3_10_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -943,7 +943,9 @@

attribute.

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html b/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html index 53ab698..4ddb569 100644 --- a/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html +++ b/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -943,7 +943,9 @@

attribute.

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_autonamedtuple_pep563_.html b/tests/test_output/test_output_/test_html_output_autonamedtuple_pep563_.html index 21ff1ae..b39f2e4 100644 --- a/tests/test_output/test_output_/test_html_output_autonamedtuple_pep563_.html +++ b/tests/test_output/test_output_/test_html_output_autonamedtuple_pep563_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -141,7 +141,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html b/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html index b1a9d5a..c1aa35e 100644 --- a/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html +++ b/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -524,7 +524,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_autotypeddict_html_.html b/tests/test_output/test_output_/test_html_output_autotypeddict_html_.html index 6dc58c1..8ae66de 100644 --- a/tests/test_output/test_output_/test_html_output_autotypeddict_html_.html +++ b/tests/test_output/test_output_/test_html_output_autotypeddict_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -597,7 +597,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_changeset_html_.html b/tests/test_output/test_output_/test_html_output_changeset_html_.html index 951fa84..0212447 100644 --- a/tests/test_output/test_output_/test_html_output_changeset_html_.html +++ b/tests/test_output/test_output_/test_html_output_changeset_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -175,7 +175,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_code_block_html_.html b/tests/test_output/test_output_/test_html_output_code_block_html_.html index f4fc434..7d6de70 100644 --- a/tests/test_output/test_output_/test_html_output_code_block_html_.html +++ b/tests/test_output/test_output_/test_html_output_code_block_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -136,7 +136,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_collapse_html_.html b/tests/test_output/test_output_/test_html_output_collapse_html_.html index 1115e1a..cdafe3e 100644 --- a/tests/test_output/test_output_/test_html_output_collapse_html_.html +++ b/tests/test_output/test_output_/test_html_output_collapse_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -64,7 +64,9 @@

The text should be visible when the page loads.

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_confval_html_.html b/tests/test_output/test_output_/test_html_output_confval_html_.html index 1e8dbc4..6ed5538 100644 --- a/tests/test_output/test_output_/test_html_output_confval_html_.html +++ b/tests/test_output/test_output_/test_html_output_confval_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -270,7 +270,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_decorators_html_.html b/tests/test_output/test_output_/test_html_output_decorators_html_.html index f12597b..fa9ec2f 100644 --- a/tests/test_output/test_output_/test_html_output_decorators_html_.html +++ b/tests/test_output/test_output_/test_html_output_decorators_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -87,7 +87,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_documentation_summary_html_.html b/tests/test_output/test_output_/test_html_output_documentation_summary_html_.html index 99365af..0e6ad80 100644 --- a/tests/test_output/test_output_/test_html_output_documentation_summary_html_.html +++ b/tests/test_output/test_output_/test_html_output_documentation_summary_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -49,7 +49,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_documentation_summary_meta_html_.html b/tests/test_output/test_output_/test_html_output_documentation_summary_meta_html_.html index 59d37e4..0b97603 100644 --- a/tests/test_output/test_output_/test_html_output_documentation_summary_meta_html_.html +++ b/tests/test_output/test_output_/test_html_output_documentation_summary_meta_html_.html @@ -22,7 +22,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -52,7 +52,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_example_html_.html b/tests/test_output/test_output_/test_html_output_example_html_.html index e8998a7..02a29a0 100644 --- a/tests/test_output/test_output_/test_html_output_example_html_.html +++ b/tests/test_output/test_output_/test_html_output_example_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -62,7 +62,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_flake8_html_.html b/tests/test_output/test_output_/test_html_output_flake8_html_.html index bb4a2bd..4061643 100644 --- a/tests/test_output/test_output_/test_html_output_flake8_html_.html +++ b/tests/test_output/test_output_/test_html_output_flake8_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -116,7 +116,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_footnote_symbols_html_.html b/tests/test_output/test_output_/test_html_output_footnote_symbols_html_.html index 3fd3568..9d87bcd 100644 --- a/tests/test_output/test_output_/test_html_output_footnote_symbols_html_.html +++ b/tests/test_output/test_output_/test_html_output_footnote_symbols_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -103,7 +103,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_formatting_html_.html b/tests/test_output/test_output_/test_html_output_formatting_html_.html index fb6ae69..e7c9db4 100644 --- a/tests/test_output/test_output_/test_html_output_formatting_html_.html +++ b/tests/test_output/test_output_/test_html_output_formatting_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -64,7 +64,9 @@

Other Extensions

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_generic_bases_.html b/tests/test_output/test_output_/test_html_output_generic_bases_.html index a5c5813..d842a06 100644 --- a/tests/test_output/test_output_/test_html_output_generic_bases_.html +++ b/tests/test_output/test_output_/test_html_output_generic_bases_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -310,7 +310,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_genericalias_.html b/tests/test_output/test_output_/test_html_output_genericalias_.html index ff48c20..d943938 100644 --- a/tests/test_output/test_output_/test_html_output_genericalias_.html +++ b/tests/test_output/test_output_/test_html_output_genericalias_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -97,7 +97,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_github_html_.html b/tests/test_output/test_output_/test_html_output_github_html_.html index e887f74..866da40 100644 --- a/tests/test_output/test_output_/test_html_output_github_html_.html +++ b/tests/test_output/test_output_/test_html_output_github_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -150,7 +150,9 @@

.

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_installation_html_.html b/tests/test_output/test_output_/test_html_output_installation_html_.html index d85d372..3884fa7 100644 --- a/tests/test_output/test_output_/test_html_output_installation_html_.html +++ b/tests/test_output/test_output_/test_html_output_installation_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %}{% if sphinx_version >= (3, 5) %} @@ -782,7 +782,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_instancevar_html_.html b/tests/test_output/test_output_/test_html_output_instancevar_html_.html index 0f64e0c..6a2f777 100644 --- a/tests/test_output/test_output_/test_html_output_instancevar_html_.html +++ b/tests/test_output/test_output_/test_html_output_instancevar_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -187,7 +187,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_latex_html_.html b/tests/test_output/test_output_/test_html_output_latex_html_.html index 69b47d8..cd41ca5 100644 --- a/tests/test_output/test_output_/test_html_output_latex_html_.html +++ b/tests/test_output/test_output_/test_html_output_latex_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -404,7 +404,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_no_docstring_html_.html b/tests/test_output/test_output_/test_html_output_no_docstring_html_.html index b6294f4..a6cfdd0 100644 --- a/tests/test_output/test_output_/test_html_output_no_docstring_html_.html +++ b/tests/test_output/test_output_/test_html_output_no_docstring_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -388,7 +388,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_overloads_html_.html b/tests/test_output/test_output_/test_html_output_overloads_html_.html index 4e5b985..255e148 100644 --- a/tests/test_output/test_output_/test_html_output_overloads_html_.html +++ b/tests/test_output/test_output_/test_html_output_overloads_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -1124,7 +1124,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_pre_commit_html_.html b/tests/test_output/test_output_/test_html_output_pre_commit_html_.html index 301765a..f44bfa7 100644 --- a/tests/test_output/test_output_/test_html_output_pre_commit_html_.html +++ b/tests/test_output/test_output_/test_html_output_pre_commit_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -100,7 +100,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_regex_html_.html b/tests/test_output/test_output_/test_html_output_regex_html_.html index 589633a..e1ad45b 100644 --- a/tests/test_output/test_output_/test_html_output_regex_html_.html +++ b/tests/test_output/test_output_/test_html_output_regex_html_.html @@ -22,7 +22,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -2114,7 +2114,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_shields_html_.html b/tests/test_output/test_output_/test_html_output_shields_html_.html index e3fc65e..320d14e 100644 --- a/tests/test_output/test_output_/test_html_output_shields_html_.html +++ b/tests/test_output/test_output_/test_html_output_shields_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -127,7 +127,9 @@

https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white - + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_sourcelink_html_.html b/tests/test_output/test_output_/test_html_output_sourcelink_html_.html index c5f2836..d0c4cda 100644 --- a/tests/test_output/test_output_/test_html_output_sourcelink_html_.html +++ b/tests/test_output/test_output_/test_html_output_sourcelink_html_.html @@ -24,7 +24,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -696,7 +696,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_typevars_html_.html b/tests/test_output/test_output_/test_html_output_typevars_html_.html index b4d7818..5e30cfa 100644 --- a/tests/test_output/test_output_/test_html_output_typevars_html_.html +++ b/tests/test_output/test_output_/test_html_output_typevars_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -516,7 +516,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_variables_html_.html b/tests/test_output/test_output_/test_html_output_variables_html_.html index d7421a0..fcd1af2 100644 --- a/tests/test_output/test_output_/test_html_output_variables_html_.html +++ b/tests/test_output/test_output_/test_html_output_variables_html_.html @@ -23,7 +23,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -403,7 +403,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_html_output_wikipedia_html_.html b/tests/test_output/test_output_/test_html_output_wikipedia_html_.html index ad3f8df..c21e0bd 100644 --- a/tests/test_output/test_output_/test_html_output_wikipedia_html_.html +++ b/tests/test_output/test_output_/test_html_output_wikipedia_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -60,7 +60,9 @@

Answer to the Ultimate Question of Life, the Universe, and Everything

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_output/test_output_/test_latex_output.tex b/tests/test_output/test_output_/test_latex_output.tex index 3cf1db3..05dc582 100644 --- a/tests/test_output/test_output_/test_latex_output.tex +++ b/tests/test_output/test_output_/test_latex_output.tex @@ -12,7 +12,20 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> - +<%- set sphinx81_linebreak = " +" if sphinx_version >= (8, 1) else "" -%> +<%- macro versionadded(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} +<%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> +<%- endmacro -%> +<%- macro versionremoved(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{removed}{Removed in version <>: }} +<%- else %>\DUrole{versionmodified,removed}{Removed in version <>: } +<%- endif %><%- endmacro -%> +<%- macro versionchanged(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{changed}{Changed in version <>: }} +<%- else %>\DUrole{versionmodified,changed}{Changed in version <>: } +<%- endif %><%- endmacro -%> %% Generated by Sphinx. \def\sphinxdocclass{report} \documentclass[letterpaper,10pt,english]{sphinxmanual} @@ -512,7 +525,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -537,7 +550,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -556,7 +569,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -579,7 +592,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -601,7 +614,7 @@ \chapter{Confval} <% if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -625,7 +638,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-25px} @@ -960,14 +973,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:param \textless{}name\textgreater{}: \textless{}docstring\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0") >> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1001,14 +1014,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:type \textless{}name\textgreater{}: \textless{}type\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0") >> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1044,7 +1057,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1079,7 +1092,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1120,7 +1133,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1160,7 +1173,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1195,7 +1208,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1230,7 +1243,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1265,7 +1278,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1342,14 +1355,14 @@ \chapter{Changeset} \section{Removed} \label{\detokenize{changeset:removed}} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. +<< versionremoved("1.2.3")>>Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Due to an unfixable bug this function has been removed. +<< versionremoved("1.2.3")>>Due to an unfixable bug this function has been removed. If you desperately need this functionality please write to the mailing list at \sphinxhref{mailto:python-users@example.org}{python\sphinxhyphen{}users@example.org} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }\begin{itemize} +<< versionremoved("1.2.3")>>\begin{itemize} \item {} Removed \sphinxcode{\sphinxupquote{mozarella}} @@ -1361,10 +1374,10 @@ \section{Removed} \section{Changed} \label{\detokenize{changeset:changed}} -\DUrole{versionmodified,changed}{Changed in version 1.2.3: }Moved from \sphinxcode{\sphinxupquote{mozarella}} +<< versionchanged("1.2.3") >>Moved from \sphinxcode{\sphinxupquote{mozarella}} -\DUrole{versionmodified,changed}{Changed in version 0.3.0: }\begin{itemize} +<< versionchanged("0.3.0") >>\begin{itemize} \item {} Parameters for \sphinxcode{\sphinxupquote{\_\_init\_\_}} can be documented either in the class docstring or alongside the attribute. @@ -1381,7 +1394,7 @@ \section{Changed} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{foo}}}{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}{}<< tilde >> +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{foo}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}<< sphinx81_linebreak >>{}<< tilde >> <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif -%> diff --git a/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex b/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex index 7c2bd96..cafb69f 100644 --- a/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex +++ b/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex @@ -12,7 +12,20 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> - +<%- set sphinx81_linebreak = " +" if sphinx_version >= (8, 1) else "" -%> +<%- macro versionadded(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} +<%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> +<%- endmacro -%> +<%- macro versionremoved(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{removed}{Removed in version <>: }} +<%- else %>\DUrole{versionmodified,removed}{Removed in version <>: } +<%- endif %><%- endmacro -%> +<%- macro versionchanged(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{changed}{Changed in version <>: }} +<%- else %>\DUrole{versionmodified,changed}{Changed in version <>: } +<%- endif %><%- endmacro -%> %% Generated by Sphinx. \def\sphinxdocclass{report} \documentclass[letterpaper,10pt,english]{sphinxmanual} @@ -512,7 +525,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -537,7 +550,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -556,7 +569,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -579,7 +592,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -601,7 +614,7 @@ \chapter{Confval} <% if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -625,7 +638,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-25px} @@ -960,14 +973,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:param \textless{}name\textgreater{}: \textless{}docstring\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0") >> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1001,14 +1014,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:type \textless{}name\textgreater{}: \textless{}type\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0") >> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1044,7 +1057,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1079,7 +1092,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1120,7 +1133,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1160,7 +1173,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1195,7 +1208,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1230,7 +1243,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1265,7 +1278,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1342,14 +1355,14 @@ \chapter{Changeset} \section{Removed} \label{\detokenize{changeset:removed}} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. +<< versionremoved("1.2.3")>>Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Due to an unfixable bug this function has been removed. +<< versionremoved("1.2.3")>>Due to an unfixable bug this function has been removed. If you desperately need this functionality please write to the mailing list at \sphinxhref{mailto:python-users@example.org}{python\sphinxhyphen{}users@example.org} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }\begin{itemize} +<< versionremoved("1.2.3")>>\begin{itemize} \item {} Removed \sphinxcode{\sphinxupquote{mozarella}} @@ -1361,10 +1374,10 @@ \section{Removed} \section{Changed} \label{\detokenize{changeset:changed}} -\DUrole{versionmodified,changed}{Changed in version 1.2.3: }Moved from \sphinxcode{\sphinxupquote{mozarella}} +<< versionchanged("1.2.3") >>Moved from \sphinxcode{\sphinxupquote{mozarella}} -\DUrole{versionmodified,changed}{Changed in version 0.3.0: }\begin{itemize} +<< versionchanged("0.3.0") >>\begin{itemize} \item {} Parameters for \sphinxcode{\sphinxupquote{\_\_init\_\_}} can be documented either in the class docstring or alongside the attribute. @@ -1381,7 +1394,7 @@ \section{Changed} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{foo}}}{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}{}<< tilde >> +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{foo}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}<< sphinx81_linebreak >>{}<< tilde >> <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif -%> diff --git a/tests/test_output/test_output_/test_latex_output_better_header_layout.tex b/tests/test_output/test_output_/test_latex_output_better_header_layout.tex index 0d3387d..bbe67a5 100644 --- a/tests/test_output/test_output_/test_latex_output_better_header_layout.tex +++ b/tests/test_output/test_output_/test_latex_output_better_header_layout.tex @@ -12,7 +12,20 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> - +<%- set sphinx81_linebreak = " +" if sphinx_version >= (8, 1) else "" -%> +<%- macro versionadded(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} +<%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> +<%- endmacro -%> +<%- macro versionremoved(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{removed}{Removed in version <>: }} +<%- else %>\DUrole{versionmodified,removed}{Removed in version <>: } +<%- endif %><%- endmacro -%> +<%- macro versionchanged(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{changed}{Changed in version <>: }} +<%- else %>\DUrole{versionmodified,changed}{Changed in version <>: } +<%- endif %><%- endmacro -%> %% Generated by Sphinx. \def\sphinxdocclass{report} \documentclass[letterpaper,10pt,english]{sphinxmanual} @@ -536,7 +549,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -561,7 +574,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -580,7 +593,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -603,7 +616,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -625,7 +638,7 @@ \chapter{Confval} <% if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -649,7 +662,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-25px} @@ -984,14 +997,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:param \textless{}name\textgreater{}: \textless{}docstring\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0")>> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1025,14 +1038,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:type \textless{}name\textgreater{}: \textless{}type\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0")>> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1068,7 +1081,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1103,7 +1116,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1144,7 +1157,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1184,7 +1197,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1219,7 +1232,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1254,7 +1267,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1289,7 +1302,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1366,14 +1379,14 @@ \chapter{Changeset} \section{Removed} \label{\detokenize{changeset:removed}} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. +<< versionremoved("1.2.3") >>Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Due to an unfixable bug this function has been removed. +<< versionremoved("1.2.3") >>Due to an unfixable bug this function has been removed. If you desperately need this functionality please write to the mailing list at \sphinxhref{mailto:python-users@example.org}{python\sphinxhyphen{}users@example.org} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }\begin{itemize} +<< versionremoved("1.2.3") >>\begin{itemize} \item {} Removed \sphinxcode{\sphinxupquote{mozarella}} @@ -1385,10 +1398,10 @@ \section{Removed} \section{Changed} \label{\detokenize{changeset:changed}} -\DUrole{versionmodified,changed}{Changed in version 1.2.3: }Moved from \sphinxcode{\sphinxupquote{mozarella}} +<< versionchanged("1.2.3") >>Moved from \sphinxcode{\sphinxupquote{mozarella}} -\DUrole{versionmodified,changed}{Changed in version 0.3.0: }\begin{itemize} +<< versionchanged("0.3.0") >>\begin{itemize} \item {} Parameters for \sphinxcode{\sphinxupquote{\_\_init\_\_}} can be documented either in the class docstring or alongside the attribute. @@ -1405,7 +1418,7 @@ \section{Changed} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{foo}}}{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}{}<< tilde >> +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{foo}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}<< sphinx81_linebreak >>{}<< tilde >> <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif -%> diff --git a/tests/test_output/test_output_/test_latex_output_latex_layout.tex b/tests/test_output/test_output_/test_latex_output_latex_layout.tex index a16548e..ef7b0b4 100644 --- a/tests/test_output/test_output_/test_latex_output_latex_layout.tex +++ b/tests/test_output/test_output_/test_latex_output_latex_layout.tex @@ -12,7 +12,20 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> - +<%- set sphinx81_linebreak = " +" if sphinx_version >= (8, 1) else "" -%> +<%- macro versionadded(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} +<%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> +<%- endmacro -%> +<%- macro versionremoved(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{removed}{Removed in version <>: }} +<%- else %>\DUrole{versionmodified,removed}{Removed in version <>: } +<%- endif %><%- endmacro -%> +<%- macro versionchanged(v) -%> +<%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{changed}{Changed in version <>: }} +<%- else %>\DUrole{versionmodified,changed}{Changed in version <>: } +<%- endif %><%- endmacro -%> %% Generated by Sphinx. \def\sphinxdocclass{report} \documentclass[letterpaper,10pt,english]{sphinxmanual} @@ -514,7 +527,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{source\_link\_target}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -541,7 +554,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_username}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -562,7 +575,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -587,7 +600,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{conda\_channels}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -611,7 +624,7 @@ \chapter{Confval} <% if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{github\_repository}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-45px} @@ -637,7 +650,7 @@ \chapter{Confval} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> +\pysigline<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{something}}}<< tilde >> <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \vspace{-25px} @@ -974,14 +987,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{untyped\_param\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:param \textless{}name\textgreater{}: \textless{}docstring\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0") >> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1017,14 +1030,14 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{sphinx\_toolbox.utils.}}\sphinxbfcode{\sphinxupquote{typed\_flag\_regex}}} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> \sphinxstylestrong{Type:}Β Β Β Β \sphinxhref{https://docs.python.org/3/library/typing.html\#typing.Pattern}{\sphinxcode{\sphinxupquote{Pattern}}}{[}\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxcode{\sphinxupquote{str}}}{]} Regex to match \sphinxcode{\sphinxupquote{:type \textless{}name\textgreater{}: \textless{}type\textgreater{}}} flags. -\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version 0.8.0.} +<< versionadded("0.8.0") >> \begin{savenotes}\sphinxattablestart<% if sphinx_version >= (5, 3) %> @@ -1062,7 +1075,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{no\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1099,7 +1112,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{one\_flag}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1142,7 +1155,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{two\_flags}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1184,7 +1197,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{backticks}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1221,7 +1234,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{leading\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1258,7 +1271,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{trailing\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1295,7 +1308,7 @@ \chapter{sphinx\sphinxhyphen{}toolbox Demo \sphinxhyphen{} Regex} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysigline{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} +\pysigline<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{tests.regex\_demo.}}\sphinxbfcode{\sphinxupquote{single\_whitespace}}} <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif %> @@ -1372,14 +1385,14 @@ \chapter{Changeset} \section{Removed} \label{\detokenize{changeset:removed}} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. +<< versionremoved("1.2.3") >>Use {\hyperref[\detokenize{index:foo}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{foo()}}}}} instead. -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }Due to an unfixable bug this function has been removed. +<< versionremoved("1.2.3") >>Due to an unfixable bug this function has been removed. If you desperately need this functionality please write to the mailing list at \sphinxhref{mailto:python-users@example.org}{python\sphinxhyphen{}users@example.org} -\DUrole{versionmodified,removed}{Removed in version 1.2.3: }\begin{itemize} +<< versionremoved("1.2.3") >>\begin{itemize} \item {} Removed \sphinxcode{\sphinxupquote{mozarella}} @@ -1391,10 +1404,10 @@ \section{Removed} \section{Changed} \label{\detokenize{changeset:changed}} -\DUrole{versionmodified,changed}{Changed in version 1.2.3: }Moved from \sphinxcode{\sphinxupquote{mozarella}} +<< versionchanged("1.2.3") >>Moved from \sphinxcode{\sphinxupquote{mozarella}} -\DUrole{versionmodified,changed}{Changed in version 0.3.0: }\begin{itemize} +<< versionchanged("0.3.0") >>\begin{itemize} \item {} Parameters for \sphinxcode{\sphinxupquote{\_\_init\_\_}} can be documented either in the class docstring or alongside the attribute. @@ -1413,7 +1426,7 @@ \section{Changed} <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{foo}}}{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}{}<< tilde >> +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{foo}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< du_role_2nd_n >>}{bar}}<>{\DUrole{n<< du_role_2nd_n >>}{baz}}}<< sphinx81_linebreak >>{}<< tilde >> <%- if sphinx_version > (4, 5) %> \pysigstopsignatures <%- endif -%> diff --git a/tests/test_output/test_output_/test_sidebar_links_output.html b/tests/test_output/test_output_/test_sidebar_links_output.html index eb16bd8..d3796e8 100644 --- a/tests/test_output/test_output_/test_sidebar_links_output.html +++ b/tests/test_output/test_output_/test_sidebar_links_output.html @@ -22,7 +22,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -503,7 +503,9 @@

document.getElementById('searchbox').style.display = "block"{% else %} $('#searchbox').show(0);{% endif %} - + {% if sphinx_version >= (8, 1) %} +
+
{% endif %}
diff --git a/tests/test_source_output_github/test_source_output_/test_output_github_index_html_.html b/tests/test_source_output_github/test_source_output_/test_output_github_index_html_.html index 745a986..628545b 100644 --- a/tests/test_source_output_github/test_source_output_/test_output_github_index_html_.html +++ b/tests/test_source_output_github/test_source_output_/test_output_github_index_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -51,7 +51,9 @@

source code

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tests/test_source_output_sphinx/test_source_output_/test_output_sphinx_index_html_.html b/tests/test_source_output_sphinx/test_source_output_/test_output_sphinx_index_html_.html index 32c5b6f..2ddf2de 100644 --- a/tests/test_source_output_sphinx/test_source_output_/test_output_sphinx_index_html_.html +++ b/tests/test_source_output_sphinx/test_source_output_/test_output_sphinx_index_html_.html @@ -21,7 +21,7 @@ {% if sphinx_version >= (5, 0) %} {% endif %}{% endif %} - {% if sphinx_version >= (5, 2) %} {% endif %} @@ -69,7 +69,9 @@

- + {% if sphinx_version >= (8, 1) %} +
+
{% endif %} diff --git a/tox.ini b/tox.ini index 4eb46dd..15901c3 100644 --- a/tox.ini +++ b/tox.ini @@ -324,6 +324,16 @@ commands = python --version python -m pytest --cov=sphinx_toolbox -r aR tests/ {posargs} +[testenv:py{310,311,312,313-dev}-sphinx8.1] +deps = + -r{toxinidir}/tests/requirements.txt + -r{toxinidir}/requirements.txt +commands = + pip install sphinx==8.1.3 + pip install pygments>=2.7.4,<=2.13.0 + python --version + python -m pytest --cov=sphinx_toolbox -r aR tests/ {posargs} + [pytest] addopts = --color yes --durations 25 timeout = 600 From 174da640733d8b3870a9f4a3629deebd44249a26 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 25 Feb 2025 14:39:44 +0000 Subject: [PATCH 07/33] Actually test on Sphinx 8.2 --- sphinx_toolbox/testing.py | 2 + tests/common.py | 19 ++++++--- .../test_latex_output.tex | 31 ++++++-------- .../test_html_output_autoprotocol_html_.html | 2 +- tests/test_more_autodoc/test_overloads.py | 9 ++-- tests/test_more_autosummary.py | 6 +-- .../test_html_output_autoprotocol_html_.html | 2 +- .../test_output_/test_latex_output.tex | 41 +++++++++++++++---- ...test_latex_output_autosummary_col_type.tex | 37 +++++++++++++++-- ...test_latex_output_better_header_layout.tex | 37 +++++++++++++++-- .../test_latex_output_latex_layout.tex | 37 +++++++++++++++-- tests/test_testing.py | 4 +- tox.ini | 10 +++++ 13 files changed, 184 insertions(+), 53 deletions(-) diff --git a/sphinx_toolbox/testing.py b/sphinx_toolbox/testing.py index 709163f..2eaeb20 100644 --- a/sphinx_toolbox/testing.py +++ b/sphinx_toolbox/testing.py @@ -753,6 +753,8 @@ def test_page(page: BeautifulSoup, html_regression: HTMLRegressionFixture): div.extract() if sphinx.version_info >= (4, 3): # pragma: no cover + for div in page.select("dt.sig em.property span.k"): + div.replace_with_children() for div in page.select("span.w"): div.extract() for div in page.select("span.p"): diff --git a/tests/common.py b/tests/common.py index b4db542..0a139e6 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,5 +1,6 @@ # stdlib from http import HTTPStatus +from types import SimpleNamespace from typing import Any, Dict, NamedTuple, Sequence, Tuple # 3rd party @@ -30,10 +31,18 @@ class AppParams(NamedTuple): def get_app_config_values(config: Any) -> Tuple[str, str, Any]: if sphinx.version_info >= (7, 3): - # valid_types = valid_types = config.valid_types - if isinstance(valid_types, (set, frozenset)): - valid_types = list(valid_types) - return (config.default, config.rebuild, valid_types) + default = config.default + rebuild = config.rebuild else: - return config + default, rebuild, valid_types = config + + if isinstance(valid_types, (set, frozenset, tuple, list)): + valid_types = sorted(valid_types) + + if hasattr(valid_types, "_candidates"): + new_valid_types = SimpleNamespace() + new_valid_types.candidates = sorted(valid_types._candidates) + valid_types = new_valid_types + + return (default, rebuild, valid_types) diff --git a/tests/test_autosummary_widths_/test_latex_output.tex b/tests/test_autosummary_widths_/test_latex_output.tex index f8e7c7c..0dbfcb0 100644 --- a/tests/test_autosummary_widths_/test_latex_output.tex +++ b/tests/test_autosummary_widths_/test_latex_output.tex @@ -260,7 +260,7 @@ \pysigstartsignatures <% endif -%> \pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxbfcode{\sphinxupquote{class<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{Template}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<>}{template}}}<< sphinx81_linebreak >>{} +<% endif %>{\sphinxbfcode{\sphinxupquote{<% if sphinx_version >= (8, 2) %>\DUrole{k}{class}<% else %>class<% endif %><% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{Template}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<>}{template}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> A string class for supporting \$\sphinxhyphen{}substitutions. @@ -274,8 +274,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{capwords}}}<< sphinx81_linebreak >>{\<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<< sphinx6x_2nd('n') >>}{s}}<% else %>s}<% endif %>\sphinxoptional{<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<>}{sep}}<% else %>sep}<% endif %>}}<< sphinx81_linebreak >>{{ +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{string.}}\sphinxbfcode{\sphinxupquote{capwords}}}<< sphinx81_linebreak >>{\<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<< sphinx6x_2nd('n') >>}{s}}<% else %>s}<% endif %>\sphinxoptional{<>{<% if sphinx_version >= (4, 3)%>\DUrole{n<>}{sep}}<% else %>sep}<% endif %>}}<< sphinx81_linebreak >>{{ <%- if sphinx_version >= (4, 4) %> $\rightarrow$ string}} <%- else %> $\rightarrow$ {\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}} <%- endif -%> @@ -427,7 +426,10 @@ \pysigstartsignatures <% endif -%> \pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxbfcode{\sphinxupquote{class<% if sphinx_version >= (4, 3) %>\DUrole{w<< sphinx6x_2nd('w') >>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>}}\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{TextWrapper}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{initial\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{subsequent\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{expand\_tabs}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{replace\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{fix\_sentence\_endings}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{False}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_long\_words}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{drop\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_on\_hyphens}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{tabsize}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{8}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{*}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{max\_lines}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{placeholder}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{} {[}...{]}\textquotesingle{}}}}<< sphinx81_linebreak >>{} +<% endif %>{\sphinxbfcode{\sphinxupquote{<% if sphinx_version >= (8, 2) %>\DUrole{k}{class}<% else %>class<% endif %><% if sphinx_version >= (4, 3) %>\DUrole{w<< sphinx6x_2nd('w') >>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif -%>}}\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{TextWrapper}}} +<<- sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{initial\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{subsequent\_indent}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{}\textquotesingle{}}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{expand\_tabs}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{replace\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{fix\_sentence\_endings}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{False}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_long\_words}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{drop\_whitespace}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{break\_on\_hyphens}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{True}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{tabsize}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{8}}<>{ +<%- if sphinx_version >= (8, 2) %>\DUrole{keyword-only-separator}<% endif %> +<%- if sphinx_version >= (8, 2) %>{<% endif %>\DUrole{o<< sphinx6x_2nd('o') >>}{<% if sphinx_version >= (8, 2) %>\sphinxstyleabbreviation{*} (Keyword\sphinxhyphen{}only parameters separator (PEP 3102))}<% else %>*<% endif %>}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{max\_lines}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{placeholder}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{\textquotesingle{} {[}...{]}\textquotesingle{}}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Object for wrapping/filling text. The public interface consists of @@ -556,8 +558,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxbfcode{\sphinxupquote{fill}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<< sphinx6x_2nd('p') >>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{fill}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<< sphinx6x_2nd('p') >>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ <%- if sphinx_version >= (4, 4) %>string}}}<< sphinx81_linebreak >>{{ $\rightarrow$ string}} <%- else %>{\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}}}{{ $\rightarrow$ {\hyperref[\detokenize{index:module-string}]{\sphinxcrossref{string}}}}} <%- endif %> @@ -577,8 +578,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxbfcode{\sphinxupquote{wrap}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxbfcode{\sphinxupquote{wrap}}}<< sphinx81_linebreak >>{\<< sphinxparam >>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}\DUrole{p<>}{:}<% if sphinx_version >= (4, 3) %>\DUrole{w<>}{<% if sphinx_version < (7, 2) %> <% endif %> }<% else %> <% endif %>\DUrole{n<>}{ <%- if sphinx_version >= (4, 4) -%> string}}}<< sphinx81_linebreak >>{{ $\rightarrow$ \DUrole{p<>}{{[}}string\DUrole{p<>}{{]}}}} <%- else -%> @@ -605,8 +605,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{dedent}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}}<< sphinx81_linebreak >>{} +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{dedent}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Remove any common leading whitespace from every line in \sphinxtitleref{text}. @@ -630,8 +629,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{fill}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{fill}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Fill a single paragraph of text, returning a new string. @@ -651,8 +649,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{indent}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{prefix}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{predicate}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}}<< sphinx81_linebreak >>{} +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{indent}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{prefix}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{predicate}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{None}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Adds <>prefix<> to the beginning of selected lines in β€˜text’. @@ -671,8 +668,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{shorten}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{shorten}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Collapse and truncate the given text to fit in the given width. @@ -697,8 +693,7 @@ <%- if sphinx_version > (4, 5) %> \pysigstartsignatures <% endif -%> -\pysiglinewithargsret<% if sphinx_version >= (8, 1) %> -<% endif %>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{wrap}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} +\pysiglinewithargsret<< sphinx81_linebreak >>{\sphinxcode{\sphinxupquote{textwrap.}}\sphinxbfcode{\sphinxupquote{wrap}}}<< sphinx81_linebreak >>{\<>{\DUrole{n<< sphinx6x_2nd('n') >>}{text}}<>{\DUrole{n<< sphinx6x_2nd('n') >>}{width}\DUrole{o<< sphinx6x_2nd('o') >>}{=}\DUrole{default_value}{70}}<>{\DUrole{o<< sphinx6x_2nd('o') >>}{**}\DUrole{n<< sphinx6x_2nd('n') >>}{kwargs}}}<< sphinx81_linebreak >>{} <% if sphinx_version > (4, 5) %>\pysigstopsignatures <% endif -%> Wrap a single paragraph of text, returning a list of wrapped lines. diff --git a/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html b/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html index 7bf20fc..9c631a5 100644 --- a/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html +++ b/tests/test_issues_output/test_source_output_/test_html_output_autoprotocol_html_.html @@ -445,7 +445,7 @@

- abstract + abstract{% if sphinx_version >= (8, 2) %}method{% endif %} <{{ sig_prename_tag }} class="sig-name descname"> __abs__ diff --git a/tests/test_more_autodoc/test_overloads.py b/tests/test_more_autodoc/test_overloads.py index e3a3632..33cf5fa 100644 --- a/tests/test_more_autodoc/test_overloads.py +++ b/tests/test_more_autodoc/test_overloads.py @@ -20,10 +20,11 @@ def test_setup(): assert app.registry.documenters["function"] == overloads.FunctionDocumenter assert app.registry.documenters["method"] == overloads.MethodDocumenter - assert get_app_config_values(app.config.values["overloads_location"])[:2] == ("signature", "env") + config_values = get_app_config_values(app.config.values["overloads_location"]) + assert config_values[:2] == ("signature", "env") - assert get_app_config_values(app.config.values["overloads_location"])[2].candidates == ( - "top", + assert sorted(config_values[2].candidates) == [ "bottom", "signature", - ) + "top", + ] diff --git a/tests/test_more_autosummary.py b/tests/test_more_autosummary.py index d280ba5..2f1e405 100644 --- a/tests/test_more_autosummary.py +++ b/tests/test_more_autosummary.py @@ -27,10 +27,10 @@ def test_setup(advanced_file_regression: AdvancedFileRegressionFixture): assert not roles assert not additional_nodes - assert get_app_config_values(app.config.values["autodocsumm_member_order"])[:2] == ( + config_values = get_app_config_values(app.config.values["autodocsumm_member_order"]) + assert config_values[:2] == ( "alphabetical", "env", ) - assert get_app_config_values(app.config.values["autodocsumm_member_order"] - )[2].candidates == ("alphabetic", "alphabetical", "bysource") + assert sorted(config_values[2].candidates) == ["alphabetic", "alphabetical", "bysource"] diff --git a/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html b/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html index c1aa35e..0c89f22 100644 --- a/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html +++ b/tests/test_output/test_output_/test_html_output_autoprotocol_html_.html @@ -482,7 +482,7 @@

- abstract + abstract{% if sphinx_version >= (8, 2) %}method{% endif %} <{{ sig_prename_tag }} class="sig-name descname"> __abs__ diff --git a/tests/test_output/test_output_/test_latex_output.tex b/tests/test_output/test_output_/test_latex_output.tex index 05dc582..3e2166e 100644 --- a/tests/test_output/test_output_/test_latex_output.tex +++ b/tests/test_output/test_output_/test_latex_output.tex @@ -12,8 +12,7 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> -<%- set sphinx81_linebreak = " -" if sphinx_version >= (8, 1) else "" -%> +<%- set sphinx81_linebreak = "\n" if sphinx_version >= (8, 1) else "" -%> <%- macro versionadded(v) -%> <%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} <%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> @@ -1424,7 +1423,33 @@ \section{Changed} -\begin{savenotes}<%- if sphinx_version > (4, 5) -%> +\begin{savenotes}<%- if sphinx_version > (8, 2) %> +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +\sphinxthistablewithnovlinesstyle +\makeatletter + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +\makeatother +\begin{longtable}{\X{1}{2}\X{1}{2}} +\sphinxtoprule +\endfirsthead + +\multicolumn{2}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}% +}\\ +\sphinxtoprule +\endhead + +\sphinxbottomrule +\multicolumn{2}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +<% elif sphinx_version > (4, 5) -%> \sphinxattablestart<% if sphinx_version >= (5, 3) %> \sphinxthistablewithglobalstyle \sphinxthistablewithnovlinesstyle<% endif %> @@ -1433,10 +1458,8 @@ \section{Changed} \sphinxtoprule \sphinxtableatstartofbodyhook<% else %> \hline -<%- endif %> -<%- else -%> -\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}} +<%- endif %><% else %>\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}} \hline \endfirsthead @@ -1469,7 +1492,11 @@ \section{Changed} Represents a movie. \\ <% if sphinx_version >= (5, 3) %>\sphinxbottomrule<% else %>\hline<% endif %> -<% if sphinx_version > (4, 5) -%> +<% if sphinx_version > (8, 2) -%> +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes}<% elif sphinx_version > (4, 5) -%> \end{tabulary} << par >> \sphinxattableend\end{savenotes} diff --git a/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex b/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex index cafb69f..3a466d5 100644 --- a/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex +++ b/tests/test_output/test_output_/test_latex_output_autosummary_col_type.tex @@ -12,8 +12,7 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> -<%- set sphinx81_linebreak = " -" if sphinx_version >= (8, 1) else "" -%> +<%- set sphinx81_linebreak = "\n" if sphinx_version >= (8, 1) else "" -%> <%- macro versionadded(v) -%> <%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} <%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> @@ -1424,7 +1423,33 @@ \section{Changed} -\begin{savenotes}<%- if sphinx_version > (4, 5) -%> +\begin{savenotes}<%- if sphinx_version > (8, 2) %> +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +\sphinxthistablewithnovlinesstyle +\makeatletter + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +\makeatother +\begin{longtable}{\Y{1}{2}\Y{1}{2}} +\sphinxtoprule +\endfirsthead + +\multicolumn{2}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}% +}\\ +\sphinxtoprule +\endhead + +\sphinxbottomrule +\multicolumn{2}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +<% elif sphinx_version > (4, 5) -%> \sphinxattablestart<% if sphinx_version >= (5, 3) %> \sphinxthistablewithglobalstyle \sphinxthistablewithnovlinesstyle<% endif %> @@ -1467,7 +1492,11 @@ \section{Changed} Represents a movie. \\ <% if sphinx_version >= (5, 3) %>\sphinxbottomrule<% else %>\hline<% endif %> -<% if sphinx_version > (4, 5) -%> +<% if sphinx_version > (8, 2) -%> +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes}<% elif sphinx_version > (4, 5) -%> \end{tabulary} << par >> \sphinxattableend\end{savenotes} diff --git a/tests/test_output/test_output_/test_latex_output_better_header_layout.tex b/tests/test_output/test_output_/test_latex_output_better_header_layout.tex index bbe67a5..53d475a 100644 --- a/tests/test_output/test_output_/test_latex_output_better_header_layout.tex +++ b/tests/test_output/test_output_/test_latex_output_better_header_layout.tex @@ -12,8 +12,7 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> -<%- set sphinx81_linebreak = " -" if sphinx_version >= (8, 1) else "" -%> +<%- set sphinx81_linebreak = "\n" if sphinx_version >= (8, 1) else "" -%> <%- macro versionadded(v) -%> <%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} <%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> @@ -1448,7 +1447,33 @@ \section{Changed} -\begin{savenotes}<%- if sphinx_version > (4, 5) -%> +\begin{savenotes}<%- if sphinx_version > (8, 2) %> +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +\sphinxthistablewithnovlinesstyle +\makeatletter + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +\makeatother +\begin{longtable}{\X{1}{2}\X{1}{2}} +\sphinxtoprule +\endfirsthead + +\multicolumn{2}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}% +}\\ +\sphinxtoprule +\endhead + +\sphinxbottomrule +\multicolumn{2}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +<% elif sphinx_version > (4, 5) -%> \sphinxattablestart<% if sphinx_version >= (5, 3) %> \sphinxthistablewithglobalstyle \sphinxthistablewithnovlinesstyle<% endif %> @@ -1491,7 +1516,11 @@ \section{Changed} Represents a movie. \\ <% if sphinx_version >= (5, 3) %>\sphinxbottomrule<% else %>\hline<% endif %> -<% if sphinx_version > (4, 5) -%> +<% if sphinx_version > (8, 2) -%> +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes}<% elif sphinx_version > (4, 5) -%> \end{tabulary} << par >> \sphinxattableend\end{savenotes} diff --git a/tests/test_output/test_output_/test_latex_output_latex_layout.tex b/tests/test_output/test_output_/test_latex_output_latex_layout.tex index ef7b0b4..6fe3cce 100644 --- a/tests/test_output/test_output_/test_latex_output_latex_layout.tex +++ b/tests/test_output/test_output_/test_latex_output_latex_layout.tex @@ -12,8 +12,7 @@ <%- set du_role_2nd_n = ",n" if (7, 2) > sphinx_version >= (6, 2) else "" -%> <# Latest Sphinx removed vertical rules from csv-table. Inconsequential for us #> <%- set regex_columns = "TT" if sphinx_version >= (6, 0) else "|T|T|" -%> -<%- set sphinx81_linebreak = " -" if sphinx_version >= (8, 1) else "" -%> +<%- set sphinx81_linebreak = "\n" if sphinx_version >= (8, 1) else "" -%> <%- macro versionadded(v) -%> <%- if sphinx_version >= (8, 1) %>\DUrole{versionmodified}{\DUrole{added}{Added in version <>.}} <%- else %>\DUrole{versionmodified,added}{<% if sphinx_version >= (7, 3) %>Added<% else %>New<% endif %> in version <>.}<% endif %> @@ -1456,7 +1455,33 @@ \section{Changed} -\begin{savenotes}<%- if sphinx_version > (4, 5) -%> +\begin{savenotes}<%- if sphinx_version > (8, 2) %> +\sphinxatlongtablestart +\sphinxthistablewithglobalstyle +\sphinxthistablewithnovlinesstyle +\makeatletter + \LTleft \@totalleftmargin plus1fill + \LTright\dimexpr\columnwidth-\@totalleftmargin-\linewidth\relax plus1fill +\makeatother +\begin{longtable}{\X{1}{2}\X{1}{2}} +\sphinxtoprule +\endfirsthead + +\multicolumn{2}{c}{\sphinxnorowcolor + \makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} \textendash{} continued from previous page}}% +}\\ +\sphinxtoprule +\endhead + +\sphinxbottomrule +\multicolumn{2}{r}{\sphinxnorowcolor + \makebox[0pt][r]{\sphinxtablecontinued{continues on next page}}% +}\\ +\endfoot + +\endlastfoot +\sphinxtableatstartofbodyhook +<% elif sphinx_version > (4, 5) -%> \sphinxattablestart<% if sphinx_version >= (5, 3) %> \sphinxthistablewithglobalstyle \sphinxthistablewithnovlinesstyle<% endif %> @@ -1499,7 +1524,11 @@ \section{Changed} Represents a movie. \\ <% if sphinx_version >= (5, 3) %>\sphinxbottomrule<% else %>\hline<% endif %> -<% if sphinx_version > (4, 5) -%> +<% if sphinx_version > (8, 2) -%> +\end{longtable} +\sphinxtableafterendhook +\sphinxatlongtableend +\end{savenotes}<% elif sphinx_version > (4, 5) -%> \end{tabulary} << par >> \sphinxattableend\end{savenotes} diff --git a/tests/test_testing.py b/tests/test_testing.py index 3674a39..b2c398e 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -134,8 +134,8 @@ def test_testing(): assert get_app_config_values(app.config.values["source_link_target"]) == ("Sphinx", "env", [str]) assert get_app_config_values(app.config.values["github_username"]) == (None, "env", [str]) - assert get_app_config_values(app.config.values["rebuild_true"]) == (None, "env", ()) - assert get_app_config_values(app.config.values["rebuild_false"]) == (None, '', ()) + assert get_app_config_values(app.config.values["rebuild_true"]) == (None, "env", []) + assert get_app_config_values(app.config.values["rebuild_false"]) == (None, '', []) assert app.events.events["my-event"] == '' assert app.registry.translators["my-translator"] is FakeNodeVisitor diff --git a/tox.ini b/tox.ini index 15901c3..54671f5 100644 --- a/tox.ini +++ b/tox.ini @@ -334,6 +334,16 @@ commands = python --version python -m pytest --cov=sphinx_toolbox -r aR tests/ {posargs} +[testenv:py{311,312,313-dev}-sphinx8.2] +deps = + -r{toxinidir}/tests/requirements.txt + -r{toxinidir}/requirements.txt +commands = + pip install sphinx==8.2.1 + pip install pygments>=2.7.4,<=2.13.0 + python --version + python -m pytest --cov=sphinx_toolbox -r aR tests/ {posargs} + [pytest] addopts = --color yes --durations 25 timeout = 600 From df31e9e1fc4efcedba45b3b199d74733d63e1c50 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 25 Feb 2025 15:02:37 +0000 Subject: [PATCH 08/33] Appease mypy re: create_documenter signature. --- sphinx_toolbox/more_autosummary/__init__.py | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sphinx_toolbox/more_autosummary/__init__.py b/sphinx_toolbox/more_autosummary/__init__.py index 8f9d21d..4799240 100644 --- a/sphinx_toolbox/more_autosummary/__init__.py +++ b/sphinx_toolbox/more_autosummary/__init__.py @@ -319,14 +319,14 @@ def import_by_name(self, name: str, prefixes: List[Optional[str]]) -> Tuple[str, if sphinx.version_info >= (8, 2): - def create_documenter( - self, - obj: Any, - parent: Any, - full_name: str, - *, - registry: Any = None, - ) -> Documenter: + def create_documenter( # type: ignore[override] + self, + obj: Any, + parent: Any, + full_name: str, + *, + registry: Any = None, + ) -> Documenter: """ Get an :class:`autodoc.Documenter` class suitable for documenting the given object. @@ -348,19 +348,19 @@ def create_documenter( """ # 3rd party - from sphinx.ext.autosummary import _get_documenter + from sphinx.ext.autosummary import _get_documenter # type: ignore[attr-defined] doccls = _get_documenter(obj, parent, registry=registry) return doccls(self.bridge, full_name) else: - def create_documenter( - self, - app: Sphinx, - obj: Any, - parent: Any, - full_name: str, - ) -> Documenter: + def create_documenter( # type: ignore[misc] + self, + app: Sphinx, + obj: Any, + parent: Any, + full_name: str, + ) -> Documenter: """ Get an :class:`autodoc.Documenter` class suitable for documenting the given object. From 67cf5a5bbb4d5a19b2bd78be797032f1079e7efe Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 25 Feb 2025 17:19:20 +0000 Subject: [PATCH 09/33] Fix TypedDictDocumenter with Sphinx 8.2 changes (members must be importable) --- sphinx_toolbox/more_autodoc/autotypeddict.py | 42 +++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/sphinx_toolbox/more_autodoc/autotypeddict.py b/sphinx_toolbox/more_autodoc/autotypeddict.py index b39c40c..12c0e54 100644 --- a/sphinx_toolbox/more_autodoc/autotypeddict.py +++ b/sphinx_toolbox/more_autodoc/autotypeddict.py @@ -320,7 +320,47 @@ def document_members(self, all_members: bool = False) -> None: Generate reST for member documentation. All members are always documented. """ - super().document_members(True) + if sphinx.version_info >= (8, 2): + # set current namespace for finding members + self._current_document.autodoc_module = self.modname + if self.objpath: + self._current_document.autodoc_class = self.objpath[0] + + # find out which members are documentable + members_check_module, members = self.get_object_members(True) + + # document non-skipped members + member_documenters: list[tuple[Documenter, bool]] = [] + for mname, member, isattr in self.filter_members(members, True): + classes = [ + cls for cls in self.documenters.values() + if cls.can_document_member(member, mname, isattr, self) + ] + if not classes: + # don't know how to document this member + continue + # prefer the documenter with the highest priority + classes.sort(key=lambda cls: cls.priority) + # give explicitly separated module name, so that members + # of inner classes can be documented + full_mname = f'{self.modname}::' + '.'.join((*self.objpath, mname)) + documenter = classes[-1](self.directive, full_mname, self.indent) + member_documenters.append((documenter, isattr)) + + member_order = self.options.member_order or self.config.autodoc_member_order + member_documenters = self.sort_members(member_documenters, member_order) + + for documenter, isattr in member_documenters: + documenter.generate( + all_members=True, + real_modname=self.real_modname, + check_module=members_check_module and not isattr, + ) + + if sphinx.version_info >= (8, 2): + # reset current objects + self._current_document.autodoc_module = '' + self._current_document.autodoc_class = '' def sort_members( self, From b7191e422e7d1706d0da60ee8db78f7dd96d9968 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 26 Feb 2025 08:42:46 +0000 Subject: [PATCH 10/33] Appease mypy --- sphinx_toolbox/more_autodoc/autotypeddict.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sphinx_toolbox/more_autodoc/autotypeddict.py b/sphinx_toolbox/more_autodoc/autotypeddict.py index 12c0e54..15696fa 100644 --- a/sphinx_toolbox/more_autodoc/autotypeddict.py +++ b/sphinx_toolbox/more_autodoc/autotypeddict.py @@ -322,15 +322,15 @@ def document_members(self, all_members: bool = False) -> None: if sphinx.version_info >= (8, 2): # set current namespace for finding members - self._current_document.autodoc_module = self.modname + self._current_document.autodoc_module = self.modname # type: ignore[attr-defined] if self.objpath: - self._current_document.autodoc_class = self.objpath[0] + self._current_document.autodoc_class = self.objpath[0] # type: ignore[attr-defined] # find out which members are documentable members_check_module, members = self.get_object_members(True) # document non-skipped members - member_documenters: list[tuple[Documenter, bool]] = [] + member_documenters: List[Tuple[Documenter, bool]] = [] for mname, member, isattr in self.filter_members(members, True): classes = [ cls for cls in self.documenters.values() @@ -359,8 +359,8 @@ def document_members(self, all_members: bool = False) -> None: if sphinx.version_info >= (8, 2): # reset current objects - self._current_document.autodoc_module = '' - self._current_document.autodoc_class = '' + self._current_document.autodoc_module = '' # type: ignore[attr-defined] + self._current_document.autodoc_class = '' # type: ignore[attr-defined] def sort_members( self, From f618c47c05a8b15425e8709160c937923c95d9c6 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 26 Feb 2025 11:14:11 +0000 Subject: [PATCH 11/33] Bump version v3.8.3 -> v3.9.0 --- .bumpversion.cfg | 2 +- .github/workflows/conda_ci.yml | 2 +- README.rst | 2 +- doc-source/index.rst | 2 +- pyproject.toml | 2 +- repo_helper.yml | 2 +- sphinx_toolbox/__init__.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2e2e8c9..ca0f91b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.8.3 +current_version = 3.9.0 commit = True tag = True diff --git a/.github/workflows/conda_ci.yml b/.github/workflows/conda_ci.yml index 73951cd..51d929c 100644 --- a/.github/workflows/conda_ci.yml +++ b/.github/workflows/conda_ci.yml @@ -58,7 +58,7 @@ jobs: - name: "Install package" run: | - $CONDA/bin/conda install -c file://$(pwd)/conda-bld sphinx-toolbox=3.8.3=py_1 -y || exit 1 + $CONDA/bin/conda install -c file://$(pwd)/conda-bld sphinx-toolbox=3.9.0=py_1 -y || exit 1 - name: "Run Tests" run: | diff --git a/README.rst b/README.rst index 40cf0d8..3432741 100644 --- a/README.rst +++ b/README.rst @@ -101,7 +101,7 @@ sphinx-toolbox .. |language| image:: https://img.shields.io/github/languages/top/sphinx-toolbox/sphinx-toolbox :alt: GitHub top language -.. |commits-since| image:: https://img.shields.io/github/commits-since/sphinx-toolbox/sphinx-toolbox/v3.8.3 +.. |commits-since| image:: https://img.shields.io/github/commits-since/sphinx-toolbox/sphinx-toolbox/v3.9.0 :target: https://github.com/sphinx-toolbox/sphinx-toolbox/pulse :alt: GitHub commits since tagged version diff --git a/doc-source/index.rst b/doc-source/index.rst index b6262be..c1c888c 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -107,7 +107,7 @@ sphinx-toolbox :alt: GitHub top language .. |commits-since| github-shield:: - :commits-since: v3.8.3 + :commits-since: v3.9.0 :alt: GitHub commits since tagged version .. |commits-latest| github-shield:: diff --git a/pyproject.toml b/pyproject.toml index 55643e2..b0eb6c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "whey" [project] name = "sphinx-toolbox" -version = "3.8.3" +version = "3.9.0" description = "Box of handy tools for Sphinx 🧰 πŸ“”" readme = "README.rst" keywords = [ "documentation", "sphinx", "sphinx-extension",] diff --git a/repo_helper.yml b/repo_helper.yml index d9e7bf3..a98e3f9 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -7,7 +7,7 @@ email: 'dominic@davis-foster.co.uk' username: 'sphinx-toolbox' assignee: 'domdfcoding' primary_conda_channel: 'domdfcoding' -version: '3.8.3' +version: '3.9.0' license: 'MIT' short_desc: 'Box of handy tools for Sphinx 🧰 πŸ“”' diff --git a/sphinx_toolbox/__init__.py b/sphinx_toolbox/__init__.py index 71460ec..1e0aace 100644 --- a/sphinx_toolbox/__init__.py +++ b/sphinx_toolbox/__init__.py @@ -57,7 +57,7 @@ __author__: str = "Dominic Davis-Foster" __copyright__: str = "2020 Dominic Davis-Foster" __license__: str = "MIT License" -__version__: str = "3.8.3" +__version__: str = "3.9.0" __email__: str = "dominic@davis-foster.co.uk" __all__ = ("setup", ) From 933390008c216baa88fe47c0c90dc61d2671eda6 Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:23:08 +0100 Subject: [PATCH 12/33] Run Flake8 CI on Ubuntu 22.04 (#182) Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com> --- .github/workflows/flake8.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 0a8c0c3..af1b394 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -16,7 +16,7 @@ permissions: jobs: Run: name: "Flake8" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - name: Checkout πŸ›ŽοΈ From ace3620757fe17b9590a6870901b7d2e4d576a76 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 16 Apr 2025 15:17:59 +0100 Subject: [PATCH 13/33] Actually run tests on newer Sphinx versions. --- repo_helper.yml | 5 +--- tests/test_output/test_output.py | 4 +++ ...test_html_output_autonamedtuple_html_.html | 10 +++---- .../test_html_output_overloads_html_.html | 28 +++++++++---------- tox.ini | 18 ------------ 5 files changed, 24 insertions(+), 41 deletions(-) diff --git a/repo_helper.yml b/repo_helper.yml index a98e3f9..bc541c9 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -152,10 +152,6 @@ extra_sphinx_extensions: - sphinx_toolbox.latex.succinct_seealso - sphinx_toolbox.more_autosummary.column_widths -tox_unmanaged: - - pytest - - testenv - sphinx_conf_epilogue: - html_logo = "../sphinx_toolbox.png" - toctree_plus_types.add("fixture") @@ -218,3 +214,4 @@ intersphinx_mapping: exclude_files: - contributing - doc_requirements + - tox diff --git a/tests/test_output/test_output.py b/tests/test_output/test_output.py index 7294569..cc6ec9e 100644 --- a/tests/test_output/test_output.py +++ b/tests/test_output/test_output.py @@ -234,6 +234,10 @@ def depart_caption(self, node: nodes.Node) -> None: page = remove_html_footer(page) page = remove_html_link_tags(page) + for div in page.select("div.related"): + if div["aria-label"] == "Related": + div.extract() + for div in page.select("script"): if "_static/language_data.js" in str(div): div.extract() diff --git a/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html b/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html index 4ddb569..9932b46 100644 --- a/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html +++ b/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html @@ -214,7 +214,7 @@

( - + int @@ -359,7 +359,7 @@

( - + int @@ -466,7 +466,7 @@

( - + int @@ -683,7 +683,7 @@

( - + int @@ -793,7 +793,7 @@

( - + int diff --git a/tests/test_output/test_output_/test_html_output_overloads_html_.html b/tests/test_output/test_output_/test_html_output_overloads_html_.html index 255e148..4317ba7 100644 --- a/tests/test_output/test_output_/test_html_output_overloads_html_.html +++ b/tests/test_output/test_output_/test_html_output_overloads_html_.html @@ -205,7 +205,7 @@

: - + int @@ -213,7 +213,7 @@

) -> - + str @@ -236,13 +236,13 @@

: - + slice - ) ->{% if python_version >= (3, 12) %} + ) ->{% if python_version >= (9, 9) %} List[str] @@ -257,7 +257,7 @@

[ - + str @@ -454,7 +454,7 @@

: - + int @@ -462,7 +462,7 @@

) -> - + str @@ -485,13 +485,13 @@

: - + slice - ) ->{% if python_version >= (3, 12) %} + ) ->{% if python_version >= (9, 9) %} List[str] @@ -506,7 +506,7 @@

[ - + str @@ -788,7 +788,7 @@

cls - :{% if python_version >= (3, 12) %} + :{% if python_version >= (9, 9) %} Type[object] @@ -833,7 +833,7 @@

= …, to_key - {% endif %}{% if python_version >= (3, 12) %} + {% endif %}{% if python_version >= (9, 9) %} @@ -890,7 +890,7 @@

= None, from_key - {% if python_version >= (3, 12) %} + {% if python_version >= (9, 9) %} : @@ -905,7 +905,7 @@

: - + str diff --git a/tox.ini b/tox.ini index 54671f5..646451a 100644 --- a/tox.ini +++ b/tox.ini @@ -229,19 +229,6 @@ ignore = W002 toplevel = sphinx_toolbox package = sphinx_toolbox -[testenv:py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2}] -download = True -setenv = - PYTHONDEVMODE=1 - PIP_DISABLE_PIP_VERSION_CHECK=1 - -[testenv:py313-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2}] -download = True -setenv = - PYTHONDEVMODE=1 - PIP_DISABLE_PIP_VERSION_CHECK=1 - UNSAFE_PYO3_SKIP_VERSION_CHECK=1 - [testenv] setenv = PYTHONDEVMODE=1 @@ -368,8 +355,3 @@ filterwarnings = always:The `docutils.parsers.rst.directive.html` module will be removed in Docutils 2.0.:DeprecationWarning always:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning always:nodes.Node.traverse\(\) is obsoleted by Node.findall\(\).:PendingDeprecationWarning - -[testenv:py{py37,py38,py39}-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0}] -commands = - python --version - python -m pytest -p no:cov -r aR tests/ {posargs} From b8c08ecf18ec6e2fab72d86da94fd2acb3394113 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 16 Apr 2025 16:37:33 +0100 Subject: [PATCH 14/33] Fix tests on Python 3.13 --- ...test_html_output_autonamedtuple_html_.html | 10 +++---- .../test_html_output_overloads_html_.html | 28 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html b/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html index 9932b46..09ef9ba 100644 --- a/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html +++ b/tests/test_output/test_output_/test_html_output_autonamedtuple_html_.html @@ -214,7 +214,7 @@

( - + int @@ -359,7 +359,7 @@

( - + int @@ -466,7 +466,7 @@

( - + int @@ -683,7 +683,7 @@

( - + int @@ -793,7 +793,7 @@

( - + int diff --git a/tests/test_output/test_output_/test_html_output_overloads_html_.html b/tests/test_output/test_output_/test_html_output_overloads_html_.html index 4317ba7..8f7259b 100644 --- a/tests/test_output/test_output_/test_html_output_overloads_html_.html +++ b/tests/test_output/test_output_/test_html_output_overloads_html_.html @@ -205,7 +205,7 @@

: - + int @@ -213,7 +213,7 @@

) -> - + str @@ -236,13 +236,13 @@

: - + slice - ) ->{% if python_version >= (9, 9) %} + ) ->{% if python_version >= (3, 13) %} List[str] @@ -257,7 +257,7 @@

[ - + str @@ -454,7 +454,7 @@

: - + int @@ -462,7 +462,7 @@

) -> - + str @@ -485,13 +485,13 @@

: - + slice - ) ->{% if python_version >= (9, 9) %} + ) ->{% if python_version >= (3, 13) %} List[str] @@ -506,7 +506,7 @@

[ - + str @@ -788,7 +788,7 @@

cls - :{% if python_version >= (9, 9) %} + :{% if python_version >= (3, 13) %} Type[object] @@ -833,7 +833,7 @@

= …, to_key - {% endif %}{% if python_version >= (9, 9) %} + {% endif %}{% if python_version >= (3, 13) %} @@ -890,7 +890,7 @@

= None, from_key - {% if python_version >= (9, 9) %} + {% if python_version >= (3, 13) %} : @@ -905,7 +905,7 @@

: - + str From 30d84f96fba1736868cd98b4c274e266f0f5f829 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Thu, 17 Apr 2025 10:39:05 +0100 Subject: [PATCH 15/33] Don't test Python 3.12 with older Sphinx versions (require distutils) --- .github/workflows/python_ci.yml | 2 +- .github/workflows/python_ci_linux.yml | 2 +- .github/workflows/python_ci_macos.yml | 2 +- repo_helper.yml | 9 +++++++++ tox.ini | 4 ++-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 3a3e043..95bc1b8 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -33,7 +33,7 @@ jobs: - {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: False} - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1},build", experimental: False} - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.12", testenvs: "py312-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "3.13", testenvs: "py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 6e5d72c..e03e6d5 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -34,7 +34,7 @@ jobs: - {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: False} - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1},build", experimental: False} - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.12", testenvs: "py312-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "3.13", testenvs: "py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index d3c87a6..622f9f5 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -33,7 +33,7 @@ jobs: - {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4},build", experimental: False} - {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1},build", experimental: False} - {python-version: "3.11", testenvs: "py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - - {python-version: "3.12", testenvs: "py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} + - {python-version: "3.12", testenvs: "py312-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "3.13", testenvs: "py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2},build", experimental: False} - {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3},build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1},build", experimental: False} diff --git a/repo_helper.yml b/repo_helper.yml index bc541c9..ae7dc7b 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -60,6 +60,15 @@ python_versions: - 8.2 "3.11": "3.12": + matrix_exclude: + sphinx: + - 3.2 + - 3.3 + - 3.4 + - 3.5 + - 4.0 + - 4.1 + - 4.2 "3.13": matrix_exclude: sphinx: diff --git a/tox.ini b/tox.ini index 646451a..e1d223a 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ envlist = py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4} py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1} py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} - py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} + py312-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3} pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1} @@ -48,7 +48,7 @@ test = py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4} py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1} py311-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} - py312-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} + py312-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} py313-sphinx{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2} pypy37-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3} pypy38-sphinx{4.3,4.4,4.5,5.0,5.1,5.2,5.3,6.0,6.1,6.2,7.0,7.1} From 1cf39a23237e52c767864b04cd6cb4f63c51f679 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 28 Apr 2025 15:56:22 +0100 Subject: [PATCH 16/33] Fix tests on Python 3.12 --- .../test_html_output_overloads_html_.html | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/test_output/test_output_/test_html_output_overloads_html_.html b/tests/test_output/test_output_/test_html_output_overloads_html_.html index 8f7259b..255e148 100644 --- a/tests/test_output/test_output_/test_html_output_overloads_html_.html +++ b/tests/test_output/test_output_/test_html_output_overloads_html_.html @@ -205,7 +205,7 @@

: - + int @@ -213,7 +213,7 @@

) -> - + str @@ -236,13 +236,13 @@

: - + slice - ) ->{% if python_version >= (3, 13) %} + ) ->{% if python_version >= (3, 12) %} List[str] @@ -257,7 +257,7 @@

[ - + str @@ -454,7 +454,7 @@

: - + int @@ -462,7 +462,7 @@

) -> - + str @@ -485,13 +485,13 @@

: - + slice - ) ->{% if python_version >= (3, 13) %} + ) ->{% if python_version >= (3, 12) %} List[str] @@ -506,7 +506,7 @@

[ - + str @@ -788,7 +788,7 @@

cls - :{% if python_version >= (3, 13) %} + :{% if python_version >= (3, 12) %} Type[object] @@ -833,7 +833,7 @@

= …, to_key - {% endif %}{% if python_version >= (3, 13) %} + {% endif %}{% if python_version >= (3, 12) %} @@ -890,7 +890,7 @@

= None, from_key - {% if python_version >= (3, 13) %} + {% if python_version >= (3, 12) %} : @@ -905,7 +905,7 @@

: - + str From dfd16379d0804fce1308b2b3f7d60d4ed7adae6a Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 29 Apr 2025 09:49:10 +0100 Subject: [PATCH 17/33] Fix tests on newer Sphinx versions on newer Pythons. --- .../test_html_output_overloads_html_.html | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/test_output/test_output_/test_html_output_overloads_html_.html b/tests/test_output/test_output_/test_html_output_overloads_html_.html index 255e148..52f3c74 100644 --- a/tests/test_output/test_output_/test_html_output_overloads_html_.html +++ b/tests/test_output/test_output_/test_html_output_overloads_html_.html @@ -205,7 +205,7 @@

: - + int @@ -213,7 +213,7 @@

) -> - + str @@ -236,13 +236,13 @@

: - + slice - ) ->{% if python_version >= (3, 12) %} + ) ->{% if python_version >= (3, 12) and sphinx_version < (7, 4) %} List[str] @@ -257,7 +257,7 @@

[ - + str @@ -454,7 +454,7 @@

: - + int @@ -462,7 +462,7 @@

) -> - + str @@ -485,13 +485,13 @@

: - + slice - ) ->{% if python_version >= (3, 12) %} + ) ->{% if python_version >= (3, 12) and sphinx_version < (7, 4) %} List[str] @@ -506,7 +506,7 @@

[ - + str @@ -788,7 +788,7 @@

cls - :{% if python_version >= (3, 12) %} + :{% if python_version >= (3, 12) and sphinx_version < (7, 4) %} Type[object] @@ -833,7 +833,7 @@

= …, to_key - {% endif %}{% if python_version >= (3, 12) %} + {% endif %}{% if python_version >= (3, 12) and sphinx_version < (7, 4) %} @@ -890,7 +890,7 @@

= None, from_key - {% if python_version >= (3, 12) %} + {% if python_version >= (3, 12) and sphinx_version < (7, 4) %} : From 0d872122690b04dafafbb6ddde0806aef0ee2878 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 29 Apr 2025 09:55:30 +0100 Subject: [PATCH 18/33] Lint --- tests/test_issues_output/conftest.py | 5 ++--- tests/test_output/conftest.py | 5 ++--- tests/test_source_output_github/conftest.py | 5 ++--- tests/test_source_output_sphinx/conftest.py | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/test_issues_output/conftest.py b/tests/test_issues_output/conftest.py index 0cc3529..8093a88 100644 --- a/tests/test_issues_output/conftest.py +++ b/tests/test_issues_output/conftest.py @@ -27,7 +27,6 @@ # # stdlib -import pathlib import shutil from typing import Any, Dict, List, Sequence, Tuple, cast @@ -56,8 +55,8 @@ def rootdir() -> PathPlus: def app_params( request: Any, test_params: Dict, - sphinx_test_tempdir: pathlib.Path, - rootdir: pathlib.Path, + sphinx_test_tempdir: PathPlus, + rootdir: PathPlus, ) -> Tuple[Sequence, Dict]: """ parameters that is specified by 'pytest.mark.sphinx' for diff --git a/tests/test_output/conftest.py b/tests/test_output/conftest.py index 44210b8..3f3139a 100644 --- a/tests/test_output/conftest.py +++ b/tests/test_output/conftest.py @@ -27,7 +27,6 @@ # # stdlib -import pathlib import shutil from contextlib import contextmanager from typing import Any, Callable, ContextManager, Dict, Iterator, List, Sequence, Tuple, cast @@ -86,8 +85,8 @@ def rootdir() -> PathPlus: def app_params( request: Any, test_params: Dict, - sphinx_test_tempdir: pathlib.Path, - rootdir: pathlib.Path, + sphinx_test_tempdir: PathPlus, + rootdir: PathPlus, ) -> Tuple[Sequence, Dict]: """ parameters that is specified by 'pytest.mark.sphinx' for diff --git a/tests/test_source_output_github/conftest.py b/tests/test_source_output_github/conftest.py index 56048e9..4bae8d0 100644 --- a/tests/test_source_output_github/conftest.py +++ b/tests/test_source_output_github/conftest.py @@ -27,7 +27,6 @@ # # stdlib -import pathlib import shutil from typing import Any, Dict, List, Sequence, Tuple, cast @@ -56,8 +55,8 @@ def rootdir() -> PathPlus: def app_params( request: Any, test_params: Dict, - sphinx_test_tempdir: pathlib.Path, - rootdir: pathlib.Path, + sphinx_test_tempdir: PathPlus, + rootdir: PathPlus, ) -> Tuple[Sequence, Dict]: """ parameters that is specified by 'pytest.mark.sphinx' for diff --git a/tests/test_source_output_sphinx/conftest.py b/tests/test_source_output_sphinx/conftest.py index 7f9cb8f..b9d50c1 100644 --- a/tests/test_source_output_sphinx/conftest.py +++ b/tests/test_source_output_sphinx/conftest.py @@ -27,7 +27,6 @@ # # stdlib -import pathlib import shutil from typing import Any, Dict, List, Sequence, Tuple, cast @@ -56,8 +55,8 @@ def rootdir() -> PathPlus: def app_params( request: Any, test_params: Dict, - sphinx_test_tempdir: pathlib.Path, - rootdir: pathlib.Path, + sphinx_test_tempdir: PathPlus, + rootdir: PathPlus, ) -> Tuple[Sequence, Dict]: """ parameters that is specified by 'pytest.mark.sphinx' for From c15ca3ca55740d12895a4aa0e7b18740cf53c301 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 30 Apr 2025 10:56:08 +0100 Subject: [PATCH 19/33] Fix installation tabs in HTML when not under "Installation" heading. --- sphinx_toolbox/installation.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sphinx_toolbox/installation.py b/sphinx_toolbox/installation.py index 8f4e9eb..249a926 100644 --- a/sphinx_toolbox/installation.py +++ b/sphinx_toolbox/installation.py @@ -531,15 +531,20 @@ def make_installation_instructions(options: Dict[str, Any], env: BuildEnvironmen warnings.warn("No installation source specified. No installation instructions will be shown.") return [] - content = StringList([".. tabs::", '']) + content = StringList([ + ".. container:: st-installation", + '', + " .. tabs::", + '', + ]) content.set_indent_type(" ") for tab_name, tab_content in tabs.items(): - with content.with_indent_size(1): + with content.with_indent_size(2): content.append(f".. tab:: {tab_name}") content.blankline(ensure_single=True) - with content.with_indent_size(2): + with content.with_indent_size(3): content.extend([f"{line}" if line else '' for line in tab_content]) # pylint: disable=loop-invariant-statement return list(content) @@ -683,7 +688,7 @@ def copy_asset_files(app: Sphinx, exception: Optional[Exception] = None) -> None " const parent = target.parentNode;", " const grandparent = parent.parentNode;", '', - ' if (parent.parentNode.parentNode.getAttribute("id").startsWith("installation")) {', + ' if (grandparent.parentNode.classList.contains("st-installation")) {', '', " // Hide all tabs in current tablist, but not nested", " Array.from(parent.children).forEach(t => {", From b2013dd86e756e64c68b11a934adbcf4462af700 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Wed, 30 Apr 2025 14:17:36 +0100 Subject: [PATCH 20/33] Update tests for installation directive. --- tests/test_installation.py | 100 +-- .../test_html_output_installation_html_.html | 636 +++++++++--------- 2 files changed, 394 insertions(+), 342 deletions(-) diff --git a/tests/test_installation.py b/tests/test_installation.py index fdd5329..fcc701a 100644 --- a/tests/test_installation.py +++ b/tests/test_installation.py @@ -50,39 +50,45 @@ def test_make_installation_instructions(): {"pypi": True, "project_name": "my_project"}, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", '', - " .. tab:: from PyPI", + " .. tabs::", '', - " .. prompt:: bash", + " .. tab:: from PyPI", '', - " python3 -m pip install my_project --user", + " .. prompt:: bash", + '', + " python3 -m pip install my_project --user", ] assert make_installation_instructions( {"pypi": True, "project_name": "my_project", "pypi-name": "my-project"}, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", + '', + " .. tabs::", '', - " .. tab:: from PyPI", + " .. tab:: from PyPI", '', - " .. prompt:: bash", + " .. prompt:: bash", '', - " python3 -m pip install my-project --user", + " python3 -m pip install my-project --user", ] assert make_installation_instructions( {"anaconda": True, "project_name": "my_project"}, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", '', - " .. tab:: from Anaconda", + " .. tabs::", '', - " .. prompt:: bash", + " .. tab:: from Anaconda", '', - " conda install my_project", + " .. prompt:: bash", + '', + " conda install my_project", '', ] @@ -90,13 +96,15 @@ def test_make_installation_instructions(): {"anaconda": True, "project_name": "my_project", "conda-name": "my-project"}, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", + '', + " .. tabs::", '', - " .. tab:: from Anaconda", + " .. tab:: from Anaconda", '', - " .. prompt:: bash", + " .. prompt:: bash", '', - " conda install my-project", + " conda install my-project", '', ] @@ -104,13 +112,15 @@ def test_make_installation_instructions(): {"anaconda": True, "project_name": "my_project", "pypi-name": "pypi-project"}, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", '', - " .. tab:: from Anaconda", + " .. tabs::", '', - " .. prompt:: bash", + " .. tab:: from Anaconda", '', - " conda install pypi-project", + " .. prompt:: bash", + '', + " conda install pypi-project", '', ] @@ -118,13 +128,15 @@ def test_make_installation_instructions(): {"github": True, "project_name": "my_project"}, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", + '', + " .. tabs::", '', - " .. tab:: from GitHub", + " .. tab:: from GitHub", '', - " .. prompt:: bash", + " .. prompt:: bash", '', - " python3 -m pip install git+https://github.com/octocat/hello_world@master --user", + " python3 -m pip install git+https://github.com/octocat/hello_world@master --user", ] assert make_installation_instructions( @@ -135,22 +147,24 @@ def test_make_installation_instructions(): }, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", '', - " .. tab:: from Anaconda", + " .. tabs::", '', - " First add the required channels", + " .. tab:: from Anaconda", '', - " .. prompt:: bash", + " First add the required channels", '', - " conda config --add channels https://conda.anaconda.org/foo", - " conda config --add channels https://conda.anaconda.org/bar", + " .. prompt:: bash", '', - " Then install", + " conda config --add channels https://conda.anaconda.org/foo", + " conda config --add channels https://conda.anaconda.org/bar", '', - " .. prompt:: bash", + " Then install", '', - " conda install my_project", + " .. prompt:: bash", + '', + " conda install my_project", '', ] @@ -163,22 +177,24 @@ def test_make_installation_instructions(): }, FakeBuildEnvironment(4), # type: ignore[arg-type] ) == [ - ".. tabs::", + ".. container:: st-installation", + '', + " .. tabs::", '', - " .. tab:: from Anaconda", + " .. tab:: from Anaconda", '', - " First add the required channels", + " First add the required channels", '', - " .. prompt:: bash", + " .. prompt:: bash", '', - " conda config --add channels https://conda.anaconda.org/foo", - " conda config --add channels https://conda.anaconda.org/bar", + " conda config --add channels https://conda.anaconda.org/foo", + " conda config --add channels https://conda.anaconda.org/bar", '', - " Then install", + " Then install", '', - " .. prompt:: bash", + " .. prompt:: bash", '', - " conda install my_project", + " conda install my_project", '', ] diff --git a/tests/test_output/test_output_/test_html_output_installation_html_.html b/tests/test_output/test_output_/test_html_output_installation_html_.html index 3884fa7..d2d4675 100644 --- a/tests/test_output/test_output_/test_html_output_installation_html_.html +++ b/tests/test_output/test_output_/test_html_output_installation_html_.html @@ -44,21 +44,23 @@

-
-
- -
-
-
-
-
python3 -m pip install my_project --user
 
+
@@ -67,17 +69,19 @@

-
-
- -
-
-
-
-
python3 -m pip install my-project --user
+       
+
+
+ +
+
+
+
+
python3 -m pip install my-project --user
 
+
@@ -86,17 +90,19 @@

-
-
- -
-
-
-
-
python3 -m pip install my-project --user
+       
+
+
+ +
+
+
+
+
python3 -m pip install my-project --user
 
+
@@ -105,17 +111,19 @@

-
-
- -
-
-
-
-
conda install my_project
+       
+
+
+ +
+
+
+
+
conda install my_project
 
+
@@ -124,17 +132,19 @@

-
-
- -
-
-
-
-
conda install my-project
+       
+
+
+ +
+
+
+
+
conda install my-project
 
+
@@ -143,17 +153,19 @@

-
-
- -
-
-
-
-
conda install my-project
+       
+
+
+ +
+
+
+
+
conda install my-project
 
+
@@ -162,17 +174,19 @@

-
-
- -
-
-
-
-
python3 -m pip install git+https://github.com/sphinx-toolbox/sphinx-toolbox@master --user
+       
+
+
+ +
+
+
+
+
python3 -m pip install git+https://github.com/sphinx-toolbox/sphinx-toolbox@master --user
 
+
@@ -181,17 +195,19 @@

-
-
- -
-
-
-
-
python3 -m pip install git+https://github.com/sphinx-toolbox/sphinx-toolbox@master --user
+       
+
+
+ +
+
+
+
+
python3 -m pip install git+https://github.com/sphinx-toolbox/sphinx-toolbox@master --user
 
+
@@ -200,28 +216,30 @@

-
-
- - -
-
-
-
-
python3 -m pip install my_project --user
+       
+
+
+ + +
+
+
+
+
python3 -m pip install my_project --user
 
+
-
-