-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Mypy type checking #1143
Mypy type checking #1143
Conversation
Makefile
Outdated
@@ -6,6 +6,7 @@ pytest: | |||
|
|||
type: | |||
pytype -j auto | |||
mypy ${LINT_PATHS} |
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 would also add a mypy
entry (would make debugging easier as pytype is quite slow as soon as you change one file)
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 would also activate the color output as we do for pytest, see python/mypy#7771
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 would also add a
mypy
entry (would make debugging easier as pytype is quite slow as soon as you change one file)
Should I replace type
by pytype
then?
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.
type is still fine as we want to run both in the CI or when developping.
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 would also activate the color output as we do for pytest, see python/mypy#7771
I'm not sure to use MYPY_FORCE_COLOR=1
properly, it does not seem to work as expected.
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.
yep, I saw that :/ will see if I can find an example online
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.
What about this @araffin?
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 double check and you seem to be doing things right...
I need help here. I can't understand how to ignore files in |
What we do in imitation is we define a variable called We also skipped using setup.cfg, for a while we used mypy.ini which seemed to work consistently but now we just ignore the files manually on CI calls. This is so that when you're developing and run |
It works! Thanks! |
Except for colored output, (#1143 (comment)), it's ready for review. |
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.
From my part, I don't have much to say, LGTM =)
but I will let @Rocamonde comment on it and he is the one experienced with such transition.
I will merge this as it prevents from fixing type annotations. For the color issue, it's minor so let's fix it later if we find out what we are doing wrong. |
Description
Motivation and Context
Types of changes
Checklist:
make format
(required)make check-codestyle
andmake lint
(required)make pytest
andmake type
both pass. (required)make doc
(required)Note: You can run most of the checks using
make commit-checks
.Note: we are using a maximum length of 127 characters per line