From cf43d4ffcfabeee2be9cb59b9539a907ec2aac4f Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Apr 2025 11:44:20 -0700 Subject: [PATCH 01/49] put install and import test into its own workflow --- .github/workflows/check_install.yml | 40 +++++++++++++++++++++++++++++ .github/workflows/documentation.yml | 16 ------------ 2 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/check_install.yml diff --git a/.github/workflows/check_install.yml b/.github/workflows/check_install.yml new file mode 100644 index 0000000..ce7ae92 --- /dev/null +++ b/.github/workflows/check_install.yml @@ -0,0 +1,40 @@ +name: Install and Import + +on: + push: + branches: + - main + - v0.*.x + tags: + - v* + pull_request: + workflow_dispatch: + +permissions: {} + +jobs: + pip-install-and-import: + name: Installation with pip & import (py-${{ matrix.python }}) + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + python: [ '3.6', '3.10', '3.12', '3.13' ] + os: [ ubuntu-latest ] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + cache: 'pip' + - name: Install plasmapy_sphinx with pip + run: pip install . + - name: Import plasmapy_sphinx + run: python -c "import plasmapy_sphinx" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ffacb35..de99264 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -38,19 +38,3 @@ jobs: - name: Build Docs run: | sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q - - pip-install: - name: Installation with pip - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.12 - - name: Install plasmapy_sphinx with pip - run: pip install . From 0f8b8fd9157d2160831ba359e82e03f04a074ae3 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Apr 2025 11:44:51 -0700 Subject: [PATCH 02/49] add tests on py 3.6 and 3.13 --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index de99264..a39fc95 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.10', '3.12'] + python: ['3.6', '3.10', '3.12', '3.13'] os: [ubuntu-latest] steps: From 63b206a937cfff7e39f872fd464cf9f58191f87c Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Apr 2025 11:45:17 -0700 Subject: [PATCH 03/49] cache tests and set fetch-depth to 1 --- .github/workflows/documentation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a39fc95..da4b2d6 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -25,11 +25,12 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: 1 - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} + cache: 'pip' - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip From 1246cafe5b76875ceb840cd376e014a370ad1245 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Apr 2025 11:45:50 -0700 Subject: [PATCH 04/49] restrict workflow permissions --- .github/workflows/documentation.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index da4b2d6..2496fda 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -10,6 +10,8 @@ on: pull_request: workflow_dispatch: +permissions: {} # disables all GitHub permissions for the workflow + jobs: documentation: name: Doc Build - py${{ matrix.python }} on ${{ matrix.os }} From 3cc97cecceeea53aadd6f2b69cb87b559f32d036 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Apr 2025 11:46:15 -0700 Subject: [PATCH 05/49] no not explicitly install plasmapy --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 2496fda..8719f6f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -36,7 +36,7 @@ jobs: - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements/docs.txt git+https://github.com/PlasmaPy/plasmapy + python -m pip install --progress-bar off -r requirements/docs.txt sudo apt-get install graphviz pandoc - name: Build Docs run: | From 906b4934191870ce9bac1953b77410e55a5d3d99 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Apr 2025 12:14:36 -0700 Subject: [PATCH 06/49] set upper sphinx limit to < 8.2 --- pyproject.toml | 2 +- requirements/install.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4fe0982..7858c99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ # ought to mirror 'requirements/install.txt' "docutils", "importlib_metadata; python_version < '3.8'", "jinja2 != 3.1", - "sphinx >= 4.4", + "sphinx >= 4.4, < 8.2", "sphinx-gallery", "sphinx_rtd_theme >= 1.0.0", ] diff --git a/requirements/install.txt b/requirements/install.txt index d9e0af6..79b1856 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -6,6 +6,6 @@ docutils importlib_metadata; python_version < '3.8' jinja2 != 3.1 -sphinx >= 4.4 +sphinx >= 4.4, < 8.2 sphinx-gallery sphinx_rtd_theme >= 1.0.0 From da1252dfd6178945f508f3da00f29db27c4d439e Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 28 Apr 2025 15:01:43 -0700 Subject: [PATCH 07/49] set upper sphinx limit to < 7.4 --- pyproject.toml | 2 +- requirements/install.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7858c99..2069d54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ # ought to mirror 'requirements/install.txt' "docutils", "importlib_metadata; python_version < '3.8'", "jinja2 != 3.1", - "sphinx >= 4.4, < 8.2", + "sphinx >= 4.4, < 7.4", "sphinx-gallery", "sphinx_rtd_theme >= 1.0.0", ] diff --git a/requirements/install.txt b/requirements/install.txt index 79b1856..a673b2f 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -6,6 +6,6 @@ docutils importlib_metadata; python_version < '3.8' jinja2 != 3.1 -sphinx >= 4.4, < 8.2 +sphinx >= 4.4, < 7.4 sphinx-gallery sphinx_rtd_theme >= 1.0.0 From d02a2e1f433caba12ddcb057ecd18bdf1fe86c9c Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 28 Apr 2025 15:11:07 -0700 Subject: [PATCH 08/49] add plasmapy dependency to the documentation requirements --- pyproject.toml | 1 + requirements/docs.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 2069d54..486914c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ docs = [ # ought to mirror 'requirements/docs.txt' "numpydoc", "packaging", "pillow", + "plasmapy > 8.0", "pygments >= 2.11.0", "sphinx-changelog", "sphinx-copybutton", diff --git a/requirements/docs.txt b/requirements/docs.txt index 62b1242..2947742 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -6,6 +6,7 @@ numpydoc packaging pillow +plasmapy > 8.0 pygments >= 2.11.0 sphinx-changelog sphinx-copybutton From 2bed441d49e91785710c8f0203c873b65c518a3d Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 28 Apr 2025 15:28:38 -0700 Subject: [PATCH 09/49] set min python version to 3.8 --- .github/workflows/check_install.yml | 2 +- .github/workflows/documentation.yml | 2 +- plasmapy_sphinx/__init__.py | 4 ++-- pyproject.toml | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check_install.yml b/.github/workflows/check_install.yml index ce7ae92..7bfd5e0 100644 --- a/.github/workflows/check_install.yml +++ b/.github/workflows/check_install.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python: [ '3.6', '3.10', '3.12', '3.13' ] + python: [ '3.8', '3.10', '3.12', '3.13' ] os: [ ubuntu-latest ] steps: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8719f6f..297498c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.6', '3.10', '3.12', '3.13'] + python: ['3.8', '3.10', '3.12', '3.13'] os: [ubuntu-latest] steps: diff --git a/plasmapy_sphinx/__init__.py b/plasmapy_sphinx/__init__.py index d386675..00ca5b5 100644 --- a/plasmapy_sphinx/__init__.py +++ b/plasmapy_sphinx/__init__.py @@ -70,8 +70,8 @@ # This is the same check as the one at the top of setup.py import sys -if sys.version_info < (3, 6): # coverage: ignore - raise ImportError("plasmapy_sphinx does not support Python < 3.6") +if sys.version_info < (3, 8): # coverage: ignore + raise ImportError("plasmapy_sphinx does not support Python < 3.8") if sys.version_info >= (3, 8): from importlib.metadata import version, PackageNotFoundError diff --git a/pyproject.toml b/pyproject.toml index 486914c..b52412b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ ] description = "Sphinx extensions for the PlasmaPy Project" readme = "README.md" -requires-python = ">=3.6" +requires-python = ">=3.8" dynamic = ["version"] license = {file = "LICENSE.md"} keywords = ["plasmapy", "sphinx", "documentation"] @@ -24,8 +24,6 @@ classifiers = [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From 91ca1144fc0089e0c1cd270c6746280e2dd0b21d Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 28 Apr 2025 15:43:40 -0700 Subject: [PATCH 10/49] set min setuptools version to 61 --- pyproject.toml | 2 +- requirements/build.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b52412b..ecccad3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ # ought to mirror 'requirements/build.txt' - "setuptools >= 41.2", + "setuptools >= 61", "setuptools_scm", "wheel >= 0.29.0", ] diff --git a/requirements/build.txt b/requirements/build.txt index cd42bfc..0c51567 100644 --- a/requirements/build.txt +++ b/requirements/build.txt @@ -3,6 +3,6 @@ # # ought to mirror [build-system.requires] under in pyproject.toml # -setuptools >= 41.2 +setuptools >= 61 setuptools_scm wheel >= 0.29.0 From 5557b9a95df7c5a79c0fe771805b54a2a787abca Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 11:03:21 -0700 Subject: [PATCH 11/49] remove fail on warnings and add 3x verbosity --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 297498c..99dc366 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -40,4 +40,4 @@ jobs: sudo apt-get install graphviz pandoc - name: Build Docs run: | - sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q + sphinx-build ./docs ./docs/_build -n --keep-going -b html -q -v -v -v From b3cc46fbf2f425b574750cbd8b8486d5aa6b4c5f Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 11:07:45 -0700 Subject: [PATCH 12/49] remove the 3x verbosity --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 99dc366..b2fe153 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -40,4 +40,4 @@ jobs: sudo apt-get install graphviz pandoc - name: Build Docs run: | - sphinx-build ./docs ./docs/_build -n --keep-going -b html -q -v -v -v + sphinx-build ./docs ./docs/_build -n --keep-going -b html -q From e2dbfc1bf085050140ec5e609be2e60b5cf78ed7 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 11:10:16 -0700 Subject: [PATCH 13/49] add dependency "packaging" --- pyproject.toml | 1 + requirements/install.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ecccad3..3ed4d0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,7 @@ dependencies = [ # ought to mirror 'requirements/install.txt' "docutils", "importlib_metadata; python_version < '3.8'", "jinja2 != 3.1", + "packaging", "sphinx >= 4.4, < 7.4", "sphinx-gallery", "sphinx_rtd_theme >= 1.0.0", diff --git a/requirements/install.txt b/requirements/install.txt index a673b2f..459c65d 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -6,6 +6,7 @@ docutils importlib_metadata; python_version < '3.8' jinja2 != 3.1 +packaging sphinx >= 4.4, < 7.4 sphinx-gallery sphinx_rtd_theme >= 1.0.0 From e822c24f1cb974b48d3050d9439e4791c17193c0 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 11:12:27 -0700 Subject: [PATCH 14/49] adopt a kwarg passing scheme so we can be flexible in passing args to generate_autosummary_content(), who's signature changes for sphinx >= 8.0 --- plasmapy_sphinx/automodsumm/generate.py | 30 ++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/plasmapy_sphinx/automodsumm/generate.py b/plasmapy_sphinx/automodsumm/generate.py index ddefba3..c992b75 100644 --- a/plasmapy_sphinx/automodsumm/generate.py +++ b/plasmapy_sphinx/automodsumm/generate.py @@ -8,6 +8,8 @@ import re from jinja2 import TemplateNotFound +from packaging.version import Version +from sphinx import __version__ as sphinx_version from sphinx.ext.autodoc.mock import mock from sphinx.ext.autosummary import get_rst_suffix, import_by_name, import_ivar_by_name from sphinx.ext.autosummary.generate import ( @@ -306,19 +308,21 @@ def generate_docs( if app: context.update(app.config.autosummary_context) - content = generate_autosummary_content( - name, - obj, - parent, - template, - entry.template, - imported_members, - app, - entry.recursive, - context, - modname, - qualname, - ) + _kwargs = { + "name": name, + "obj": obj, + "parent": parent, + "template": template, + "template_name": entry.template, + "imported_members": imported_members, + "recursive": entry.recursive, + "context": context, + "modname": modname, + "qualname": qualname, + } + if Version(sphinx_version) < Version("8.2"): + _kwargs["app"] = app + content = generate_autosummary_content(**_kwargs) filename = os.path.join(path, filename_map.get(name, name) + suffix) if os.path.isfile(filename): From 4823b10b802819f6af75e580da0359b6f68ae227 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 12:42:45 -0700 Subject: [PATCH 15/49] put sphinx upper limit to 8.2 --- pyproject.toml | 2 +- requirements/install.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3ed4d0c..1c81b89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ # ought to mirror 'requirements/install.txt' "importlib_metadata; python_version < '3.8'", "jinja2 != 3.1", "packaging", - "sphinx >= 4.4, < 7.4", + "sphinx >= 4.4, < 8.2", "sphinx-gallery", "sphinx_rtd_theme >= 1.0.0", ] diff --git a/requirements/install.txt b/requirements/install.txt index 459c65d..54ca3aa 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -7,6 +7,6 @@ docutils importlib_metadata; python_version < '3.8' jinja2 != 3.1 packaging -sphinx >= 4.4, < 7.4 +sphinx >= 4.4, < 8.2 sphinx-gallery sphinx_rtd_theme >= 1.0.0 From 4626a126bbd9ca7a92f17806cae4d25fd4055921 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 12:55:40 -0700 Subject: [PATCH 16/49] add sphinx_limits workflow --- .github/workflows/documentation.yml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b2fe153..babc02b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,3 +41,43 @@ jobs: - name: Build Docs run: | sphinx-build ./docs ./docs/_build -n --keep-going -b html -q + + sphinx_limits: + name: Doc Build on Key Sphinx Restriction (${{ matrix.sphinx }}) + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + python: [ '3.12' ] + os: [ ubuntu-latest ] + + include: + - python: '3.12' + os: ubuntu-latest + sphinx: "<7.4" + + - python: '3.12' + os: ubuntu-latest + sphinx: "<8.2" + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --progress-bar off --upgrade pip + python -m pip install --progress-bar off -r requirements/docs.txt sphinx sphinx${{ matrix.sphinx }} + sudo apt-get install graphviz pandoc + - name: Build Docs + run: | + sphinx-build ./docs ./docs/_build -n --keep-going -b html -q + + From 2b4b9078d86f4fec7d34291dc7a4163466a57829 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 12:57:41 -0700 Subject: [PATCH 17/49] repair sphinx_limits workflow --- .github/workflows/documentation.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index babc02b..ad9a11f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -43,23 +43,21 @@ jobs: sphinx-build ./docs ./docs/_build -n --keep-going -b html -q sphinx_limits: - name: Doc Build on Key Sphinx Restriction (${{ matrix.sphinx }}) + name: Doc Build on ${{ matrix.sphinx }} runs-on: ${{ matrix.os }} strategy: fail-fast: false - matrix: - python: [ '3.12' ] - os: [ ubuntu-latest ] + matrix: include: - python: '3.12' os: ubuntu-latest - sphinx: "<7.4" + sphinx: "sphinx<7.4" - python: '3.12' os: ubuntu-latest - sphinx: "<8.2" + sphinx: "sphinx<8.2" steps: - name: Checkout code @@ -74,7 +72,7 @@ jobs: - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements/docs.txt sphinx sphinx${{ matrix.sphinx }} + python -m pip install --progress-bar off -r requirements/docs.txt sphinx ${{ matrix.sphinx }} sudo apt-get install graphviz pandoc - name: Build Docs run: | From c1af3d0a438ba5f11a05a68802a596e30b084ceb Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:00:23 -0700 Subject: [PATCH 18/49] repair sphinx_limits workflow --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ad9a11f..58df03f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -72,7 +72,7 @@ jobs: - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements/docs.txt sphinx ${{ matrix.sphinx }} + python -m pip install --progress-bar off -r requirements/docs.txt ${{ matrix.sphinx }} sudo apt-get install graphviz pandoc - name: Build Docs run: | From b3b076c8d49957f6ff369ae52e30aa9cd3f16120 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:03:03 -0700 Subject: [PATCH 19/49] replace double quotes with single quotes --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 58df03f..f62c1c3 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -53,11 +53,11 @@ jobs: include: - python: '3.12' os: ubuntu-latest - sphinx: "sphinx<7.4" + sphinx: 'sphinx<7.4' - python: '3.12' os: ubuntu-latest - sphinx: "sphinx<8.2" + sphinx: 'sphinx<8.2' steps: - name: Checkout code From ade581c7d604099d343db55600517b5ca54e1528 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:05:57 -0700 Subject: [PATCH 20/49] put ${{ matrix.sphinx }} between quotes --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index f62c1c3..22ded97 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -72,7 +72,7 @@ jobs: - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements/docs.txt ${{ matrix.sphinx }} + python -m pip install --progress-bar off -r requirements/docs.txt "${{ matrix.sphinx }}" sudo apt-get install graphviz pandoc - name: Build Docs run: | From bd0bbaddce9696237894ce263c00df4efafee1a8 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:10:09 -0700 Subject: [PATCH 21/49] put fail on warning for the sphinx_limit workflow --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 22ded97..ff8ad86 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -76,6 +76,6 @@ jobs: sudo apt-get install graphviz pandoc - name: Build Docs run: | - sphinx-build ./docs ./docs/_build -n --keep-going -b html -q + sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q From 1c403919c5e6cb4f45bc27142f99ed2e60679e7d Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:12:29 -0700 Subject: [PATCH 22/49] put fail on warning for the documentation workflow --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ff8ad86..a8a9bf8 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -40,7 +40,7 @@ jobs: sudo apt-get install graphviz pandoc - name: Build Docs run: | - sphinx-build ./docs ./docs/_build -n --keep-going -b html -q + sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q sphinx_limits: name: Doc Build on ${{ matrix.sphinx }} From c62570ac21cd071eb3a671b8087f2cc3261ebdfa Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:34:17 -0700 Subject: [PATCH 23/49] explicitly pass prefixes to import_by_name --- plasmapy_sphinx/automodsumm/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmapy_sphinx/automodsumm/generate.py b/plasmapy_sphinx/automodsumm/generate.py index c992b75..16a9d1f 100644 --- a/plasmapy_sphinx/automodsumm/generate.py +++ b/plasmapy_sphinx/automodsumm/generate.py @@ -293,7 +293,7 @@ def generate_docs( ensuredir(path) try: - name, obj, parent, modname = import_by_name(entry.name) + name, obj, parent, modname = import_by_name(entry.name, prefixes=(None,)) qualname = name.replace(modname + ".", "") except ImportError as e: try: From fe677e36ba26a54ed5d3332e7e607b8f938544fc Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 13:55:36 -0700 Subject: [PATCH 24/49] explicitly remove prefixes before passing to parent method --- plasmapy_sphinx/automodsumm/core.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plasmapy_sphinx/automodsumm/core.py b/plasmapy_sphinx/automodsumm/core.py index 7998539..ca5a8c8 100644 --- a/plasmapy_sphinx/automodsumm/core.py +++ b/plasmapy_sphinx/automodsumm/core.py @@ -664,7 +664,16 @@ def import_by_name( self, name: str, prefixes: List[str] ) -> Tuple[str, Any, Any, str]: """See :func:`sphinx.ext.autosummary.import_by_name`""" - return super(Automodsumm, self).import_by_name(name, prefixes) + + for prefix in prefixes: + if prefix is None: + continue + + if name.startswith(f"{prefix}."): + name = name.removeprefix(f'{prefix}.') + break + + return super().import_by_name(name, prefixes) def setup(app: "Sphinx"): From f7ac2ad32c7fa7a018c5bd84e921a7fef92e93d1 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 16:28:53 -0700 Subject: [PATCH 25/49] add a nitpick exception for SphinxDirective.parse_inline --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index db66c46..a911ced 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -339,6 +339,8 @@ (python_role, "plasmapy.analysis.swept_langmuir.find_floating_potential"), (python_role, "plasmapy.particles.particle_collections"), (python_role, "plasmapy.utils.decorators.lite_func"), + # Sphinx + (python_role, "sphinx.util.docutils.SphinxDirective.parse_inline"), ] # -- Options for HTML output ---------------------------------------------- From 491af3144c71f038439baf669d960950d1860ae8 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 16:50:44 -0700 Subject: [PATCH 26/49] remove the quiet tag from sphinx builds workflow --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a8a9bf8..104ac2d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -40,7 +40,7 @@ jobs: sudo apt-get install graphviz pandoc - name: Build Docs run: | - sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q + sphinx-build ./docs ./docs/_build -n --keep-going -W -b html sphinx_limits: name: Doc Build on ${{ matrix.sphinx }} @@ -76,6 +76,6 @@ jobs: sudo apt-get install graphviz pandoc - name: Build Docs run: | - sphinx-build ./docs ./docs/_build -n --keep-going -W -b html -q + sphinx-build ./docs ./docs/_build -n --keep-going -W -b html From afc343a77a8ef9e3d3d53577665ac70210db47d7 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 17:05:42 -0700 Subject: [PATCH 27/49] add to nitpick exceptions --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index a911ced..3bd3976 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -341,6 +341,7 @@ (python_role, "plasmapy.utils.decorators.lite_func"), # Sphinx (python_role, "sphinx.util.docutils.SphinxDirective.parse_inline"), + (python_role, "system_message"), ] # -- Options for HTML output ---------------------------------------------- From 06a430aff4a6855a10bc195ddb834c29c66c1261 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 18:13:04 -0700 Subject: [PATCH 28/49] remove the string prefix in a python agnostic way --- plasmapy_sphinx/automodsumm/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmapy_sphinx/automodsumm/core.py b/plasmapy_sphinx/automodsumm/core.py index ca5a8c8..cdfb885 100644 --- a/plasmapy_sphinx/automodsumm/core.py +++ b/plasmapy_sphinx/automodsumm/core.py @@ -670,7 +670,7 @@ def import_by_name( continue if name.startswith(f"{prefix}."): - name = name.removeprefix(f'{prefix}.') + name = name[len(prefix):] break return super().import_by_name(name, prefixes) From a37349ca6004f2a249d5a26b43b9c03253a97c43 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 18:31:37 -0700 Subject: [PATCH 29/49] correct the prefix removal +1 --- plasmapy_sphinx/automodsumm/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmapy_sphinx/automodsumm/core.py b/plasmapy_sphinx/automodsumm/core.py index cdfb885..3c2655d 100644 --- a/plasmapy_sphinx/automodsumm/core.py +++ b/plasmapy_sphinx/automodsumm/core.py @@ -670,7 +670,7 @@ def import_by_name( continue if name.startswith(f"{prefix}."): - name = name[len(prefix):] + name = name[len(prefix)+1:] break return super().import_by_name(name, prefixes) From 230a2d8dc6fbefd038bb456e76f5938847354665 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 18:43:49 -0700 Subject: [PATCH 30/49] add nitpick ignore for ObjectMembers type annotation --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 3bd3976..c5ae4cb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -342,6 +342,7 @@ # Sphinx (python_role, "sphinx.util.docutils.SphinxDirective.parse_inline"), (python_role, "system_message"), + (python_role, "sphinx.ext.autodoc.ObjectMembers"), ] # -- Options for HTML output ---------------------------------------------- From 6bff2dbf1386acde1d78ca826d61b0acc77ca43d Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 18:47:22 -0700 Subject: [PATCH 31/49] make nitpick ignore rules a little more generic --- docs/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c5ae4cb..12a8138 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -340,9 +340,8 @@ (python_role, "plasmapy.particles.particle_collections"), (python_role, "plasmapy.utils.decorators.lite_func"), # Sphinx - (python_role, "sphinx.util.docutils.SphinxDirective.parse_inline"), - (python_role, "system_message"), - (python_role, "sphinx.ext.autodoc.ObjectMembers"), + (python_role, "system_message"), # sphinx.util.docutils.system_message + (python_role, "ObjectMembers"), # sphinx.ext.autodoc.ObjectMembers ] # -- Options for HTML output ---------------------------------------------- From b77fb69b8c007599617b67a4316241cf1e21e49b Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 18:50:10 -0700 Subject: [PATCH 32/49] add ObjectMember to nitpick ignore rules --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 12a8138..ad93567 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -341,6 +341,7 @@ (python_role, "plasmapy.utils.decorators.lite_func"), # Sphinx (python_role, "system_message"), # sphinx.util.docutils.system_message + (python_role, "ObjectMember"), # sphinx.ext.autodoc.ObjectMember (python_role, "ObjectMembers"), # sphinx.ext.autodoc.ObjectMembers ] From 108f4c3be197c7b41f61aadb527bdef22d03c0ac Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 18:57:28 -0700 Subject: [PATCH 33/49] remove upper dependency limit on sphinx --- pyproject.toml | 2 +- requirements/install.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1c81b89..b5f0b06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ # ought to mirror 'requirements/install.txt' "importlib_metadata; python_version < '3.8'", "jinja2 != 3.1", "packaging", - "sphinx >= 4.4, < 8.2", + "sphinx >= 4.4", "sphinx-gallery", "sphinx_rtd_theme >= 1.0.0", ] diff --git a/requirements/install.txt b/requirements/install.txt index 54ca3aa..4c3126f 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -7,6 +7,6 @@ docutils importlib_metadata; python_version < '3.8' jinja2 != 3.1 packaging -sphinx >= 4.4, < 8.2 +sphinx >= 4.4 sphinx-gallery sphinx_rtd_theme >= 1.0.0 From 5b6bae31ba405fc4043f88f8dd3475029a0ed297 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 19:08:30 -0700 Subject: [PATCH 34/49] add a build on py3.11 --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 104ac2d..e0e6933 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.8', '3.10', '3.12', '3.13'] + python: ['3.8', '3.10', '3.11', '3.12', '3.13'] os: [ubuntu-latest] steps: From d03199e162ae75d9a6f87a599e2753662855d3f2 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 19:09:39 -0700 Subject: [PATCH 35/49] add kwargs for generate_autosummary_content() that are specific to sphinx >= 8.2 specific --- plasmapy_sphinx/automodsumm/generate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plasmapy_sphinx/automodsumm/generate.py b/plasmapy_sphinx/automodsumm/generate.py index 16a9d1f..6700d5b 100644 --- a/plasmapy_sphinx/automodsumm/generate.py +++ b/plasmapy_sphinx/automodsumm/generate.py @@ -322,6 +322,11 @@ def generate_docs( } if Version(sphinx_version) < Version("8.2"): _kwargs["app"] = app + else: + _kwargs["config"] = app.config + _kwargs["events"] = app.events + _kwargs["registry"] = app.registry + content = generate_autosummary_content(**_kwargs) filename = os.path.join(path, filename_map.get(name, name) + suffix) From 0d463fd81ff1b3273227d41cc0692f2066ef1b9d Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 19:15:17 -0700 Subject: [PATCH 36/49] remove trailing whitespace --- .github/workflows/documentation.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e0e6933..cbcd28c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -77,5 +77,3 @@ jobs: - name: Build Docs run: | sphinx-build ./docs ./docs/_build -n --keep-going -W -b html - - From a5427bc370c69c083e02564e5e3c7633ae63c1e0 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 1 May 2025 19:16:59 -0700 Subject: [PATCH 37/49] add check on py3.11 --- .github/workflows/check_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_install.yml b/.github/workflows/check_install.yml index 7bfd5e0..5982b7a 100644 --- a/.github/workflows/check_install.yml +++ b/.github/workflows/check_install.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python: [ '3.8', '3.10', '3.12', '3.13' ] + python: [ '3.8', '3.10', '3.11', '3.12', '3.13' ] os: [ ubuntu-latest ] steps: From 83fa54ead378f1f320b8097de59cd415808b0e41 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 02:21:27 +0000 Subject: [PATCH 38/49] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/check_install.yml | 6 ++-- .github/workflows/documentation.yml | 50 ++++++++++++++--------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/check_install.yml b/.github/workflows/check_install.yml index 5982b7a..20d94f0 100644 --- a/.github/workflows/check_install.yml +++ b/.github/workflows/check_install.yml @@ -20,8 +20,8 @@ jobs: strategy: fail-fast: false matrix: - python: [ '3.8', '3.10', '3.11', '3.12', '3.13' ] - os: [ ubuntu-latest ] + python: ['3.8', '3.10', '3.11', '3.12', '3.13'] + os: [ubuntu-latest] steps: - name: Checkout code @@ -33,7 +33,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - cache: 'pip' + cache: pip - name: Install plasmapy_sphinx with pip run: pip install . - name: Import plasmapy_sphinx diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index cbcd28c..86ab79a 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -32,7 +32,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - cache: 'pip' + cache: pip - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip @@ -44,36 +44,36 @@ jobs: sphinx_limits: name: Doc Build on ${{ matrix.sphinx }} - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - - python: '3.12' - os: ubuntu-latest - sphinx: 'sphinx<7.4' + - python: '3.12' + os: ubuntu-latest + sphinx: sphinx<7.4 - - python: '3.12' - os: ubuntu-latest - sphinx: 'sphinx<8.2' + - python: '3.12' + os: ubuntu-latest + sphinx: sphinx<8.2 steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - cache: 'pip' - - name: Install dependencies - run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements/docs.txt "${{ matrix.sphinx }}" - sudo apt-get install graphviz pandoc - - name: Build Docs - run: | - sphinx-build ./docs ./docs/_build -n --keep-going -W -b html + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + cache: pip + - name: Install dependencies + run: | + python -m pip install --progress-bar off --upgrade pip + python -m pip install --progress-bar off -r requirements/docs.txt "${{ matrix.sphinx }}" + sudo apt-get install graphviz pandoc + - name: Build Docs + run: | + sphinx-build ./docs ./docs/_build -n --keep-going -W -b html From eaa5cb7346b903cf78c69cd7faadb34eeb714849 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 2 May 2025 17:07:25 -0700 Subject: [PATCH 39/49] wrangle option :no-index: to :index: for sphinx < 7.2 --- plasmapy_sphinx/automodsumm/core.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plasmapy_sphinx/automodsumm/core.py b/plasmapy_sphinx/automodsumm/core.py index 3c2655d..f2b05d0 100644 --- a/plasmapy_sphinx/automodsumm/core.py +++ b/plasmapy_sphinx/automodsumm/core.py @@ -208,6 +208,8 @@ import os from importlib import import_module +from packaging.version import Version +from sphinx import __version__ as sphinx_version from sphinx.ext.autosummary import Autosummary from sphinx.util import logging from typing import Any, Callable, Dict, List, Tuple, Union @@ -305,6 +307,11 @@ def __init__( "abspath": None, } # type: Dict[str, Union[str, None]] + if Version(sphinx_version) < Version("7.2") and "no-index" in self._options: + # sphinx started using :no-index: instead of the original :noindex: + opt_value = self._options.pop("no-index") + self._options["noindex"] = opt_value + self.condition_options() @property From aae0e6e35f4e672aa36f443c03b59e14af81cee1 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 2 May 2025 17:57:22 -0700 Subject: [PATCH 40/49] remove unused import --- plasmapy_sphinx/autodoc/automodapi.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plasmapy_sphinx/autodoc/automodapi.py b/plasmapy_sphinx/autodoc/automodapi.py index 65dd9eb..b1142a1 100644 --- a/plasmapy_sphinx/autodoc/automodapi.py +++ b/plasmapy_sphinx/autodoc/automodapi.py @@ -303,7 +303,6 @@ import inspect import re -import sys import warnings from collections import OrderedDict From 19bead010596719454853dee32d6938cfb19cec2 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 2 May 2025 17:57:57 -0700 Subject: [PATCH 41/49] remove wrongly placed handling of the no-index option for sphinx < 7.2 --- plasmapy_sphinx/automodsumm/core.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plasmapy_sphinx/automodsumm/core.py b/plasmapy_sphinx/automodsumm/core.py index f2b05d0..1090b8e 100644 --- a/plasmapy_sphinx/automodsumm/core.py +++ b/plasmapy_sphinx/automodsumm/core.py @@ -307,11 +307,6 @@ def __init__( "abspath": None, } # type: Dict[str, Union[str, None]] - if Version(sphinx_version) < Version("7.2") and "no-index" in self._options: - # sphinx started using :no-index: instead of the original :noindex: - opt_value = self._options.pop("no-index") - self._options["noindex"] = opt_value - self.condition_options() @property From 9c86ae227030dc015b8d3bbc37b470ad6da9883b Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 2 May 2025 17:59:31 -0700 Subject: [PATCH 42/49] add the 'no-index' option to option_spec if ModuleDocumenter.option_spec does not have it --- plasmapy_sphinx/autodoc/automodapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plasmapy_sphinx/autodoc/automodapi.py b/plasmapy_sphinx/autodoc/automodapi.py index b1142a1..5ca8f16 100644 --- a/plasmapy_sphinx/autodoc/automodapi.py +++ b/plasmapy_sphinx/autodoc/automodapi.py @@ -348,6 +348,8 @@ class RemovedInSphinx50Warning(PendingDeprecationWarning): "inheritance-diagram": bool_option, "no-inheritance-diagram": bool_option, } # type: Dict[str, Callable] +if "no-index" not in _option_spec: + _option_spec["no-index"] = bool_option for option_name in list(_option_spec): if "member" in option_name: del _option_spec[option_name] From 80f7e024a78a3b2136dbd071a03cc930e24072b6 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 2 May 2025 18:00:08 -0700 Subject: [PATCH 43/49] wrangle option :no-index: to :index: for sphinx < 7.2 --- plasmapy_sphinx/autodoc/automodapi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plasmapy_sphinx/autodoc/automodapi.py b/plasmapy_sphinx/autodoc/automodapi.py index 5ca8f16..05c3cac 100644 --- a/plasmapy_sphinx/autodoc/automodapi.py +++ b/plasmapy_sphinx/autodoc/automodapi.py @@ -308,7 +308,10 @@ from collections import OrderedDict from docutils.parsers.rst import directives from docutils.statemachine import StringList +from packaging.version import Version +from sphinx import __version__ as sphinx_version from sphinx.application import Sphinx +from typing import Any try: from sphinx.deprecation import RemovedInSphinx50Warning @@ -505,6 +508,15 @@ class ModAPIDocumenter(ModuleDocumenter): ), } + def __init__(self, *args: Any) -> None: + super().__init__(*args) + + if Version(sphinx_version) < Version("7.2") and "no-index" in self.options: + # sphinx started using :no-index: instead of the original :noindex: + # in version 7.2 + opt_value = self.options.pop("no-index") + self.options["noindex"] = opt_value + @property def grouping_info(self) -> Dict[str, Dict[str, Union[str, None]]]: """ From 5a7bf8d378744de217e7a67925c595e3581e41e7 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 2 May 2025 18:04:45 -0700 Subject: [PATCH 44/49] remove unused import --- plasmapy_sphinx/autodoc/automodapi.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plasmapy_sphinx/autodoc/automodapi.py b/plasmapy_sphinx/autodoc/automodapi.py index 05c3cac..77a981d 100644 --- a/plasmapy_sphinx/autodoc/automodapi.py +++ b/plasmapy_sphinx/autodoc/automodapi.py @@ -311,7 +311,6 @@ from packaging.version import Version from sphinx import __version__ as sphinx_version from sphinx.application import Sphinx -from typing import Any try: from sphinx.deprecation import RemovedInSphinx50Warning From 0d4e4deb9afc50e5df20da17955b1a613287a783 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 5 May 2025 16:30:46 -0700 Subject: [PATCH 45/49] remove unused import --- plasmapy_sphinx/automodsumm/generate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plasmapy_sphinx/automodsumm/generate.py b/plasmapy_sphinx/automodsumm/generate.py index 6700d5b..86314f6 100644 --- a/plasmapy_sphinx/automodsumm/generate.py +++ b/plasmapy_sphinx/automodsumm/generate.py @@ -27,7 +27,6 @@ if False: # for annotation, does not need real import from sphinx.application import Sphinx - from sphinx.builders import Builder logger = logging.getLogger(__name__) From 0c2776da472fb4873a93d695e76fa85b256a1ac8 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 6 May 2025 16:31:39 -0700 Subject: [PATCH 46/49] add permissions statement --- .github/workflows/check_install.yml | 2 +- .github/workflows/mint-release.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_install.yml b/.github/workflows/check_install.yml index 20d94f0..4bfc11b 100644 --- a/.github/workflows/check_install.yml +++ b/.github/workflows/check_install.yml @@ -10,7 +10,7 @@ on: pull_request: workflow_dispatch: -permissions: {} +permissions: {} # disables all GitHub permissions for the workflow jobs: pip-install-and-import: diff --git a/.github/workflows/mint-release.yml b/.github/workflows/mint-release.yml index 8987170..1270d7f 100644 --- a/.github/workflows/mint-release.yml +++ b/.github/workflows/mint-release.yml @@ -8,6 +8,8 @@ on: required: true default: 0.1.0rc1 +permissions: {} # disables all GitHub permissions for the workflow + jobs: tag: From 6ffd298c43d0c27304ad6ff9dc7ce987efa3621b Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 6 May 2025 16:34:20 -0700 Subject: [PATCH 47/49] remove if-clause for importing importlib.metadata --- plasmapy_sphinx/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plasmapy_sphinx/__init__.py b/plasmapy_sphinx/__init__.py index 00ca5b5..cdefa04 100644 --- a/plasmapy_sphinx/__init__.py +++ b/plasmapy_sphinx/__init__.py @@ -73,10 +73,7 @@ if sys.version_info < (3, 8): # coverage: ignore raise ImportError("plasmapy_sphinx does not support Python < 3.8") -if sys.version_info >= (3, 8): - from importlib.metadata import version, PackageNotFoundError -else: - from importlib_metadata import version, PackageNotFoundError +from importlib.metadata import version, PackageNotFoundError from plasmapy_sphinx import autodoc, automodsumm, directives, utils From e748b95bb9df2d05e7e396a1256527f3c1591b83 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 6 May 2025 17:18:26 -0700 Subject: [PATCH 48/49] add build for sphinx<7.2 --- .github/workflows/documentation.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 86ab79a..692d3dc 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -51,6 +51,10 @@ jobs: matrix: include: + - python: '3.11' + os: ubuntu-latest + sphinx: sphinx<7.2 + - python: '3.12' os: ubuntu-latest sphinx: sphinx<7.4 From df142053c7297ac000fccd22d924503d291ca51d Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 6 May 2025 17:27:04 -0700 Subject: [PATCH 49/49] update actions/setup-python@v4 to actions/setup-python@v5 --- .github/workflows/check_install.yml | 2 +- .github/workflows/documentation.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_install.yml b/.github/workflows/check_install.yml index 4bfc11b..f3465f7 100644 --- a/.github/workflows/check_install.yml +++ b/.github/workflows/check_install.yml @@ -30,7 +30,7 @@ jobs: fetch-depth: 1 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: pip diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 692d3dc..fa71235 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -29,7 +29,7 @@ jobs: with: fetch-depth: 1 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: pip @@ -69,7 +69,7 @@ jobs: with: fetch-depth: 1 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: pip