add mypy type checking to CI pipeline#608
Merged
gnachman merged 1 commit intognachman:masterfrom Mar 6, 2026
Merged
Conversation
- Add mypy and types-protobuf to requirements-dev.txt - Add mypy.ini with disable_error_code for import-not-found and import-untyped (AppKit/Foundation/google stubs unavailable) - Add "Run mypy" step to test.yml after pytest
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.
Summary
Now that the existing mypy errors in the SDK have been resolved (#595–#604), it might be worth adding mypy as a CI step to catch type issues going forward.
This PR adds a lightweight mypy check to the Python API CI (
api/library/python/iterm2/).Changes
.github/workflows/test.ymlpython-testsjobapi/library/python/iterm2/mypy.ini(new)disable_error_code = import-not-found, import-untyped— suppresses errors for unavailable stubs (AppKit, Foundation, google.protobuf internals) that can't be resolved in CIapi/library/python/iterm2/requirements-dev.txtmypy>=1.0.0andtypes-protobufNotes
mypy.iniare limited to import-level issues only. All other mypy checks (type mismatches, missing attributes, etc.) remain active.Test plan
mypy iterm2/passes with 0 errors locallypytest tests/— 154 passed