-
-
Notifications
You must be signed in to change notification settings - Fork 2.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 PEP 561 - editable install - test case #15493
Conversation
This comment has been minimized.
This comment has been minimized.
mypy/test/testpep561.py
Outdated
@@ -46,6 +46,18 @@ def virtualenv(python_executable: str = sys.executable) -> Iterator[tuple[str, s | |||
yield venv_dir, os.path.abspath(os.path.join(venv_dir, "bin", "python")) | |||
|
|||
|
|||
def upgrade_pip(python_executable: str, version_str: str) -> None: |
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.
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
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.
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
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
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.
Thank you!
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.1
for editable installs.This does indeed fix the issue. I was able to verify it with Github Actions on my fork.
/CC: @hauntsaninja