|
1 | 1 | #!/bin/bash |
2 | 2 | set -e |
3 | 3 |
|
| 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 | +# Pass these environment variables to the cibuildwheel Docker container |
| 10 | +export CIBW_ENVIRONMENT="VIRTUALENV_NO_DOWNLOAD=1 PIP_DISABLE_PIP_VERSION_CHECK=1" |
| 11 | +export CIBW_DEPENDENCY_VERSIONS="latest" |
| 12 | + |
4 | 13 | # If running locally (not on Kokoro), authenticate with gcloud. |
5 | 14 | if [ -z "${KOKORO_BUILD_ID}" ]; then |
6 | 15 | if ! gcloud auth application-default print-access-token --quiet > /dev/null; then |
7 | 16 | gcloud auth application-default login |
8 | 17 | fi |
9 | 18 | fi |
10 | 19 |
|
11 | | -pip install -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel |
| 20 | +pip install --no-cache-dir -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel |
12 | 21 |
|
13 | 22 | REPO_DIR=$(mktemp -d) |
14 | 23 | echo "Created temporary directory: ${REPO_DIR}" |
@@ -52,16 +61,24 @@ cp -r "${SRC_DIR}"/{*,.*} . 2>/dev/null || true |
52 | 61 | cp -r "${SRC_DIR}"/release/* . 2>/dev/null || true |
53 | 62 | rm -rf cel_expr_python/*_test.py |
54 | 63 |
|
| 64 | +echo "Downloading bazelisk on host..." |
| 65 | +curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 |
| 66 | +chmod +x bazelisk-linux-amd64 |
| 67 | + |
55 | 68 | # Check if pyproject.toml exists before running sed |
56 | 69 | if [ -f pyproject.toml ]; then |
57 | 70 | sed -i "" "s/\$VERSION/${VERSION}/g" pyproject.toml || sed -i "s/\$VERSION/${VERSION}/g" pyproject.toml |
58 | 71 | fi |
59 | 72 |
|
| 73 | +export CIBW_CONTAINER_ENGINE_EXTRA_ARGS="--network=host" |
| 74 | + |
60 | 75 | echo "Running cibuildwheel: ${CIBWHEEL_BIN}" |
61 | 76 | # Default CIBWHEEL_BIN if not set |
62 | 77 | if [ -z "${CIBWHEEL_BIN}" ]; then |
63 | 78 | CIBWHEEL_BIN="python3 -m cibuildwheel" |
64 | 79 | fi |
| 80 | + |
| 81 | +# Run cibuildwheel synchronously |
65 | 82 | ${CIBWHEEL_BIN} --platform linux --output-dir dist |
66 | 83 |
|
67 | 84 | if [ "${DRY_RUN}" = "true" ]; then |
|
0 commit comments