-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Open
Labels
C-pyPython BindingsPython BindingsI-defectSomething is not working as intendedSomething is not working as intendedR-help wantedIssues looking for contributionsIssues looking for contributionsgood first issueGood first issue for new contributors to start withGood first issue for new contributors to start with
Description
Description
TLDR: Our use of type hints in the Python bindings needs some serious love.
Static typing is optional in Python, and we make use of it in many places throughout the Python bindings code. Static typing is not enforced at runtime, but can be checked with tooling like Mypy.
We currently have a Mypy environment and set of type checking rules declared in our tox.ini
configuration. You can run Mypy locally with:
tox -e py/tox.ini -e mypy
Running this produces a screen full of type errors and:
Found 120 errors in 30 files (checked 114 source files)
We currently run Mypy in a CI workflow, but we don't display the errors or fail the job when it hits errors, so they just go unnoticed.
To resolve this issue, we should:
- go through the codebase and fix all of the errors that Mypy finds
- update the CI job to fail when Mypy encounters errors to enforce no future regressions
Reproducible Code
tox -e py/tox.ini -e mypy
Debugging Logs
Found 120 errors in 30 files (checked 114 source files)
Metadata
Metadata
Assignees
Labels
C-pyPython BindingsPython BindingsI-defectSomething is not working as intendedSomething is not working as intendedR-help wantedIssues looking for contributionsIssues looking for contributionsgood first issueGood first issue for new contributors to start withGood first issue for new contributors to start with