-
Notifications
You must be signed in to change notification settings - Fork 3
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
Type (almost) all the things #122
Draft
PeterJCLaw
wants to merge
14
commits into
master
Choose a base branch
from
more-types
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PeterJCLaw
force-pushed
the
more-types
branch
from
September 24, 2022 22:20
6989656
to
ac2b434
Compare
The old circleci/python images are deprecated.
The majority of these were added via MonkeyType from running the tests, with some manual adjustment afterwards. This also includes some minor refactors where doing so made the types clearer. This does leave one typing issue unresolved as it is highlighting a potential bug.
I'm guessing these relate to older versions of mypy which didn't know how to read the code, however it seems reasonable to assume a newer enough version of mypy now.
These were needed in very old versions of flake8, which didn't support reading quoted type annotations.
Ideally we probably wouldn't do this, however that would require a fairly substantial re-working of where various types are defined and/or introducing rather a lot of protocols. We maybe should do that at some point, however until then it seems reasonable to allow type checking imports to specifically sidestep the layering constraints.
PeterJCLaw
force-pushed
the
more-types
branch
from
September 24, 2022 23:24
ac2b434
to
7048fea
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This applies the result of running the tests under
MonkeyType
to the source code, resulting in a lot of the remaining type annotations being added.It also makes
mypy
slightly stricter in now requiring that all ignores have error codes, that they do ignore something and fixes the cases that this found.This does leave one typing issue unresolved as it is highlighting a potential bug -- if a label's metadata isn't a
dict
then there can be issues when merging in new metadata.