# the virtualenv exists it will get re-used since this function can be used
# along with install_python_packages
#
- # Usage:
+ # Usage (with pip 10.0.0 [the default]):
#
# to_install=( "ansible" "chacractl>=0.0.4" )
# install_python_packages_no_binary "to_install[@]"
+ #
+ # Usage (with pip<X.X.X [can also do ==X.X.X or !=X.X.X]):
+ #
+ # to_install=( "ansible" "chacractl>=0.0.4" )
+ # install_python_packages_no_binary "to_install[@]" "pip<X.X.X"
+ #
+ # Usage (with latest pip):
+ #
+ # to_install=( "ansible" "chacractl>=0.0.4" )
+ # install_python_packages_no_binary "to_install[@]" latest
create_virtualenv $TEMPVENV
PIP_SDIST_INDEX="$HOME/.cache/pip"
mkdir -p $PIP_SDIST_INDEX
- $VENV/pip install "pip==10.0.0"
+ # We started pinning pip to 10.0.0 as the default to prevent mismatching
+ # versions on non-ephemeral slaves. Some jobs require different or latest
+ # pip though so these if statements allow for that.
+ if [ "$2" == "latest" ]; then
+ echo "Ensuring latest pip is installed"
+ $VENV/pip install -U pip
+ elif [[ -n $2 && "$2" != "latest" ]]; then
+ echo "Installing $2"
+ $VENV/pip install "$2"
+ else
+ # This is the default for most jobs.
+ # See ff01d2c5 and fea10f52
+ echo "Installing pip 10.0.0"
+ $VENV/pip install "pip==10.0.0"
+ fi
echo "Updating setuptools"
pip_download setuptools
# Use this function to create a virtualenv and install
# python packages. Pass a list of package names.
#
- # Usage:
+ # Usage (with pip 10.0.0 [the default]):
#
# to_install=( "ansible" "chacractl>=0.0.4" )
# install_python_packages "to_install[@]"
+ #
+ # Usage (with pip<X.X.X [can also do ==X.X.X or !=X.X.X]):
+ #
+ # to_install=( "ansible" "chacractl>=0.0.4" )
+ # install_python_packages_no_binary "to_install[@]" "pip<X.X.X"
+ #
+ # Usage (with latest pip):
+ #
+ # to_install=( "ansible" "chacractl>=0.0.4" )
+ # install_python_packages "to_install[@]" latest
create_virtualenv $TEMPVENV
PIP_SDIST_INDEX="$HOME/.cache/pip"
mkdir -p $PIP_SDIST_INDEX
- $VENV/pip install "pip==10.0.0"
+ # We started pinning pip to 10.0.0 as the default to prevent mismatching
+ # versions on non-ephemeral slaves. Some jobs require different or latest
+ # pip though so these if statements allow for that.
+ if [ "$2" == "latest" ]; then
+ echo "Ensuring latest pip is installed"
+ $VENV/pip install -U pip
+ elif [[ -n $2 && "$2" != "latest" ]]; then
+ echo "Installing $2"
+ $VENV/pip install "$2"
+ else
+ # This is the default for most jobs.
+ # See ff01d2c5 and fea10f52
+ echo "Installing pip 10.0.0"
+ $VENV/pip install "pip==10.0.0"
+ fi
echo "Updating setuptools"
pip_download setuptools