Skip to content

add mypy type checking to CI pipeline#608

Merged
gnachman merged 1 commit intognachman:masterfrom
mkusaka:ci/add-mypy
Mar 6, 2026
Merged

add mypy type checking to CI pipeline#608
gnachman merged 1 commit intognachman:masterfrom
mkusaka:ci/add-mypy

Conversation

@mkusaka
Copy link
Contributor

@mkusaka mkusaka commented Mar 5, 2026

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.yml

  • Add "Run mypy" step after pytest in the python-tests job

api/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 CI

api/library/python/iterm2/requirements-dev.txt

  • Add mypy>=1.0.0 and types-protobuf

Notes

  • The suppressions in mypy.ini are limited to import-level issues only. All other mypy checks (type mismatches, missing attributes, etc.) remain active.
  • If this feels like too much overhead for the Python API, happy to close this — just thought it could be a useful safety net since the type annotations are already in place.

Test plan

  • mypy iterm2/ passes with 0 errors locally
  • pytest tests/ — 154 passed

- 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
@gnachman gnachman merged commit c1fc8ea into gnachman:master Mar 6, 2026
2 checks passed
@mkusaka mkusaka deleted the ci/add-mypy branch March 7, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants