MyPy
Static type checker for Python, designed to ensure code correctness and catch type errors before runtime.
What is it used for here?
!
type checking
Python code to catch type errors early- enforcing and verifying type annotations
- checking code quality before every commit and during CI pipelines
How to use it?
- In this case, the Makefile does the same as running the commands directly via uv. The Makefile is only needed to shorten commands.
!
How to use it with pre-commit?
To use MyPy with pre-commit, you need to add the appropriate configuration to .pre-commit-config.yaml
.
!
Configuration
All configuration for Mypy in this template is located in pyproject.toml under the [tool.mypy]
section.
For more details on configuration, see the MyPy Documentation