Type checking for Python code - #3382
Merged
Merged
Conversation
fedimser
marked this pull request as ready for review
June 24, 2026 21:10
fedimser
requested review from
billti,
brad-lackey,
idavis,
minestarks,
msoeken and
swernli
as code owners
June 24, 2026 21:10
fedimser
force-pushed
the
fedimser/mypy-1
branch
from
June 24, 2026 23:42
95db772 to
44ec379
Compare
msoeken
reviewed
Jun 25, 2026
amcasey
reviewed
Jul 10, 2026
idavis
reviewed
Jul 13, 2026
idavis
reviewed
Jul 13, 2026
idavis
reviewed
Jul 13, 2026
idavis
reviewed
Jul 13, 2026
idavis
reviewed
Jul 13, 2026
idavis
reviewed
Jul 13, 2026
idavis
reviewed
Jul 13, 2026
idavis
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
build.py. Currently it only runs type checks using pyright, but more static checks (line length, linter, formatter) can be added here.Notes:
source/qdk_package/qdk.check_requirements.txtthat includes minimal dependencies that are required to run static checks. This minimizes setup time for CI workflow.The type checking can be done in multiple ways:
pyright- runs pyright directly../build.py --check-py- recommended. This installs required dependencies and runs mypy, and doesn't do anything else. If this passes locally, it's guaranteed that it will pass on CI.python ./build.py --check-py --no-check-prereqs- like above, but skips checking prerequisites (like wasm) which are irrelevant for Python. This is used in the CI workflow.build.pyin a way that includes building qdk and doesn't disable checks. This includesbuild.py --qdkandbuild.pywith no arguments.Missing checks (will be added in follow-up PRs):
"reportMissingParameterType": "error"and"typeCheckingMode": "strict"in pyrightconfig.json, we get 2745 errors. I plan to gradually fix them in a series of PRs.