11#! /bin/bash
22set -e
3+ set -x
4+
5+ # Debug: Print host proxy settings
6+ echo " === Host Proxy Settings ==="
7+ echo " http_proxy: ${http_proxy} "
8+ echo " https_proxy: ${https_proxy} "
9+ echo " no_proxy: ${no_proxy} "
10+ echo " HTTP_PROXY: ${HTTP_PROXY} "
11+ echo " HTTPS_PROXY: ${HTTPS_PROXY} "
12+ echo " NO_PROXY: ${NO_PROXY} "
13+
14+ # Avoid virtualenv/pip trying to download/upgrade tools from PyPI on host
15+ export VIRTUALENV_NO_DOWNLOAD=1
16+ export PIP_DISABLE_PIP_VERSION_CHECK=1
17+
18+ # Detect proxy settings on host and pass them to cibuildwheel container
19+ PROXY_ENV=" "
20+ if [ -n " ${http_proxy} " ]; then PROXY_ENV=" ${PROXY_ENV} http_proxy=${http_proxy} " ; fi
21+ if [ -n " ${https_proxy} " ]; then PROXY_ENV=" ${PROXY_ENV} https_proxy=${https_proxy} " ; fi
22+ if [ -n " ${no_proxy} " ]; then PROXY_ENV=" ${PROXY_ENV} no_proxy=${no_proxy} " ; fi
23+ if [ -n " ${HTTP_PROXY} " ]; then PROXY_ENV=" ${PROXY_ENV} HTTP_PROXY=${HTTP_PROXY} " ; fi
24+ if [ -n " ${HTTPS_PROXY} " ]; then PROXY_ENV=" ${PROXY_ENV} HTTPS_PROXY=${HTTPS_PROXY} " ; fi
25+ if [ -n " ${NO_PROXY} " ]; then PROXY_ENV=" ${PROXY_ENV} NO_PROXY=${NO_PROXY} " ; fi
26+
27+ # Pass these environment variables to the cibuildwheel Docker container
28+ export CIBW_ENVIRONMENT=" VIRTUALENV_NO_DOWNLOAD=1 PIP_DISABLE_PIP_VERSION_CHECK=1${PROXY_ENV} "
29+ export CIBW_DEPENDENCY_CONSTRAINTS=" none"
330
431# If running locally (not on Kokoro), authenticate with gcloud.
532if [ -z " ${KOKORO_BUILD_ID} " ]; then
@@ -8,7 +35,7 @@ if [ -z "${KOKORO_BUILD_ID}" ]; then
835 fi
936fi
1037
11- pip install -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
38+ pip install --no-cache-dir - U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
1239
1340REPO_DIR=$( mktemp -d)
1441echo " Created temporary directory: ${REPO_DIR} "
@@ -52,16 +79,24 @@ cp -r "${SRC_DIR}"/{*,.*} . 2>/dev/null || true
5279cp -r " ${SRC_DIR} " /release/* . 2> /dev/null || true
5380rm -rf cel_expr_python/* _test.py
5481
82+ echo " Downloading bazelisk on host..."
83+ curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
84+ chmod +x bazelisk-linux-amd64
85+
5586# Check if pyproject.toml exists before running sed
5687if [ -f pyproject.toml ]; then
5788 sed -i " " " s/\$ VERSION/${VERSION} /g" pyproject.toml || sed -i " s/\$ VERSION/${VERSION} /g" pyproject.toml
5889fi
5990
91+ export CIBW_CONTAINER_ENGINE_EXTRA_ARGS=" --network=host"
92+
6093echo " Running cibuildwheel: ${CIBWHEEL_BIN} "
6194# Default CIBWHEEL_BIN if not set
6295if [ -z " ${CIBWHEEL_BIN} " ]; then
6396 CIBWHEEL_BIN=" python3 -m cibuildwheel"
6497fi
98+
99+ # Run cibuildwheel synchronously
65100${CIBWHEEL_BIN} --platform linux --output-dir dist
66101
67102if [ " ${DRY_RUN} " = " true" ]; then
0 commit comments