Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d6ba68

Browse files
authoredMar 15, 2025··
Add mypy type checker to GitHub Actions (#1056)
* Fix yaml formatting * Bump actions versions to latest * Bump pipenv version to latest * Add mypy lint action * Fix mypy lint errors * Suppress warnings about unchecked function bodies for now * Add deprecation comment * Log OperationalError exception traces
1 parent fac8a5b commit 9d6ba68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+619
-276
lines changed
 

‎.github/workflows/doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313

1414
- name: Setup Python
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: '3.10'
1818

‎.github/workflows/lint.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
isort:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- name: Setup Python
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.10'
2222

@@ -28,10 +28,10 @@ jobs:
2828
flake8:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232

3333
- name: Setup Python
34-
uses: actions/setup-python@v4
34+
uses: actions/setup-python@v5
3535
with:
3636
python-version: '3.10'
3737

@@ -40,13 +40,40 @@ jobs:
4040
flake8_version: 6.0.0
4141
plugins: flake8-quotes~=3.3
4242

43+
mypy:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Create requirements file
49+
run: |
50+
pip install pipenv==2024.4.1
51+
pipenv requirements --dev > requirements.txt
52+
53+
# Mypy-check runs inside its own docker image
54+
- uses: jpetrucciani/mypy-check@master
55+
with:
56+
python_version: '3.10'
57+
requirements: |
58+
types-PyYAML
59+
types-PyMySQL
60+
types-cachetools
61+
requirements_file: requirements.txt
62+
mypy_flags: |
63+
--disable-error-code=annotation-unchecked
64+
--follow-untyped-imports
65+
--strict-equality
66+
--warn-redundant-casts
67+
--warn-unused-ignores
68+
path: server/ main.py
69+
4370
pipenv-verify:
4471
runs-on: ubuntu-latest
4572
steps:
46-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
4774

4875
- name: Setup Python
49-
uses: actions/setup-python@v4
76+
uses: actions/setup-python@v5
5077
with:
5178
python-version: '3.10'
5279

0 commit comments

Comments
 (0)
Please sign in to comment.