Do not use 'sudo pip install' when venv is used

We end up installing bindep and bifrost deps in the system otherwise.

Change-Id: I3d3b24ba5313013051e8b18d1ce4ec42a61d20f0
This commit is contained in:
Dmitry Tantsur 2020-07-07 11:41:00 +02:00
parent 3d2ee6018f
commit 0b58a05ac6

View File

@ -124,13 +124,21 @@ if [ -n "${VENV-}" ]; then
fi
# Install the rest of required packages using bindep
sudo -H -E ${PIP} install bindep
if [ -n "${VENV-}" ]; then
${PIP} install bindep
else
sudo -H -E ${PIP} install bindep
fi
echo "Using Bindep to install binary dependencies..."
# bindep returns 1 if packages are missing
bindep -b &> /dev/null || ${INSTALLER_CMD} $(bindep -b)
echo "Installing Python requirements"
sudo -H -E ${PIP} install -r "$(dirname $0)/../requirements.txt"
if [ -n "${VENV-}" ]; then
${PIP} install -r "$(dirname $0)/../requirements.txt"
else
sudo -H -E ${PIP} install -r "$(dirname $0)/../requirements.txt"
fi
echo "Completed installation of basic dependencies."