11#! /bin/bash
22set -e
3+ set -x
4+
5+ # Avoid virtualenv/pip trying to download/upgrade tools from PyPI on host
6+ export VIRTUALENV_NO_DOWNLOAD=1
7+ export PIP_DISABLE_PIP_VERSION_CHECK=1
8+
9+ # Detect proxy settings on host and pass them to cibuildwheel container
10+ PROXY_ENV=" "
11+ if [ -n " ${http_proxy} " ]; then PROXY_ENV=" ${PROXY_ENV} http_proxy=${http_proxy} " ; fi
12+ if [ -n " ${https_proxy} " ]; then PROXY_ENV=" ${PROXY_ENV} https_proxy=${https_proxy} " ; fi
13+ if [ -n " ${no_proxy} " ]; then PROXY_ENV=" ${PROXY_ENV} no_proxy=${no_proxy} " ; fi
14+ if [ -n " ${HTTP_PROXY} " ]; then PROXY_ENV=" ${PROXY_ENV} HTTP_PROXY=${HTTP_PROXY} " ; fi
15+ if [ -n " ${HTTPS_PROXY} " ]; then PROXY_ENV=" ${PROXY_ENV} HTTPS_PROXY=${HTTPS_PROXY} " ; fi
16+ if [ -n " ${NO_PROXY} " ]; then PROXY_ENV=" ${PROXY_ENV} NO_PROXY=${NO_PROXY} " ; fi
17+
18+ # Pass these environment variables to the cibuildwheel Docker container
19+ export CIBW_ENVIRONMENT=" VIRTUALENV_NO_DOWNLOAD=1 PIP_DISABLE_PIP_VERSION_CHECK=1${PROXY_ENV} "
320
421# If running locally (not on Kokoro), authenticate with gcloud.
522if [ -z " ${KOKORO_BUILD_ID} " ]; then
@@ -8,7 +25,7 @@ if [ -z "${KOKORO_BUILD_ID}" ]; then
825 fi
926fi
1027
11- pip install -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
28+ pip install --no-cache-dir - U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
1229
1330REPO_DIR=$( mktemp -d)
1431echo " Created temporary directory: ${REPO_DIR} "
@@ -52,11 +69,17 @@ cp -r "${SRC_DIR}"/{*,.*} . 2>/dev/null || true
5269cp -r " ${SRC_DIR} " /release/* . 2> /dev/null || true
5370rm -rf cel_expr_python/* _test.py
5471
72+ echo " Downloading bazelisk on host..."
73+ curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
74+ chmod +x bazelisk-linux-amd64
75+
5576# Check if pyproject.toml exists before running sed
5677if [ -f pyproject.toml ]; then
5778 sed -i " " " s/\$ VERSION/${VERSION} /g" pyproject.toml || sed -i " s/\$ VERSION/${VERSION} /g" pyproject.toml
5879fi
5980
81+ export CIBW_CONTAINER_ENGINE_EXTRA_ARGS=" --network=host"
82+
6083echo " Running cibuildwheel: ${CIBWHEEL_BIN} "
6184# Default CIBWHEEL_BIN if not set
6285if [ -z " ${CIBWHEEL_BIN} " ]; then
0 commit comments