Skip to content

Fix mypy for new virtualenv #10855

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

Merged
merged 2 commits into from
Jul 22, 2021
Merged

Fix mypy for new virtualenv #10855

merged 2 commits into from
Jul 22, 2021

Conversation

emmatyping
Copy link
Member

Description

This works around a change in virtualenv 20.x where the site-packages folder is added to the PYTHONPATH variable. We detect if the python executable is in a virtualenv by comparing the prefix and base prefix, and ignoring the issue if the site-package folder is under the virtualenv prefix.

This is an alternative to #10846

Fixes #10407

setuptools!=50
importlib-metadata==0.20
importlib-metadata>=4.6.1,<5.0.0
Copy link
Member Author

Choose a reason for hiding this comment

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

The very old version of this was causing a failure with the new virtualenv.

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.

This looks good to me, thanks for the fix!

@emmatyping emmatyping merged commit a1863c9 into master Jul 22, 2021
@emmatyping emmatyping deleted the fixvenv branch July 22, 2021 00:38
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.

Virtualenv pinned to <20
2 participants