diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 71c11242..6f0a31a1 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -61,3 +61,18 @@ jobs: run: python3 -m pip install -r doc/requirements.txt -e . - name: Build docs run: make -C doc html + + mypy: + continue-on-error: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: | + 'pyproject.toml' + 'requirements-dev.txt' + - run: pip install -r requirements-dev.txt -e . + - run: mypy --config-file pyproject.toml . diff --git a/pyproject.toml b/pyproject.toml index a87ba589..e9c85993 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,3 +48,11 @@ testpaths = [ filterwarnings = [ "ignore::DeprecationWarning", ] + +[tool.mypy] +python_version = "3.8" +exclude = [ + "^examples*", + "^test*", + "^setup.py*", +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 1a1c1f37..23f3a7aa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ +mypy~=1.10 pytest~=8.3 pytest-cov~=5.0