File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,33 @@ jobs:
171171 run : ruff format --check --diff
172172 - name : Run ruff check
173173 run : ruff check tidy3d
174-
174+
175+ mypy :
176+ name : static-type-checks (mypy)
177+ needs : determine-test-scope
178+ if : needs.determine-test-scope.outputs.code_quality_tests == 'true'
179+ runs-on : ubuntu-latest
180+ steps :
181+ - uses : actions/checkout@v4
182+ with :
183+ fetch-depth : 1
184+ submodules : false
185+ persist-credentials : false
186+
187+ - name : set-python-3.10
188+ uses : actions/setup-python@v4
189+ with :
190+ python-version : ' 3.10'
191+
192+ - name : Install mypy
193+ run : |
194+ python -m pip install --upgrade pip
195+ pip install "mypy==1.13.0"
196+
197+ - name : Run mypy
198+ run : |
199+ mypy --config-file=pyproject.toml
200+
175201 zizmor :
176202 name : Run zizmor 🌈
177203 runs-on : ubuntu-latest
@@ -637,6 +663,7 @@ jobs:
637663 - local-tests
638664 - remote-tests
639665 - lint
666+ - mypy
640667 - verify-schema-change
641668 - lint-commit-messages
642669 - lint-branch-name
@@ -656,6 +683,12 @@ jobs:
656683 run : |
657684 echo "❌ Linting failed."
658685 exit 1
686+
687+ - name : check-mypy-result
688+ if : ${{ needs.determine-test-scope.outputs.code_quality_tests == 'true' && needs.mypy.result != 'success' }}
689+ run : |
690+ echo "❌ Mypy type checking failed."
691+ exit 1
659692
660693 - name : check-schema-change-verification
661694 if : ${{ needs.verify-schema-change.result != 'success' }}
Original file line number Diff line number Diff line change 2929 hooks :
3030 - id : mypy
3131 name : mypy (type signatures)
32- files : ^tidy3d/web
32+ pass_filenames : false
3333 args :
3434 - --config-file=pyproject.toml
Original file line number Diff line number Diff line change @@ -317,6 +317,9 @@ python_files = "*.py"
317317
318318[tool .mypy ]
319319python_version = " 3.10"
320+ files = [
321+ " tidy3d/web" ,
322+ ]
320323ignore_missing_imports = true
321324follow_imports = " skip"
322325disallow_untyped_defs = true
You can’t perform that action at this time.
0 commit comments