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 pip's machinery for creating an isolated build environment so that user installed packages do not override the stdlib #8213

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/8214.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix installing packages which have a pyproject.toml when enum34 is installed.
2 changes: 2 additions & 0 deletions news/8214.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removes the ability to run pip via ``python src/pip/`` from a checkout without
setting PYTHONPATH first.
5 changes: 4 additions & 1 deletion src/pip/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
# Resulting path is the name of the wheel itself
# Add that to sys.path so we can import pip
path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path)
# __package__ could have also been the empty string if pip was invoked
# with the path to the pip directory. ie: as python /path/to/pip/.
if path.endswith('.whl'):
sys.path.insert(0, path)

from pip._internal.cli.main import main as _main # isort:skip # noqa

Expand Down