diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd0644e..72f8d01 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.29.4 + rev: 0.30.0 hooks: - id: check-github-workflows args: ["--verbose"] @@ -15,7 +15,7 @@ repos: - id: codespell additional_dependencies: ["tomli>=2.0.1"] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.22 + rev: v0.23 hooks: - id: validate-pyproject - repo: https://github.com/tox-dev/pyproject-fmt @@ -23,14 +23,14 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.2" + rev: "v0.8.3" hooks: - id: ruff-format args: ["--config", "pyproject.toml"] - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix", "--config", "pyproject.toml"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.3.3" + rev: "v3.4.2" hooks: - id: prettier name: Prettier non-workflow files diff --git a/pyproject-fmt/src/pyproject_fmt/__main__.py b/pyproject-fmt/src/pyproject_fmt/__main__.py index 5217915..0714da0 100644 --- a/pyproject-fmt/src/pyproject_fmt/__main__.py +++ b/pyproject-fmt/src/pyproject_fmt/__main__.py @@ -3,12 +3,15 @@ from __future__ import annotations from argparse import ArgumentParser, ArgumentTypeError -from typing import Sequence +from typing import TYPE_CHECKING from toml_fmt_common import ArgumentGroup, FmtNamespace, TOMLFormatter, _build_cli, run # noqa: PLC2701 from ._lib import Settings, format_toml +if TYPE_CHECKING: + from collections.abc import Sequence + class PyProjectFmtNamespace(FmtNamespace): """Formatting arguments.""" diff --git a/tasks/changelog.py b/tasks/changelog.py index 86579e5..280d48e 100644 --- a/tasks/changelog.py +++ b/tasks/changelog.py @@ -14,7 +14,7 @@ from argparse import ArgumentParser, Namespace from datetime import UTC, datetime from pathlib import Path -from typing import TYPE_CHECKING, Iterator +from typing import TYPE_CHECKING from git import Repo from github import Github, Repository @@ -22,6 +22,8 @@ from tomllib import load if TYPE_CHECKING: + from collections.abc import Iterator + from github.Repository import Repository as GitHubRepository ROOT = Path(__file__).parents[1] diff --git a/tox-toml-fmt/src/tox_toml_fmt/__main__.py b/tox-toml-fmt/src/tox_toml_fmt/__main__.py index 42775de..b21fa2f 100644 --- a/tox-toml-fmt/src/tox_toml_fmt/__main__.py +++ b/tox-toml-fmt/src/tox_toml_fmt/__main__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence +from typing import TYPE_CHECKING from toml_fmt_common import ArgumentGroup, FmtNamespace, TOMLFormatter, _build_cli, run # noqa: PLC2701 @@ -10,6 +10,7 @@ if TYPE_CHECKING: from argparse import ArgumentParser + from collections.abc import Sequence class PyProjectFmtNamespace(FmtNamespace):