From 175cae3bfb2669812ca6c7a0ce685aba0ffe1e63 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:26:03 -0500 Subject: [PATCH 01/25] [pre-commit.ci] pre-commit autoupdate (#542) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.6 → v0.11.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.6...v0.11.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edf68afe..0fae1d1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.6" + rev: "v0.11.7" hooks: - id: ruff-format - id: ruff From 0e339b75557fe738b7b2273a0d61cd2399874e5b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 15:15:18 -0500 Subject: [PATCH 02/25] [pre-commit.ci] pre-commit autoupdate (#543) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.7 → v0.11.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.7...v0.11.8) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0fae1d1f..a78a831d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.7" + rev: "v0.11.8" hooks: - id: ruff-format - id: ruff From 16c1b2c3531583ed119139f9045361bab28f97e2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 09:49:44 -0500 Subject: [PATCH 03/25] [pre-commit.ci] pre-commit autoupdate (#544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.11.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.8...v0.11.9) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a78a831d..f027026b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.8" + rev: "v0.11.9" hooks: - id: ruff-format - id: ruff From 0860f997b3a0668b3a42a6c4b969ec77bb89035e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 12:55:25 -0500 Subject: [PATCH 04/25] [pre-commit.ci] pre-commit autoupdate (#545) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.9 → v0.11.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.9...v0.11.10) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f027026b..c1ac3778 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.9" + rev: "v0.11.10" hooks: - id: ruff-format - id: ruff From 3c82b0daea54f61af483ef8011a69a3b72d74c17 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 09:39:51 -0500 Subject: [PATCH 05/25] [pre-commit.ci] pre-commit autoupdate (#546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/tox-dev/pyproject-fmt: v2.5.1 → v2.6.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.5.1...v2.6.0) - [github.com/astral-sh/ruff-pre-commit: v0.11.10 → v0.11.11](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.10...v0.11.11) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1ac3778..febe2f68 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.5.1" + rev: "v2.6.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.10" + rev: "v0.11.11" hooks: - id: ruff-format - id: ruff From ec7e0ded00b6232103c16a29a4a0994ae5ecf017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Mon, 9 Jun 2025 08:37:20 -0500 Subject: [PATCH 06/25] Fix the CI failing due to type error (#548) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- src/sphinx_autodoc_typehints/patches.py | 7 ++++--- tox.ini | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sphinx_autodoc_typehints/patches.py b/src/sphinx_autodoc_typehints/patches.py index 236b38dd..583ed498 100644 --- a/src/sphinx_autodoc_typehints/patches.py +++ b/src/sphinx_autodoc_typehints/patches.py @@ -103,7 +103,7 @@ def _patched_base_admonition_run(self: BaseAdmonition) -> Any: def _patched_text_indent(self: Text, *args: Any) -> Any: _, line = self.state_machine.get_source_and_line() - result = orig_text_indent(self, *args) + result = orig_text_indent(self, *args) # type: ignore[no-untyped-call] node = self.parent[-1] if node.tagname == "system_message": node = self.parent[-2] @@ -114,6 +114,7 @@ def _patched_text_indent(self: Text, *args: Any) -> Any: def _patched_body_doctest( self: Body, _match: None, _context: None, next_state: str | None ) -> tuple[list[Any], str | None, list[Any]]: + assert self.document.current_line is not None # noqa: S101 line = self.document.current_line + 1 data = "\n".join(self.state_machine.get_text_block()) n = nodes.doctest_block(data, data) @@ -128,9 +129,9 @@ def _patch_line_numbers() -> None: When the line numbers are missing, we have a hard time placing the :rtype:. """ - Text.indent = _patched_text_indent + Text.indent = _patched_text_indent # type: ignore[method-assign] BaseAdmonition.run = _patched_base_admonition_run # type: ignore[method-assign,assignment] - Body.doctest = _patched_body_doctest + Body.doctest = _patched_body_doctest # type: ignore[method-assign] def install_patches(app: Sphinx) -> None: diff --git a/tox.ini b/tox.ini index 07cd05ab..87924c5a 100644 --- a/tox.ini +++ b/tox.ini @@ -45,7 +45,7 @@ commands = description = run type check on code base deps = mypy==1.15 - types-docutils>=0.21.0.20241128 + types-docutils>=0.21.0.20250604 commands = mypy src mypy tests From 6df6e0c19a8ac6bb6975109c59bf2112b30fffdd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 20:59:41 -0700 Subject: [PATCH 07/25] [pre-commit.ci] pre-commit autoupdate (#547) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.11 → v0.11.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.11...v0.11.13) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index febe2f68..e3940ea3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.11" + rev: "v0.11.13" hooks: - id: ruff-format - id: ruff From a42ee47aee0d727c4243a873fb26fc209d06ea12 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:13:42 -0700 Subject: [PATCH 08/25] [pre-commit.ci] pre-commit autoupdate (#549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.33.0 → 0.33.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.33.0...0.33.1) - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.12.1) - [github.com/rbubley/mirrors-prettier: v3.5.3 → v3.6.2](https://github.com/rbubley/mirrors-prettier/compare/v3.5.3...v3.6.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3940ea3..c909c3c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.33.0" + rev: "0.33.1" hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.13" + rev: "v0.12.1" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.5.3" # Use the sha / tag you want to point at + rev: "v3.6.2" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From fea5e1401e9b953fdc7675c8c11fda178592a762 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 08:02:53 -0700 Subject: [PATCH 09/25] [pre-commit.ci] pre-commit autoupdate (#550) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.33.1 → 0.33.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.33.1...0.33.2) - [github.com/astral-sh/ruff-pre-commit: v0.12.1 → v0.12.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.1...v0.12.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c909c3c2..7d519f83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.33.1" + rev: "0.33.2" hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.1" + rev: "v0.12.2" hooks: - id: ruff-format - id: ruff From 7f94014613d6074a2303c82e20510167fc622877 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 12:08:19 -0700 Subject: [PATCH 10/25] [pre-commit.ci] pre-commit autoupdate (#551) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.2 → v0.12.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.2...v0.12.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d519f83..ea87c5d4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.2" + rev: "v0.12.3" hooks: - id: ruff-format - id: ruff From 9b3a613693e9ab521f23cc14f7df3d66fa607a32 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:57:35 -0700 Subject: [PATCH 11/25] [pre-commit.ci] pre-commit autoupdate (#552) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.3 → v0.12.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.3...v0.12.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea87c5d4..ec580b65 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.3" + rev: "v0.12.4" hooks: - id: ruff-format - id: ruff From 3e9d99b83b0f6660cb90b1b0c02ebe1000814540 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 10:26:59 -0700 Subject: [PATCH 12/25] [pre-commit.ci] pre-commit autoupdate (#555) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.4 → v0.12.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.4...v0.12.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec580b65..75a0cf2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.4" + rev: "v0.12.5" hooks: - id: ruff-format - id: ruff From eab2076b806a56d14e20467827e2ea7548febf35 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 10:20:24 -0700 Subject: [PATCH 13/25] [pre-commit.ci] pre-commit autoupdate (#556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/tox-dev/tox-ini-fmt: 1.5.0 → 1.6.0](https://github.com/tox-dev/tox-ini-fmt/compare/1.5.0...1.6.0) - [github.com/astral-sh/ruff-pre-commit: v0.12.5 → v0.12.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.5...v0.12.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 75a0cf2b..beb8494c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: codespell additional_dependencies: ["tomli>=2.2.1"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.5.0" + rev: "1.6.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.5" + rev: "v0.12.7" hooks: - id: ruff-format - id: ruff From e9db2aaee73c6dfe466cde83ea502dc4c33c2fb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 07:08:39 -0700 Subject: [PATCH 14/25] Bump actions/download-artifact from 4 to 5 (#557) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4ff55fb3..f799d38d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,7 +38,7 @@ jobs: id-token: write steps: - name: Download all the dists - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: ${{ env.dists-artifact-name }} path: dist/ From 3f85e9bc1d600bf70b34c0da4998495d16fcbf7d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:30:52 -0700 Subject: [PATCH 15/25] [pre-commit.ci] pre-commit autoupdate (#558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.12.7 → v0.12.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.7...v0.12.8) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index beb8494c..0fa23e6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.7" + rev: "v0.12.8" hooks: - id: ruff-format - id: ruff From 8944f8553600d6155ac76bc4ccb893f229a53a88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 11:00:37 -0700 Subject: [PATCH 16/25] Bump actions/checkout from 4 to 5 (#559) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index f5461118..9da6aa70 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -28,7 +28,7 @@ jobs: steps: - name: Install OS dependencies run: sudo apt-get install graphviz -y - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install the latest version of uv diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f799d38d..6c2ff209 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install the latest version of uv From 7dd4a4e73f64840611aa5931050a52f418dea62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 20 Aug 2025 06:36:06 -0700 Subject: [PATCH 17/25] Ignore type checker error breaking the CI (#561) --- src/sphinx_autodoc_typehints/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sphinx_autodoc_typehints/__init__.py b/src/sphinx_autodoc_typehints/__init__.py index 1394f734..7a45ec14 100644 --- a/src/sphinx_autodoc_typehints/__init__.py +++ b/src/sphinx_autodoc_typehints/__init__.py @@ -877,7 +877,7 @@ def get_insert_index(app: Sphinx, lines: list[str]) -> InsertIndexInfo | None: # 3. Insert after the parameters. # To find the parameters, parse as a docutils tree. - settings = get_default_settings(RSTParser) + settings = get_default_settings(RSTParser) # type: ignore[arg-type] settings.env = app.env doc = parse("\n".join(lines), settings) From 80cc5f0165c8144f4ed45f92e28a3c2ad4526a57 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:54:21 +0000 Subject: [PATCH 18/25] [pre-commit.ci] pre-commit autoupdate (#560) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.33.2 → 0.33.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.33.2...0.33.3) - [github.com/astral-sh/ruff-pre-commit: v0.12.8 → v0.12.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.8...v0.12.10) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0fa23e6b..afaa9bdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.33.2" + rev: "0.33.3" hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.8" + rev: "v0.12.10" hooks: - id: ruff-format - id: ruff From 614310250f06c258839737b349fa0c81ff937999 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:45:39 -0700 Subject: [PATCH 19/25] [pre-commit.ci] pre-commit autoupdate (#563) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afaa9bdf..0ab47e1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.10" + rev: "v0.12.11" hooks: - id: ruff-format - id: ruff From 876598b27d1cbcfb06e94f6c8c4dbeb6a5431451 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 07:14:36 -0700 Subject: [PATCH 20/25] Bump pypa/gh-action-pypi-publish from 1.12.4 to 1.13.0 (#564) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6c2ff209..4f5931ab 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.4 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: attestations: true From a643e359b6743e6cf0f0ae9b4587e640dfc1c06c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 09:03:21 -0700 Subject: [PATCH 21/25] Bump pypa/gh-action-pypi-publish in /.github/workflows (#565) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From a493b1118d9a09578054e77de85973888c0098d6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:35:32 -0700 Subject: [PATCH 22/25] [pre-commit.ci] pre-commit autoupdate (#566) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ab47e1d..b6003315 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.11" + rev: "v0.12.12" hooks: - id: ruff-format - id: ruff From 5278aac37f12da32049b5ca8c76772e0008a557e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:10:52 -0700 Subject: [PATCH 23/25] [pre-commit.ci] pre-commit autoupdate (#567) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6003315..1e2b6248 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.33.3" + rev: "0.34.0" hooks: - id: check-github-workflows args: ["--verbose"] @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.6.0" + rev: "v2.7.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.12" + rev: "v0.13.3" hooks: - id: ruff-format - id: ruff From 22ccfb9ecdecf44695aefa8c20f483e67073c02b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 07:07:59 -0700 Subject: [PATCH 24/25] Bump astral-sh/setup-uv from 6 to 7 (#568) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 9da6aa70..250c9b9d 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -32,7 +32,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@v7 with: enable-cache: true cache-dependency-glob: "pyproject.toml" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4f5931ab..a4c4f2f3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@v7 with: enable-cache: true cache-dependency-glob: "pyproject.toml" From 239cc7b2e1f379799127236a118d6cf4fa8c11f5 Mon Sep 17 00:00:00 2001 From: Dan Fuchs <330402+fajpunk@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:08:31 -0500 Subject: [PATCH 25/25] Warning types and subtypes (#562) Co-authored-by: aeisenbarth <54448967+aeisenbarth@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- README.md | 7 ++++ src/sphinx_autodoc_typehints/__init__.py | 38 ++++++++++++++++---- tests/test_integration.py | 45 ++++++++++++++++++------ 3 files changed, 74 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4da94768..384e226f 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,13 @@ The following configuration options are accepted: code or `None` to fall back to the default formatter. - `typehints_use_signature` (default: `False`): If `True`, typehints for parameters in the signature are shown. - `typehints_use_signature_return` (default: `False`): If `True`, return annotations in the signature are shown. +- `suppress_warnings`: sphinx-autodoc-typehints supports to suppress warning messages via Sphinx's `suppress_warnings`. It allows following additional warning types: + - `sphinx_autodoc_typehints` + - `sphinx_autodoc_typehints.comment` + - `sphinx_autodoc_typehints.forward_reference` + - `sphinx_autodoc_typehints.guarded_import` + - `sphinx_autodoc_typehints.local_function` + - `sphinx_autodoc_typehints.multiple_ast_nodes` ## How it works diff --git a/src/sphinx_autodoc_typehints/__init__.py b/src/sphinx_autodoc_typehints/__init__.py index 7a45ec14..c5475694 100644 --- a/src/sphinx_autodoc_typehints/__init__.py +++ b/src/sphinx_autodoc_typehints/__init__.py @@ -407,7 +407,12 @@ def _get_formatted_annotation(annotation: TypeVar) -> TypeVar: elif what == "method": # bail if it is a local method as we cannot determine if first argument needs to be deleted or not if "" in obj.__qualname__ and not _is_dataclass(name, what, obj.__qualname__): - _LOGGER.warning('Cannot handle as a local function: "%s" (use @functools.wraps)', name) + _LOGGER.warning( + 'Cannot handle as a local function: "%s" (use @functools.wraps)', + name, + type="sphinx_autodoc_typehints", + subtype="local_function", + ) return None outer = inspect.getmodule(obj) for class_name in obj.__qualname__.split(".")[:-1]: @@ -500,7 +505,9 @@ def _execute_guarded_code(autodoc_mock_imports: list[str], obj: Any, module_code with mock(autodoc_mock_imports): exec(guarded_code, getattr(obj, "__globals__", obj.__dict__)) # noqa: S102 except Exception as exc: # noqa: BLE001 - _LOGGER.warning("Failed guarded type import with %r", exc) + _LOGGER.warning( + "Failed guarded type import with %r", exc, type="sphinx_autodoc_typehints", subtype="guarded_import" + ) def _resolve_type_guarded_imports(autodoc_mock_imports: list[str], obj: Any) -> None: @@ -536,7 +543,13 @@ def _get_type_hint( else: result = {} except NameError as exc: - _LOGGER.warning('Cannot resolve forward reference in type annotations of "%s": %s', name, exc) + _LOGGER.warning( + 'Cannot resolve forward reference in type annotations of "%s": %s', + name, + exc, + type="sphinx_autodoc_typehints", + subtype="forward_reference", + ) result = obj.__annotations__ return result @@ -554,7 +567,13 @@ def backfill_type_hints(obj: Any, name: str) -> dict[str, Any]: # noqa: C901, P def _one_child(module: Module) -> stmt | None: children = module.body # use the body to ignore type comments if len(children) != 1: - _LOGGER.warning('Did not get exactly one node from AST for "%s", got %s', name, len(children)) + _LOGGER.warning( + 'Did not get exactly one node from AST for "%s", got %s', + name, + len(children), + type="sphinx_autodoc_typehints", + subtype="multiple_ast_nodes", + ) return None return children[0] @@ -579,7 +598,12 @@ def _one_child(module: Module) -> stmt | None: try: comment_args_str, comment_returns = type_comment.split(" -> ") except ValueError: - _LOGGER.warning('Unparseable type hint comment for "%s": Expected to contain ` -> `', name) + _LOGGER.warning( + 'Unparseable type hint comment for "%s": Expected to contain ` -> `', + name, + type="sphinx_autodoc_typehints", + subtype="comment", + ) return {} rv = {} @@ -594,7 +618,9 @@ def _one_child(module: Module) -> stmt | None: comment_args.insert(0, None) # self/cls may be omitted in type comments, insert blank if len(args) != len(comment_args): - _LOGGER.warning('Not enough type comments found on "%s"', name) + _LOGGER.warning( + 'Not enough type comments found on "%s"', name, type="sphinx_autodoc_typehints", subtype="comment" + ) return rv for at, arg in enumerate(args): diff --git a/tests/test_integration.py b/tests/test_integration.py index 9c1e3554..02369f88 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -31,6 +31,28 @@ W = NewType("W", str) +@dataclass +class WarningInfo: + """Properties and assertion methods for warnings.""" + + regexp: str + type: str + + def assert_regexp(self, message: str) -> None: + regexp = self.regexp + msg = f"Regex pattern did not match.\n Regex: {regexp!r}\n Input: {message!r}" + assert re.search(regexp, message), msg + + def assert_type(self, message: str) -> None: + expected = f"[{self.type}]" + msg = f"Warning did not contain type and subtype.\n Expected: {expected}\n Input: {message}" + assert expected in message, msg + + def assert_warning(self, message: str) -> None: + self.assert_regexp(message) + self.assert_type(message) + + def expected(expected: str, **options: dict[str, Any]) -> Callable[[T], T]: def dec(val: T) -> T: val.EXPECTED = expected @@ -40,9 +62,9 @@ def dec(val: T) -> T: return dec -def warns(pattern: str) -> Callable[[T], T]: +def warns(info: WarningInfo) -> Callable[[T], T]: def dec(val: T) -> T: - val.WARNING = pattern + val.WARNING = info return val return dec @@ -58,7 +80,7 @@ def wrapper(self) -> str: # noqa: ANN001 return wrapper -@warns("Cannot handle as a local function") +@warns(WarningInfo(regexp="Cannot handle as a local function", type="sphinx_autodoc_typehints.local_function")) @expected( """\ class mod.Class(x, y, z=None) @@ -330,7 +352,11 @@ def function_with_escaped_default(x: str = "\b"): # noqa: ANN201 """ -@warns("Cannot resolve forward reference in type annotations") +@warns( + WarningInfo( + regexp="Cannot resolve forward reference in type annotations", type="sphinx_autodoc_typehints.forward_reference" + ) +) @expected( """\ mod.function_with_unresolvable_annotation(x) @@ -1196,7 +1222,7 @@ def docstring_with_enum_list_after_params(param: int) -> None: """ -@warns("Definition list ends without a blank line") +@warns(WarningInfo(regexp="Definition list ends without a blank line", type="docutils")) @expected( """ mod.docstring_with_definition_list_after_params_no_blank_line(param) @@ -1457,7 +1483,7 @@ def has_doctest1() -> None: Unformatted = TypeVar("Unformatted") -@warns("cannot cache unpickleable configuration value: 'typehints_formatter'") +@warns(WarningInfo(regexp="cannot cache unpickleable configuration value: 'typehints_formatter'", type="config.cache")) @expected( """ mod.typehints_formatter_applied_to_signature(param: Formatted) -> Formatted @@ -1525,11 +1551,10 @@ def test_integration( app.build() assert "build succeeded" in status.getvalue() # Build succeeded - regexp = getattr(val, "WARNING", None) + warning_info: Union[WarningInfo, None] = getattr(val, "WARNING", None) value = warning.getvalue().strip() - if regexp: - msg = f"Regex pattern did not match.\n Regex: {regexp!r}\n Input: {value!r}" - assert re.search(regexp, value), msg + if warning_info: + warning_info.assert_warning(value) else: assert not value