[release/2.11] Update mypy version#3426
Conversation
|
Jenkins build for b9073d76493eec06701e458f55c06c60afc9418f commit finished as FAILURE |
jithunnair-amd
left a comment
There was a problem hiding this comment.
Discussed offline with @zjliu-amd and requested him to explore an alternate solution that reimplements the get_correct_mypy_version function so it doesn't depend so heavily on parsing a CI-specific file like .ci/docker/requirements-ci.txt, and instead uses python introspection, if possible, to determine the version of mypy package installed. He'll also look at the original commit which introduced this function to understand the motivation of this function. If we are able to identify a better implementation that also resolves the failures for test_typing.py, we should also upstream the fix, since the comment already says # there's probably a more elegant way to do this
|
@jithunnair-amd I looked into the original motivation of this plugin (PR pytorch#51799), and it was intended to compare the installed version against the version specified in |
https://github.com/ROCm/pytorch/blob/release/2.11/mypy_plugins/check_mypy_version.py#L8-L17 scans the requirements-ci.txt and looks for
mypy==x.x.x, assuming only 1 match will be found. However, after last Friday's version bump, we now have 2 such lines specifying mypy versions for python <3.14 and >=3.14, causing this function to throw an exception, and therefore causing mypy can't be imported correctly, eventually causingtest_typingtests to fail.This change luckily won't break python 3.14 compatibility, as even though mypy ships prebuilt binary, it also provides a pure python wheel that works only slower without the prebuilt binary.