-
Notifications
You must be signed in to change notification settings - Fork 66
feat(tidy3d): FXC-3573 add mypy to CI #2939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (2)
-
.github/workflows/tidy3d-python-client-tests.yml, line 661-669 (link)logic: Add
mypyjob to the needs list since it's a code quality check that should be required for PR approval -
.github/workflows/tidy3d-python-client-tests.yml, line 670-679 (link)logic: Add mypy result check similar to other code quality checks
- name: check-mypy-result if: ${{ needs.determine-test-scope.outputs.code_quality_tests == 'true' && needs.mypy.result != 'success' }} run: | echo "❌ Mypy type checking failed." exit 1
3 files reviewed, 3 comments
652f5dd to
0469f9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, no comments
yaugenst-flex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changesNo lines with coverage information in this diff. |
Add mypy checks to our CI pipeline.
Is done immediately after linting and uses the config from pyproject.toml.
Greptile Overview
Updated On: 2025-10-29 15:37:34 UTC
Greptile Summary
Adds mypy static type checking to the CI pipeline to enforce type safety in the
tidy3d/webdirectory. The implementation is clean and well-integrated.Key Changes:
mypyjob in CI workflow that runs after the determine-test-scope job (only whencode_quality_tests == true)pyproject.tomlfiles: ^tidy3d/web) to config-based filtering (pass_filenames: false)files = ["tidy3d/web"]configuration inpyproject.tomlto specify the directory for type checkingpr-requirements-passwith a dedicated validation step that fails the pipeline if type checks failImplementation Notes:
determine-test-scopeand only runs when code quality tests are enabledpyproject.toml), ensuring consistencyConfidence Score: 5/5
Important Files Changed
File Analysis
files: ^tidy3d/web) to config-based filtering (pass_filenames: false), correctly delegating file selection to pyproject.tomlfiles = ["tidy3d/web"]to mypy configuration to specify which directory to type check, properly configured to work with CI and pre-commit hookSequence Diagram
sequenceDiagram participant PR as Pull Request participant Scope as determine-test-scope participant Lint as lint job participant Mypy as mypy job participant Final as pr-requirements-pass PR->>Scope: Trigger workflow Scope->>Scope: Determine if code_quality_tests=true alt code_quality_tests == true Scope->>Lint: Run ruff linting Scope->>Mypy: Run mypy type checks Lint->>Lint: Check formatting and style Lint-->>Final: Report result Mypy->>Mypy: Checkout code Mypy->>Mypy: Setup Python 3.10 Mypy->>Mypy: Install mypy==1.13.0 Mypy->>Mypy: Run mypy --config-file=pyproject.toml Note over Mypy: Reads files from pyproject.toml<br/>(tidy3d/web directory) Mypy-->>Final: Report result Final->>Final: Check lint result Final->>Final: Check mypy result (if code_quality_tests) Final->>Final: Validate all required jobs Final-->>PR: Pass/Fail result end