Skip to content
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

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Jun 22, 2023

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

@github-actions

This comment has been minimized.

@@ -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:
Copy link
Collaborator

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

Copy link
Collaborator

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

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you!

@hauntsaninja hauntsaninja merged commit 2e304ca into python:master Jun 22, 2023
@cdce8p cdce8p deleted the fix-pep561-issue branch June 22, 2023 22:07
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