Skip to content

Commit

Permalink
tweak workaround for pypa#1644
Browse files Browse the repository at this point in the history
Work around buggy pip detection code for "pip.exe install/update ...  pip ...".
commit 0d831c9
Author: Benoit Pierre <[email protected]>
Date:   Sat Aug 10 03:57:58 2019 +0200

    improve
  • Loading branch information
benoit-pierre committed Nov 15, 2019
1 parent a92752c commit 4b2f938
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/tox_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ def pip(args):
'pip'])
shutil.rmtree(glob(os.path.join(TOX_PIP_DIR, 'pip-*.dist-info'))[0])
# And use that version.
pypath = os.environ.get('PYTHONPATH')
pypath = pypath.split(os.pathsep) if pypath is not None else []
pypath.insert(0, TOX_PIP_DIR)
os.environ['PYTHONPATH'] = os.pathsep.join(pypath)
for n, a in enumerate(args):
if not a.startswith('-'):
if a in 'install' and '-e' in args[n:]:
args.insert(n + 1, '--no-use-pep517')
break
subprocess.check_call([sys.executable, os.path.join(TOX_PIP_DIR, 'pip')] + args)
subprocess.check_call([sys.executable, '-m', 'pip'] + args)


if __name__ == '__main__':
Expand Down

0 comments on commit 4b2f938

Please sign in to comment.