Skip to content

Commit

Permalink
Run mypy in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Oct 19, 2023
1 parent 50e54c2 commit 4b1f4f3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
Expand All @@ -23,6 +21,19 @@ jobs:
with:
commit_message: Apply automatic formatting

type-checking:
name: Type checking
needs: formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: tox -e mypy

tests:
name: Tests ${{ matrix.os }} ${{ matrix.tox }}
needs: formatting
Expand All @@ -41,8 +52,6 @@ jobs:
- run: sudo apt install --yes docker-compose
if: ${{ contains(matrix.variant.os, 'ubuntu') }}
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Deprecations
Stability, Maintainability, and Testing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* The codebase now gets type-checked in CI.

v23.08.0 (2023-08-28)
---------------------

Expand Down
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ allowlist_externals = sh
# either the different formatters can't agree on a format or that static analysis failed.
commands = sh -c 'pre-commit run -a || (echo "" && pre-commit run -a)'

[testenv:mypy]
description = Type checking (mypy)
deps = -r requirements/mypy.txt
commands = python -m mypy .

[testenv:deps]
description = Update dependencies by running pip-compile-multi
deps = pip-compile-multi
Expand Down

0 comments on commit 4b1f4f3

Please sign in to comment.