-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
add python type hints via pyre infer to tests/
#11953
Conversation
bfe682f
to
fd17af2
Compare
tests/
e490ee7
to
a27eb66
Compare
72f9344
to
8e79a39
Compare
for more information, see https://pre-commit.ci
We aren't interested in adding typing to tests. The type checker is not configured to run over them. Tests will naturally fail if types are not correct. Typing is most useful for users but tests are internal to the project. |
@edward-io do you think this could be used for the package instead to fill some of the missing typing? 🐰 |
@carmocca Typing helps beyond correctness in tests - it helps with autocomplete in text editors and provides self-documentation for easier readability as well :) If we don't think that the benefits outweigh the costs, I can go ahead and close this PR. @Borda - #11956 #11955, I'll add another one for the main library as well. |
@edward-io Sorry if I sounded too harsh with my previous comment! Let me elaborate. Mypy is not configured to run over the test directory: So I would not be comfortable adding type information if it's not going to be checked. The cost of running the bot is negligible, however, adding types without the checker is like adding code without tests. Considering that there is still a lot of the source code still untyped, I would focus on that. Maybe one day it's worth adding type annotations for tests but it's very low value and the test suite is already very fragmented.
For other typing PRs to the codebase, you should aim to remove entries from: but keep in mind that each PR should address only one or a few files. You can see examples in the linked PRs to #7037 |
What does this PR do?
automatically adds python type hinting using pyre to
tests
.manually fixed some broken areas.
breaking this up into multiple PRs to make it easier to review.
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃