From 1d126fef13c54c2a149142b59c01c7dad62033f8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:37:36 +0300 Subject: [PATCH] Move mypy to tox --- .github/workflows/lint.yml | 10 ++++++++++ .pre-commit-config.yaml | 8 -------- tox.ini | 8 ++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d553e49..1d7c867 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,3 +20,13 @@ jobs: python-version: "3.x" cache: pip - uses: pre-commit/action@v3.0.1 + + mypy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: hynek/setup-cached-uv@v2 + - name: Mypy + run: uvx --with tox-uv tox -e mypy diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 371c9fa..f6cb6e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,14 +34,6 @@ repos: hooks: - id: actionlint - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 - hooks: - - id: mypy - additional_dependencies: [types-colorama] - args: [--pretty, --show-error-codes] - exclude: ^tests/ - - repo: https://github.com/tox-dev/pyproject-fmt rev: 2.2.4 hooks: diff --git a/tox.ini b/tox.ini index ae8d665..1a7b80a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ requires = tox>=4.2 env_list = lint + mypy py{py3, 313, 312, 311, 310, 39} [testenv] @@ -27,3 +28,10 @@ pass_env = PRE_COMMIT_COLOR commands = pre-commit run --all-files --show-diff-on-failure + +[testenv:mypy] +deps = + mypy==1.11.2 + types-colorama +commands = + mypy . {posargs} --exclude tests