-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix mypy version check #3783
Fix mypy version check #3783
Conversation
6c904df
to
e5dbf65
Compare
please review |
40032d0
to
556affa
Compare
681f347
to
732034c
Compare
LGTM, please add a change description. |
This is not optimal, it should ideally use the version string passed from mypy, not import from |
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.
Looking good, you'll need to rebase or merge master to get tests passing.
pydantic/mypy.py
Outdated
MYPY_VERSION = tuple(int(part) for part in mypy_version.split('+')[0].split('.')) | ||
BUILTINS_NAME = 'builtins' if MYPY_VERSION >= (0, 930) else '__builtins__' |
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.
Please move this into a function so we can test some real life values.
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.
Like that?
please update. |
f7ea9e9
to
f49c0c9
Compare
thanks so much. |
Change Summary
Basically the mypy plugin is broken with any dev version of mypy, I changed how the version number is parsed.
Also mypy will switch to a version number like
x.y.z
which the current check will fail on. It will be better to future proof this check to prevent a sudden wave of reports of "could not convert string to float".Related issue number
N/A
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)