-
Notifications
You must be signed in to change notification settings - Fork 19
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 annotations and py.typed to conform with PEP561. Add type checking to tox #40
Conversation
60543ae
to
fd0f1d3
Compare
fd0f1d3
to
db18fd3
Compare
@gaborbernat sorry for opening a new PR, I borked my rebase process and figured it'd be easier/less risky to start over. One thing to note is that it seems mypy seems to have some strange behavior when we do things like compare I think I addressed all the comments in #31. Could you please take a look? |
db18fd3
to
cd821f4
Compare
a7d9b7d
to
777692c
Compare
Signed-off-by: Wilfred Wong <[email protected]> Signed-off-by: Bernat Gabor <[email protected]>
Signed-off-by: Bernat Gabor <[email protected]>
Signed-off-by: Bernat Gabor <[email protected]>
777692c
to
118f266
Compare
base_type = _get_base_type(expected_type) | ||
|
||
if base_type is None or base_type == typing.Any: | ||
if base_type == typing.Any: |
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.
Why is the none check dropped here ?
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.
Not sure to be fair; I assume given the type checker does not complain it's not needed? @keiclone knows probably better
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.
Looks good, just the comment about the None check.
The None check was effectively moved up to line 69. |
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.
Thanks for the effort put into this @keiclone . Much appreciated.
@erikseulean want to do a new release? |
Yes, feel free to trigger a new one. |
*Issue number of the reported bug or feature request: #24
Describe your changes
made
attrs-strict
PEP561 compatible by adding annotations andpy.typed
. This removes the missing import error frommypy
when attempting to run static type checking on packages usingattrs-strict
Testing performed
Was able to successfully run static type checking in a test project after installing attrs-strict from my branch.
when testing on a separate library:
Additional context
could use some extra attention on how this was added to tox to make sure it was done correctly