Fix PEP 561 - editable install - test case#15493
Merged
hauntsaninja merged 3 commits intopython:masterfrom Jun 22, 2023
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
mypy/test/testpep561.py
Outdated
| yield venv_dir, os.path.abspath(os.path.join(venv_dir, "bin", "python")) | ||
|
|
||
|
|
||
| def upgrade_pip(python_executable: str, version_str: str) -> None: |
Collaborator
There was a problem hiding this comment.
Let's skip this on Python 3.11 and newer, since this is really slow and venv is guaranteed to create an environment with new enough pip in 3.11
Collaborator
There was a problem hiding this comment.
Let's use this:
if (
sys.version_info >= (3, 11)
or (3, 10, 3) <= sys.version_info < (3, 11)
or (3, 9, 11) <= sys.version_info < (3, 10)
or (3, 8, 13) <= sys.version_info < (3, 9)
):
return
I think worth it for how slow this is
Contributor
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts #15482. Upgrading pip was the right idea, however the test case creates a new temporary venv which still uses the original pip version. Added a new call to upgrade pip to
pip>=21.3.1for editable installs.This does indeed fix the issue. I was able to verify it with Github Actions on my fork.
/CC: @hauntsaninja