Skip to content

Commit

Permalink
Remove --install-option in the pip call.
Browse files Browse the repository at this point in the history
This future-proofs this script as this form of invocation is about to go the way
of dinosaurs. See pypa/pip#7309.
  • Loading branch information
skytreader committed May 22, 2020
1 parent f72cd16 commit c0538ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions virtualenv-burrito.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def _getcwd():
except OSError:
return None

def __debug_install(cmd):
print("Running: %s" % cmd)
sh(cmd)

def upgrade_package(filename, name, version):
"""Install Python package in tarball `filename`."""
Expand Down Expand Up @@ -170,19 +173,19 @@ def upgrade_package(filename, name, version):

if name in ['setuptools', 'distribute']:
# build and install the egg to avoid patching the system
sh("%s setup.py bdist_egg" % sys.executable)
__debug_install("%s setup.py bdist_egg" % sys.executable)
egg = glob.glob(os.path.join(os.getcwd(), "dist", "*egg"))[0]
sh("%s setup.py easy_install --exclude-scripts --install-dir %s %s >/dev/null"
__debug_install("%s setup.py easy_install --exclude-scripts --install-dir %s %s >/dev/null"
% (sys.executable, lib_python, egg))

elif name == 'pip':
libexec = os.path.join(VENVBURRITO, "libexec")
sh("%s setup.py install --prefix='' --home='%s' --install-lib %s --install-scripts %s --no-compile >/dev/null"
__debug_install("%s setup.py install --prefix='' --home='%s' --install-lib %s --install-scripts %s --no-compile >/dev/null"
% (sys.executable, VENVBURRITO, lib_python, libexec))

else:
pip = os.path.join(VENVBURRITO, "libexec", "pip")
sh("%s install --ignore-installed --install-option='--prefix=%s' ." % (pip, VENVBURRITO))
__debug_install("%s install --ignore-installed --prefix='%s' ." % (pip, VENVBURRITO))
finally:
os.chdir(owd or VENVBURRITO)
shutil.rmtree(tmp)
Expand Down

0 comments on commit c0538ab

Please sign in to comment.