chore: migrate from mypy to ty type checker
Resolved 💬 3 comments Opened Dec 21, 2025 by lmeazzini Closed Feb 14, 2026
Summary
Migrate the backend type checking from mypy to ty (https://docs.astral.sh/ty/), the new type checker from Astral (creators of uv and Ruff).
Motivation
We're already using Astral tools in our stack:
- UV for package management (10-100x faster than pip)
- Ruff for linting and formatting
Adding ty would complete our migration to the Astral ecosystem, providing:
Performance
- 10x - 100x faster than mypy (benchmarks on home-assistant project)
- Built in Rust for maximum speed
- Fine-grained incremental analysis optimized for IDE workflows
Better Developer Experience
- Full language server with code navigation, completions, inlay hints, and auto-import
- Configurable diagnostics with per-file overrides
- Better support for partially typed code and gradual adoption
- Advanced type narrowing and reachability analysis
Ecosystem Consistency
- Same configuration style as Ruff (pyproject.toml)
- Unified tooling from one vendor
- Simpler CI/CD configuration
Tasks
- [ ] Add ty to dev dependencies (
uv add --dev ty) - [ ] Configure ty in
pyproject.toml - [ ] Update CI workflow (
.github/workflows/ci.yml) to use ty instead of mypy - [ ] Update
CLAUDE.mddocumentation - [ ] Update
Makefilecommands - [ ] Remove mypy from dependencies
- [ ] Fix any new type errors ty may catch (ty may be stricter in some areas)
References
- ty documentation: https://docs.astral.sh/ty/
- ty GitHub: https://github.com/astral-sh/ty
- Astral blog announcement: https://astral.sh/blog/ty
Notes
⚠️ ty is relatively new - we should verify it's stable enough for production use before migrating. Consider testing on a feature branch first.
---
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗