Merge "Depreciated pip option PIP_DOWNLOAD_CACHE removal"
diff --git a/functions-common b/functions-common
index 3b4309a..b0b2622 100644
--- a/functions-common
+++ b/functions-common
@@ -26,7 +26,6 @@
# - ``ERROR_ON_CLONE``
# - ``FILES``
# - ``OFFLINE``
-# - ``PIP_DOWNLOAD_CACHE``
# - ``RECLONE``
# - ``REQUIREMENTS_DIR``
# - ``STACK_USER``
@@ -1568,8 +1567,7 @@
}
# Wrapper for ``pip install`` to set cache and proxy environment variables
-# Uses globals ``OFFLINE``, ``PIP_DOWNLOAD_CACHE``,
-# ``TRACK_DEPENDS``, ``*_proxy``
+# Uses globals ``OFFLINE``, ``TRACK_DEPENDS``, ``*_proxy``
# pip_install package [package ...]
function pip_install {
local xtrace=$(set +o | grep xtrace)
@@ -1594,8 +1592,15 @@
local sudo_pip="sudo -H"
fi
+ local pip_version=$(python -c "import pip; \
+ print(pip.__version__.strip('.')[0])")
+ if (( pip_version<6 )); then
+ die $LINENO "Currently installed pip version ${pip_version} does not" \
+ "meet minimum requirements (>=6)."
+ fi
+
$xtrace
- $sudo_pip PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
+ $sudo_pip \
http_proxy=$http_proxy \
https_proxy=$https_proxy \
no_proxy=$no_proxy \
@@ -1606,7 +1611,7 @@
if [[ "$INSTALL_TESTONLY_PACKAGES" == "True" ]]; then
local test_req="$@/test-requirements.txt"
if [[ -e "$test_req" ]]; then
- $sudo_pip PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \
+ $sudo_pip \
http_proxy=$http_proxy \
https_proxy=$https_proxy \
no_proxy=$no_proxy \