diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97c669e..00ca9a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,22 +12,26 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip pip install poetry poetry install --all-extras + - name: Pre-commit checks run: | - poetry run pre-commit run -a + poetry run -- pre-commit run --config .pre-commit-ci.yaml --all-files + - name: Test run: | poetry run pytest diff --git a/.pre-commit-config.yaml b/.pre-commit-ci.yaml similarity index 81% rename from .pre-commit-config.yaml rename to .pre-commit-ci.yaml index 27b0ce2..0621fca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-ci.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: trailing-whitespace exclude: ".*\\.md" @@ -13,13 +13,11 @@ repos: - id: check-added-large-files - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.1.2" + rev: "v0.7.3" hooks: - id: ruff name: Check python (ruff) - args: [--show-source, --fix, --show-fixes, --exit-non-zero-on-fix] - - id: ruff-format - name: Format python (ruff) + args: [--config, pyproject.toml] - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.21.0 diff --git a/pyproject.toml b/pyproject.toml index 4aa2853..ef1ad23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,7 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] target-version = "py311" +[tool.ruff.lint] select = [ "C90", # mccabe "C4", # flake8-comprehensions @@ -56,13 +57,5 @@ ignore = [ "RUF012", # mutable-class-default: Wants to annotate things like `__mapper_args__` with `ClassVar`, producing noise ] -# Do not remove unused imports automatically in __init__.py files -ignore-init-module-imports = true - -[tool.ruff.per-file-ignores] -"*/__init__.py" = [ - "F401" -] - -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 5