Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sdks/java/container/license_scripts/license_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ set -e

# Get currently used Python version from Gradle or assume a default.
PYTHON=${1:-python3}
if ! command -v "${PYTHON}" >/dev/null 2>&1; then
if command -v python3 >/dev/null 2>&1; then
PYTHON=python3
else
PYTHON=python
fi
fi
SCRIPT_DIR="${PWD}/license_scripts"
ENV_DIR="${PWD}/build/virtualenv"

Expand All @@ -39,8 +46,10 @@ echo "Copying already-fetched licenses from ${EXISTING_LICENSE_DIR} to ${DOWNLOA
if [ -d "$DOWNLOAD_DIR" ]; then rm -rf "$DOWNLOAD_DIR" ; fi
mkdir -p "$DOWNLOAD_DIR"
cp -r "${EXISTING_LICENSE_DIR}"/*.jar "${DOWNLOAD_DIR}"
python -m venv --clear ${ENV_DIR} --without-pip --system-site-packages
${PYTHON} -m venv --clear ${ENV_DIR} --without-pip --system-site-packages
. ${ENV_DIR}/bin/activate
# Some runner images do not provide pip inside venv when using --without-pip.
python -m ensurepip --upgrade
python -m pip install --retries 10 --upgrade pip setuptools wheel

# install packages
Expand Down
Loading