Summary
mypy is slow and has worse error messages compared to modern alternatives.
This issue tracks migrating type checking from mypy to pyright, which runs
as a daemon for near-instant incremental checks and is production-stable.
Motivation
- mypy is significantly slower on incremental checks compared to pyright
- Pyright error messages are more precise and actionable
- Pyright is actively maintained by Microsoft and backs Pylance in VS Code
- Daemon mode means subsequent checks in dev workflow are near-instant
Migration Steps
Initial Configuration
{
"pythonVersion": "3.11",
"typeCheckingMode": "standard",
"venvPath": ".",
"venv": ".venv"
}
Start with standard mode. Strict mode can be a follow-up once the
baseline is clean — strict on tree-sitter and rustworkx bindings may
produce noise from incomplete upstream stubs.
Notes
- Pyright and mypy occasionally disagree on correctness. Pyright is generally correct when they diverge but some annotations may need adjustment during migration.
- Do not migrate to
ty (Astral) or Pyrefly (Meta) at this time. Both are pre-release and not production-stable. Revisit when either hits 1.0.
Out of Scope
- Enabling strict mode (follow-up issue if desired)
- Adding inline type annotations to currently untyped functions
Summary
mypy is slow and has worse error messages compared to modern alternatives.
This issue tracks migrating type checking from mypy to pyright, which runs
as a daemon for near-instant incremental checks and is production-stable.
Motivation
Migration Steps
uv add --dev pyrightpyrightconfig.jsonat the repo rootstandardmode and fix all reported errorspyproject.tomlCONTRIBUTING.mdor dev setup docs if mypy is mentionedInitial Configuration
{ "pythonVersion": "3.11", "typeCheckingMode": "standard", "venvPath": ".", "venv": ".venv" }Start with
standardmode. Strict mode can be a follow-up once thebaseline is clean — strict on tree-sitter and rustworkx bindings may
produce noise from incomplete upstream stubs.
Notes
ty(Astral) or Pyrefly (Meta) at this time. Both are pre-release and not production-stable. Revisit when either hits 1.0.Out of Scope