Ty is a new Rust-based Python type checker from Astral (makers of Ruff) that offers similar functionality to mypy in strict mode. The guide covers installing ty via uv, uvx, or standalone installers, running it locally with various commands, and configuring it through pyproject.toml or ty.toml. It includes setup instructions for GitHub Actions CI integration and workarounds for pre-commit hooks until official support arrives. Ty doesn't currently flag missing type hints, but you can use Ruff's flake8-annotations rules to enforce them.

3m read timeFrom blog.pythonlibrary.org
Post cover image
Table of contents
InstallationRunning ty LocallyRunning ty in GitHub ActionsUsing ty with pre-commitWrapping Up

Sort: