ty User Guide
Tip
Official documentation for ty is available at https://github.com/astral-sh/ty
What is ty?
ty is a fast type checker for Python built by Astral (the creators of uv and Ruff). It provides static type checking to catch type errors before runtime.
How to use ty
If you want to run ty to manually check types in your Python code, run the following command:
1 | |
Running ty via nox
You can also run ty through the nox lint session:
1 2 3 4 5 | |
ty Configuration
If you want to configure ty, visit the Configuration for ty page.
Integration with Development Workflow
ty is integrated into the development workflow in multiple ways:
Pre-commit Hooks
ty runs automatically before each commit when pre-commit hooks are installed:
1 | |
CI/CD
GitHub Actions runs ty on pull requests that change Python files or their configuration. See CI/CD Workflows.
VSCode Integration
VSCode uses ty for type checking when python.languageServer is set to "None" in .vscode/settings.json.