Skip to content

Commit 942907b

Browse files
committed
provision: Make sure the correct version of pip is installed.
pip of at least 8.0.0 version is required to successfully install the requirements. Otherwise, the prefix option doesn't work.
1 parent 0ccd827 commit 942907b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/provision

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ the Python version this command is executed with."""
5757

5858
# In order to install all required packages for the venv, `pip` needs to be executed by
5959
# the venv's Python interpreter. `--prefix venv_dir` ensures that all modules are installed
60-
# in the right place.
60+
# in the right place (pip of at least 8.0.0 version is required for this to work).
6161
def install_dependencies(requirements_filename):
62-
if subprocess.call([os.path.join(venv_dir, venv_exec_dir, 'pip'),
63-
'install', '--prefix', venv_dir, '-r', os.path.join(base_dir, requirements_filename)]):
62+
pip_path = os.path.join(venv_dir, venv_exec_dir, 'pip')
63+
subprocess.call([pip_path, 'install', 'pip>=8.0.0'])
64+
if subprocess.call([pip_path, 'install', '--prefix', venv_dir, '-r',
65+
os.path.join(base_dir, requirements_filename)]):
6466
raise OSError("The command `pip install -r {}` failed. Dependencies not installed!"
6567
.format(os.path.join(base_dir, requirements_filename)))
6668

0 commit comments

Comments
 (0)