-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
low priorityThis should be addressed as time permitsThis should be addressed as time permitstaskTask/chore unrelated to a bug or feature requestTask/chore unrelated to a bug or feature request
Description
Description
A portion of the Python code base makes use of type annotations. The entire code base should do so, to reduce bugs, improve quality, and enhance the IDE experience.
Additional Details
Use one of the more common type checkers - mypy, pyright, or pyre - and enforce standards by adding the checker to QA as a pre-commit hook.
Consider adding this setting to the ruff config for isort:
[tool.ruff.isort]
force-sort-within-sections = true
required-imports = ["from __future__ import annotations"]If the selected type checker does not offer a pre-commit hook directly, check the published pre-commit hooks site for a "mirrored" one (e.g., for mypy)
References
- PEP 483 – The Theory of Type Hints
- PEP 526 - Syntax for Variable Annotations
- PEP 3107 – Function Annotations
- PEP 484 – Type Hints
- PEP 585 - Type Hinting Generics In Standard Collections
- PEP 563 - Postponed Evaluation of Annotations
- PEP 649 - Deferred Evaluation Of Annotations Using Descriptors
- MyPy type hints cheat sheet
- typeshed
- Python
typinglibrary
Acceptance Criteria
- All Python code is annotated with types
- Type checking is enforced in QA
-
ruffrules forANN(flake8-annotations) are no longer disabled -
ruffrules forTCH(flake8-type-checking) are no longer disabled -
ruffrules forFA(flake8-future-annotations) are no longer disabled - Documentation is updated
Metadata
Metadata
Assignees
Labels
low priorityThis should be addressed as time permitsThis should be addressed as time permitstaskTask/chore unrelated to a bug or feature requestTask/chore unrelated to a bug or feature request