Skip to content

Commit

Permalink
Split Mypy checks into external and internal
Browse files Browse the repository at this point in the history
Since the error codes change across versions, it's too complicated
(and kinda pointless) to test our code on all versions.
  • Loading branch information
hynek committed Jun 2, 2023
1 parent df3b71b commit 5acd326
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,18 @@ jobs:
- run: python -Im tox run -e system-argon2

mypy:
name: Mypy on ${{ matrix.python-version }}
mypy-all:
name: Mypy for API & own code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4

- run: python -Im pip install --upgrade wheel tox
- run: python -Im tox run -e mypy-api

mypy-api:
name: Mypy for API on ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -132,7 +142,7 @@ jobs:
allow-prereleases: true

- run: python -Im pip install --upgrade wheel tox
- run: python -Im tox run -e mypy
- run: python -Im tox run -e mypy-api

docs:
name: Build docs & run doctests
Expand Down
12 changes: 9 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
min_version = 4
env_list =
pre-commit,
mypy,
mypy-{all,api},
py37,
py38,
py39,
Expand Down Expand Up @@ -33,12 +33,18 @@ deps = pre-commit
commands = pre-commit run --all-files


[testenv:mypy]
description = Check types
[testenv:mypy-all]
description = Check package and API.
deps = mypy
commands = mypy src typing_examples.py


[testenv:mypy-api]
description = Check API types.
deps = mypy
commands = mypy typing_examples.py


[testenv]
description = Run tests and do NOT measure coverage.
extras = tests
Expand Down

0 comments on commit 5acd326

Please sign in to comment.