Skip to content

Commit

Permalink
Work around Debian's faultily-patched pip
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastProject committed Mar 23, 2017
1 parent 779e460 commit 2ca807f
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions pext/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,18 +471,24 @@ def _pip_install(self, module_dir_name: str) -> int:
# Probably already exists, that's okay
pass

try:
run([sys.executable,
'-m',
'pip',
'install',
'--system',
'--upgrade',
'--target',
module_dependencies_path,
'-r',
module_requirements_path], check=True)
# Create the pip command
pip_command = [sys.executable,
'-m',
'pip',
'install']

# Cheap hack to work around Debian's faultily-patched pip
if os.path.isfile('/usr/bin/apt'):
pip_command += ['--system']

pip_command += ['--upgrade',
'--target',
module_dependencies_path,
'-r',
module_requirements_path]

try:
run(pip_command, check=True)
except CalledProcessError as e:
return e.returncode

Expand Down

0 comments on commit 2ca807f

Please sign in to comment.