-
Notifications
You must be signed in to change notification settings - Fork 86
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
Run mypy in CI with dependencies' type annotations #115
Conversation
hukkin
commented
Dec 3, 2019
•
edited
Loading
edited
- Run mypy in an env that has dependencies and their typehints
- Fix resulting mypy errors
- Add a few strictness flags for mypy
- Fix resulting mypy errors
extras = lint | ||
commands = | ||
pre-commit run --all-files | ||
mypy . |
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.
Won't this mean that mypy runs twice--once in pre-commit and once 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.
Yes it does. In pre-commit it doesn't have the typehints of dependencies' so the checks aren't as comprehensive. If you want, we can remove mypy from pre-commit. I left it because it can still be useful when making a git commit locally.
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.
I'd be fine removing mypy from pre-commit. the lint
job is already the slowest job in CI at the moment, and I'd hate to make it slower. Also, it's one less thing to manually sync between pre-commit-config.yaml and setup.py.
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.
Also, maybe add a comment above this line explaining why we're running mypy outside of 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.
Removed mypy from pre-commit and made the comment in tox.ini
Thanks. Will give this another look and release after work today or tomorrow. |