Skip to content

[release/2.11] Update mypy version#3426

Draft
zjliu-amd wants to merge 1 commit into
ROCm:release/2.11from
zjliu-amd:2.11-mypy-nuance
Draft

[release/2.11] Update mypy version#3426
zjliu-amd wants to merge 1 commit into
ROCm:release/2.11from
zjliu-amd:2.11-mypy-nuance

Conversation

@zjliu-amd

Copy link
Copy Markdown

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 causing test_typing tests 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.

@zjliu-amd zjliu-amd requested a review from jeffdaily as a code owner July 13, 2026 14:13
@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 13, 2026

Copy link
Copy Markdown

Jenkins build for b9073d76493eec06701e458f55c06c60afc9418f commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

@jithunnair-amd jithunnair-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 jithunnair-amd marked this pull request as draft July 13, 2026 16:06
@zjliu-amd

Copy link
Copy Markdown
Author

@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 requirements-ci.txt to avoid inconsistency between local development and CI. So I'm afraid it's unlikely we can avoid parsing the requirements.txt file.
However, all these version bumps are only for successfully installing them in the rock CI. I'll discuss the rock CI environment issues in another PR I have for the rock and see if we can solve those environment issues and simply use whatever pytorch provides, without manually bumping some dependencies and providing different dep versions for different python versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants