From 4a5af8e7ff5be3cc47af4866981709f4636c4909 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 29 Aug 2024 10:20:00 +0200 Subject: [PATCH] GH-43883: [CI] Remove Python version guard when installing GCS testbench --- .../python-wheel-manylinux-test.dockerfile | 14 ++++++++++---- ci/scripts/install_gcs_testbench.sh | 19 +++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ci/docker/python-wheel-manylinux-test.dockerfile b/ci/docker/python-wheel-manylinux-test.dockerfile index 443ff9c53cbcb..09883f9780a36 100644 --- a/ci/docker/python-wheel-manylinux-test.dockerfile +++ b/ci/docker/python-wheel-manylinux-test.dockerfile @@ -19,13 +19,19 @@ ARG arch ARG python_image_tag FROM ${arch}/python:${python_image_tag} -# RUN pip install --upgrade pip - # pandas doesn't provide wheel for aarch64 yet, so cache the compiled # test dependencies in a docker image COPY python/requirements-wheel-test.txt /arrow/python/ RUN pip install -r /arrow/python/requirements-wheel-test.txt +# Install the GCS testbench with the system Python +RUN apt-get update -y -q && \ + apt-get install -y -q \ + build-essential \ + python3-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists* + COPY ci/scripts/install_gcs_testbench.sh /arrow/ci/scripts/ -ARG python -RUN PYTHON_VERSION=${python} /arrow/ci/scripts/install_gcs_testbench.sh default +ENV PIPX_PYTHON=/usr/bin/python3 PIPX_PIP_ARGS=--prefer-binary +RUN /arrow/ci/scripts/install_gcs_testbench.sh default diff --git a/ci/scripts/install_gcs_testbench.sh b/ci/scripts/install_gcs_testbench.sh index 78826e94d3294..f3aac2a661afe 100755 --- a/ci/scripts/install_gcs_testbench.sh +++ b/ci/scripts/install_gcs_testbench.sh @@ -42,15 +42,14 @@ fi : ${PIPX_PYTHON:=$(which python3)} export PIP_BREAK_SYSTEM_PACKAGES=1 -${PIPX_PYTHON} -m pip install -U pipx +python3 -m pip install -U pipx -# This script is run with PYTHON undefined in some places, -# but those only use older pythons. -if [[ -z "${PYTHON_VERSION}" ]] || [[ "${PYTHON_VERSION}" != "3.13" ]]; then - pipx_flags=--verbose - if [[ $(id -un) == "root" ]]; then - # Install globally as /root/.local/bin is typically not in $PATH - pipx_flags="${pipx_flags} --global" - fi - ${PIPX_PYTHON} -m pipx install ${pipx_flags} "https://github.com/googleapis/storage-testbench/archive/${version}.tar.gz" +pipx_flags="--verbose --python ${PIPX_PYTHON}" +if [[ $(id -un) == "root" ]]; then + # Install globally as /root/.local/bin is typically not in $PATH + pipx_flags="${pipx_flags} --global" fi +if [[ ! -z "${PIPX_PIP_ARGS}" ]]; then + pipx_flags="${pipx_flags} --pip-args '${PIPX_PIP_ARGS}'" +fi +python3 -m pipx install ${pipx_flags} "https://github.com/googleapis/storage-testbench/archive/${version}.tar.gz"