Skip to content

Commit

Permalink
Merge pull request #7719 from uranusjr/virtualenv-20-detection
Browse files Browse the repository at this point in the history
Swap venv and virtualenv checks
  • Loading branch information
pradyunsg authored Feb 12, 2020
2 parents 732b4a0 + 6104060 commit 025e99e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions news/7718.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Correctly detect global site-packages availability of virtual environments
created by PyPA’s virtualenv>=20.0.
7 changes: 4 additions & 3 deletions src/pip/_internal/utils/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ def virtualenv_no_global():
# type: () -> bool
"""Returns a boolean, whether running in venv with no system site-packages.
"""
# PEP 405 compliance needs to be checked first since virtualenv >=20 would
# return True for both checks, but is only able to use the PEP 405 config.
if _running_under_venv():
return _no_global_under_venv()

if _running_under_regular_virtualenv():
return _no_global_under_regular_virtualenv()

if _running_under_venv():
return _no_global_under_venv()

return False

0 comments on commit 025e99e

Please sign in to comment.