Skip to content

Commit

Permalink
Removing 'PIP_REQ_TRACKER' from the environment variables before exec…
Browse files Browse the repository at this point in the history
…ution of each pip command.

When populated by one `pip_main` call, the variable remains in the environment properties for all subsequent calls, wreaking havoc since the directory is subsequently deleted.
Should be removed once fixed in `pip`, but will remain until then.
  • Loading branch information
safiyat committed Nov 9, 2018
1 parent ea975cf commit 0dbaecd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libpip2pi/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ def pip_run_command(pip_args):
if pip_version < (1, 1):
raise RuntimeError("pip >= 1.1 required, but %s is installed"
%(pip_version, ))
res = pip_main(pip_args)
# TODO: Remove this once
# pip._internal.req.req_tracker.RequirementTracker.cleanup() does it
# already.
os.environ.pop('PIP_REQ_TRACKER', None)
res = pip_main(['-vvv'] + pip_args)
if res != 0:
raise PipError("pip failed with status %s while running: %s"
%(res, pip_args))
Expand Down

0 comments on commit 0dbaecd

Please sign in to comment.