-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use mypy for static type checking #1275
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1275 +/- ##
=======================================
Coverage 99.65% 99.65%
=======================================
Files 35 35
Lines 2897 2898 +1
Branches 322 322
=======================================
+ Hits 2887 2888 +1
Misses 5 5
Partials 5 5
Continue to review full report at Codecov.
|
The failure is being addressed in typeshed here: python/typeshed#4825 |
The failure would also be addressed by dropping Python 2 support, see #1243. If that lands, I'll rebase this work. |
Changes:
|
Type checking helps give confidence that APIs are being used correctly, especially during large refactoring (e.g. eventually dropping Python 2 support). This initial pass only includes type annotations that were necessary to make mypy pass. Future pull requests will add types for the rest of the project once the workflow is established. pip has started including type annotation in a subset of its code. When major changes to pip are released, the type checking will help identify API mismatches and areas to adjust. mypy is configured to be as strict as possible without introducing errors. The configuration is a subset of the --strict CLI argument. Refs #972
No problem. Moved to pre-commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Type checking helps give confidence that APIs are being used correctly,
especially during large refactoring (e.g. eventually dropping Python 2
support).
This initial pass only includes type comments that were necessary to
make mypy pass. Future pull requests will add types for the rest of the
project once the workflow is established.
pip has started including type annotation in a subset of its code. When
major changes to pip are released, the type checking will help identify
API mismatches and areas to adjust.
mypy is configured to be as strict as possible without introducing
errors. The configuration is a subset of the --strict CLI argument.
Refs #972
Contributor checklist