Skip to content

Commit

Permalink
christiansandberggh-358: Add mypy CI and config
Browse files Browse the repository at this point in the history
Estalish a minimal mypy config that ensures annotations are compatible
with Python 3.8 (the oldest supported Python version).

Add a forgiving CI job that does not affect the status of the GitHub
workflow run.
  • Loading branch information
erlend-aasland committed Aug 11, 2024
1 parent 28ee18c commit 398d72c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,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.8"
cache: pip
cache-dependency-path: |
'pyproject.toml'
'requirements-dev.txt'
- run: pip install -r requirements-dev.txt
- run: mypy --config-file pyproject.toml .
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ testpaths = [
filterwarnings = [
"ignore::DeprecationWarning",
]

[tool.mypy]
python_version = "3.8"
exclude = [
"^examples*",
"^test*",
"^setup.py*",
]
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mypy~=1.10

0 comments on commit 398d72c

Please sign in to comment.