File tree Expand file tree Collapse file tree
sdks/java/container/license_scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ set -e
1818
1919# Get currently used Python version from Gradle or assume a default.
2020PYTHON=${1:- python3}
21+ if ! command -v " ${PYTHON} " > /dev/null 2>&1 ; then
22+ if command -v python3 > /dev/null 2>&1 ; then
23+ PYTHON=python3
24+ else
25+ PYTHON=python
26+ fi
27+ fi
2128SCRIPT_DIR=" ${PWD} /license_scripts"
2229ENV_DIR=" ${PWD} /build/virtualenv"
2330
@@ -39,8 +46,19 @@ echo "Copying already-fetched licenses from ${EXISTING_LICENSE_DIR} to ${DOWNLOA
3946if [ -d " $DOWNLOAD_DIR " ]; then rm -rf " $DOWNLOAD_DIR " ; fi
4047mkdir -p " $DOWNLOAD_DIR "
4148cp -r " ${EXISTING_LICENSE_DIR} " /* .jar " ${DOWNLOAD_DIR} "
42- python -m venv --clear ${ENV_DIR} --without-pip --system-site-packages
49+ ${PYTHON} -m venv --clear ${ENV_DIR} --without-pip --system-site-packages
4350. ${ENV_DIR} /bin/activate
51+ if ! python -m pip --version > /dev/null 2>&1 ; then
52+ GET_PIP_URL=" https://bootstrap.pypa.io/get-pip.py"
53+ if command -v curl > /dev/null 2>&1 ; then
54+ curl -sSL " $GET_PIP_URL " | python
55+ elif command -v wget > /dev/null 2>&1 ; then
56+ wget -qO- " $GET_PIP_URL " | python
57+ else
58+ echo " Neither curl nor wget found; cannot bootstrap pip"
59+ exit 1
60+ fi
61+ fi
4462python -m pip install --retries 10 --upgrade pip setuptools wheel
4563
4664# install packages
You can’t perform that action at this time.
0 commit comments