-
-
Notifications
You must be signed in to change notification settings - Fork 982
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
Incorporate mypy into lint stage #2858
Conversation
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.
@fritzo Looks good to me. Adding it with the lint stage and making it part of dev requirements. The idea of checking scripts as part of mypy is a good idea for pythonic ones.
Yes in the future annotating type hints for examples would be good. Easy for users to be able to understand various data types that can be accommodated by various modules.
Shall I create issues for adding type hints to examples? Further, how about finding a way we mypy throws a warning each time we have ignored a module or used #type ignore somewhere. I wasn't able to find how to do it. |
Thanks for reviewing @kamathhrishi!
I think it will be easiest if you create a single general mypy issue with a checklist for all the tasks that remain. I don't know how to give you edit rights to the original issue #2550.
Sure, once we're done annotating most of the codebase we could write a little one-line script using e.g. |
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.
LGTM
@fritzo Since you have writing permission for the repository, you can edit it. I will write a draft here which you can include there. So I thought you can just include a checklist like this: Add type hints to modules
Additional functionality for type hints include:
A tag of "Good first Issue" will be good. Grey seems like a good idea for finding #type ignores |
Addresses #2550
@kamathhrishi does this PR look ok to you? I thought it would be nice to:
make lint
, which we often use to quickly check the codebase. Since we already have a travis stage tomake lint
, this PR moves mypy into the lint stage in .travis.yml. I've also added mypy to the dev requirements in setup.pyexamples/
andscripts/
directories. Currentlyexamples/
fails so I've commented it out in themake lint
command. I guess we can fix examples in a later PR (lower priority than the library fixes you're working on)note mypy was giving me weird errors for the
warn_incomplete_stub
changes: