diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d4d9fdf..695f0c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,45 +14,45 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.10 + rev: v0.17.6 hooks: - id: ruff-check args: [--fix] - id: ruff-format - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.36.0 + rev: 0.40.0 hooks: - id: check-dependabot - id: check-github-workflows - repo: https://github.com/rhysd/actionlint - rev: v1.7.10 + rev: v1.7.12 hooks: - id: actionlint - - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.19.0 + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.33.1 hooks: - id: zizmor - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.11.1 + rev: v2.31.4 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.24.1 + rev: v0.27 hooks: - id: validate-pyproject - repo: https://github.com/tox-dev/tox-ini-fmt - rev: 1.7.1 + rev: 1.10.3 hooks: - id: tox-ini-fmt - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.7.4 + rev: v3.10.1 hooks: - id: prettier files: templates/switchers.js diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index 47cbf74..0000000 --- a/.ruff.toml +++ /dev/null @@ -1,34 +0,0 @@ -target-version = "py313" # Pin Ruff to Python 3.13 -line-length = 88 -output-format = "full" - -[format] -preview = true -docstring-code-format = true - -[lint] -preview = true -select = [ - "C4", # flake8-comprehensions - "B", # flake8-bugbear - "E", # pycodestyle - "F", # pyflakes - "FA", # flake8-future-annotations - "FLY", # flynt - "G", # flake8-logging-format - "I", # isort - "N", # pep8-naming - "PERF", # perflint - "PGH", # pygrep-hooks - "PT", # flake8-pytest-style - "TC", # flake8-type-checking - "UP", # pyupgrade - "W", # pycodestyle -] -ignore = [ - "E501", # Ignore line length errors (we use auto-formatting) -] - -[lint.flake8-type-checking] -exempt-modules = [] -strict = true diff --git a/build_docs.py b/build_docs.py index efc6591..eb126a0 100755 --- a/build_docs.py +++ b/build_docs.py @@ -73,7 +73,7 @@ TYPE_CHECKING = False if TYPE_CHECKING: - from collections.abc import Collection, Iterator, Sequence, Set + from collections.abc import Collection, Generator, Iterator, Sequence, Set from typing import Literal try: @@ -559,7 +559,7 @@ def edit(file: Path): @contextmanager def wait_for_lock( path: Path, timeout: float = 600, poll_interval: float = 10 -) -> Iterator[None]: +) -> Generator[None]: """Context manager to hold *path* as a lock file, waiting up to *timeout* seconds for it.""" deadline = perf_counter() + timeout while True: diff --git a/pyproject.toml b/pyproject.toml index e85ab2e..771a4e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,34 @@ -[tool.pytest.ini_options] +[tool.ruff] +target-version = "py313" # Pin Ruff to Python 3.13 +line-length = 88 +output-format = "full" +format.preview = true +format.docstring-code-format = true +lint.select = [ + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "E", # pycodestyle + "F", # pyflakes + "FA", # flake8-future-annotations + "FLY", # flynt + "G", # flake8-logging-format + "I", # isort + "N", # pep8-naming + "PERF", # perflint + "PGH", # pygrep-hooks + "PT", # flake8-pytest-style + "TC", # flake8-type-checking + "UP", # pyupgrade + "W", # pycodestyle +] +lint.ignore = [ + "E501", # Ignore line length errors (we use auto-formatting) +] +lint.flake8-type-checking.exempt-modules = [] +lint.flake8-type-checking.strict = true +lint.preview = true + +[tool.pytest] +minversion = "9.0" pythonpath = [ "." ] testpaths = [ "tests" ] diff --git a/tox.ini b/tox.ini index 9047969..a1f7db1 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ wheel_build_env = .pkg skip_install = true deps = -r requirements.txt - pytest + pytest>=9 pytest-cov pass_env = FORCE_COLOR