Summary
Add mypy as a real type-checking gate for Python code, but initially scope it only to Python files changed by this branch: fix/account-pool-usage-limit-failover.
Motivation
The Python SDK ships py.typed, so validating type correctness is more meaningful than only requiring annotations to be present. A repo-wide mypy rollout may create unrelated cleanup work, so the first step should keep the check focused on this branch's Python changes.
Proposed work
- Add mypy as a Python SDK development dependency and include a minimal
tool.mypy configuration.
- Add a script or CI command that computes changed Python files for this branch and runs mypy only on those files.
- Use the merge base against the branch target as the comparison point, not the full repository history.
- Keep generated code excluded unless a generated artifact is intentionally part of the changed-file set and is mypy-compatible.
- Avoid turning this into a full-codebase mypy cleanup task.
Acceptance criteria
- The new check runs mypy only for Python files changed on
fix/account-pool-usage-limit-failover.
- The check passes when no Python files are changed.
- The command is documented enough for local reproduction.
- CI failures point to actionable type errors in changed Python files, not unrelated existing issues elsewhere in the repo.
Follow-up
After this branch-scoped rollout is stable, consider a separate baseline effort to expand mypy coverage to the full Python SDK.
Summary
Add mypy as a real type-checking gate for Python code, but initially scope it only to Python files changed by this branch:
fix/account-pool-usage-limit-failover.Motivation
The Python SDK ships
py.typed, so validating type correctness is more meaningful than only requiring annotations to be present. A repo-wide mypy rollout may create unrelated cleanup work, so the first step should keep the check focused on this branch's Python changes.Proposed work
tool.mypyconfiguration.Acceptance criteria
fix/account-pool-usage-limit-failover.Follow-up
After this branch-scoped rollout is stable, consider a separate baseline effort to expand mypy coverage to the full Python SDK.