From d5d57d276475aedd35e1d1ab757fcc3c9ea11e15 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 16:50:00 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.12.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.12.3) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.16.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.16.1) --- .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 9498e32..69250ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,21 +5,21 @@ exclude: ^tests/.*\.md|tests/.*\.rst|tests/.*\.xml|docs/apidocs/.* repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.4 + rev: v0.12.3 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.16.1 hooks: - id: mypy args: [--config-file=pyproject.toml] From 40a790d96a5ffa5dc8067a61380f33d11845de64 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 16:51:12 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/conf.py | 7 ++++--- src/autodoc2/cli.py | 2 +- tests/test_analyse_module.py | 3 ++- tests/test_render.py | 7 ++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e2a02b3..5dc85cb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -96,11 +96,12 @@ import typing as t # noqa: E402 -from autodoc2.config import CONFIG_PREFIX, Config, PackageConfig # noqa: E402 from docutils import nodes # noqa: E402 from sphinx.application import Sphinx # noqa: E402 from sphinx.util.docutils import SphinxDirective # noqa: E402 +from autodoc2.config import CONFIG_PREFIX, Config, PackageConfig # noqa: E402 + def setup(app: Sphinx) -> None: app.add_object_type( @@ -122,7 +123,7 @@ def run(self) -> t.List[nodes.Node]: config = Config() for name, value, field in config.as_triple(): text.append(f"``````{{confval}} {CONFIG_PREFIX}{name}") - text.append(f'{field.metadata.get("help", "")}') + text.append(f"{field.metadata.get('help', '')}") text.append("") # if "category" in field.metadata: # text.append(f"**category**: { field.metadata['category']}") @@ -156,7 +157,7 @@ def run(self) -> t.List[nodes.Node]: pkg_config = PackageConfig("") for name, value, field in pkg_config.as_triple(): text.append(f"``````{{confval}} {CONFIG_PREFIX}packages[{name}]") - text.append(f'{field.metadata.get("help", "")}') + text.append(f"{field.metadata.get('help', '')}") text.append("") type_ = type_to_string(field.type) text.append(f"**type**: {type_}") diff --git a/src/autodoc2/cli.py b/src/autodoc2/cli.py index 5ff7b60..8d3d14f 100644 --- a/src/autodoc2/cli.py +++ b/src/autodoc2/cli.py @@ -109,7 +109,7 @@ def list_items( if not private and data["full_name"].split(".")[-1].startswith("_"): continue if one_line: - console.print(f'{data["full_name"]} ({data["type"]})') + console.print(f"{data['full_name']} ({data['type']})") else: console.print(data) diff --git a/tests/test_analyse_module.py b/tests/test_analyse_module.py index 93e7192..0133c71 100644 --- a/tests/test_analyse_module.py +++ b/tests/test_analyse_module.py @@ -4,9 +4,10 @@ import typing as t -from autodoc2.analysis import analyse_module import pytest +from autodoc2.analysis import analyse_module + def clean_item(item: dict[str, t.Any]) -> dict[str, t.Any]: """Remove non-deterministic data.""" diff --git a/tests/test_render.py b/tests/test_render.py index e4b3148..36ef497 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -4,6 +4,10 @@ from pathlib import Path from textwrap import dedent +import pytest +from sphinx.testing.util import SphinxTestApp +from sphinx.testing.util import path as sphinx_path + from autodoc2.analysis import analyse_module from autodoc2.config import Config from autodoc2.db import InMemoryDb @@ -11,9 +15,6 @@ from autodoc2.render.myst_ import MystRenderer from autodoc2.render.rst_ import RstRenderer from autodoc2.utils import yield_modules -import pytest -from sphinx.testing.util import SphinxTestApp -from sphinx.testing.util import path as sphinx_path @pytest.mark.parametrize(