From e71a850a19045c85e4b44d9185e5957e9377a4cd Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 11 Sep 2024 08:53:44 +0200 Subject: [PATCH] Run mypy in CI (#59) --- .github/workflows/ci.yaml | 12 ++++++++++++ .pre-commit-config.yaml | 4 ---- pyproject.toml | 18 ++++++------------ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dc1b21f..238e998 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,3 +97,15 @@ jobs: name: coverage-html path: htmlcov if: ${{ failure() }} + + mypy: + runs-on: ubuntu-latest + needs: build + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - uses: astral-sh/setup-uv@v2 + - run: uvx mypy src diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be1af74..28bf549 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -86,7 +86,3 @@ repos: rev: "v0.6.4" hooks: - id: ruff - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 - hooks: - - id: mypy diff --git a/pyproject.toml b/pyproject.toml index 41437e8..2a501f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,17 +89,11 @@ parallel = true plugins = [ "covdefaults" ] [tool.mypy] -python_version = 3.9 -check_untyped_defs = true -disallow_any_generics = true -disallow_incomplete_defs = true -disallow_untyped_defs = true -warn_redundant_casts = true -warn_unused_ignores = true +strict = true +pretty = true +python_version = "3.9" +enable_error_code = [ "ignore-without-code" ] [[tool.mypy.overrides]] -module = [ "tests.*" ] -ignore_missing_imports = true -check_untyped_defs = false -disallow_incomplete_defs = false -disallow_untyped_defs = false +module = "tests.*" +ignore_errors = true