diff --git a/functions-common b/functions-common index 4e74f5a811..87b9eceec2 100644 --- a/functions-common +++ b/functions-common @@ -1400,6 +1400,19 @@ function pip_install { $cmd_pip install --build=${pip_build_tmp} \ $pip_mirror_opt $@ \ && $sudo_pip rm -rf ${pip_build_tmp} + + 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} \ + http_proxy=$http_proxy \ + https_proxy=$https_proxy \ + no_proxy=$no_proxy \ + $cmd_pip install --build=${pip_build_tmp} \ + $pip_mirror_opt -r $test_req \ + && $sudo_pip rm -rf ${pip_build_tmp} + fi + fi } # this should be used if you want to install globally, all libraries should