From 9fee88457cb4823326a729abb35c7faae6ddbfa4 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 15 Apr 2024 13:09:02 +0200 Subject: [PATCH] GH-39848: [Python][Packaging] Build pyarrow wheels with numpy RC instead of nightly (#41097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Rationale for this change Now NumPy has released a first RC for 2.0, we should update our PyArrow wheels to build with this released version instead of with the nightly numpy packages, to ensure we don't build our release wheels with an unstable numpy version. ### What changes are included in this PR? Increased the version requirement for numpy for the installed packages at build time to `numpy>=2.0.0rc1`, to force installing this RC instead of numpy 1.26 ### Are these changes tested? The wheel tests ensure that those wheels still work with older versions of numpy * GitHub Issue: #39848 Authored-by: Joris Van den Bossche Signed-off-by: Raúl Cumplido --- .env | 2 +- ci/docker/python-wheel-manylinux.dockerfile | 3 +-- ci/docker/python-wheel-windows-vs2019.dockerfile | 3 +-- ci/scripts/python_wheel_macos_build.sh | 5 +---- python/requirements-wheel-build.txt | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 997801ef866c1..f379ca14cd205 100644 --- a/.env +++ b/.env @@ -98,7 +98,7 @@ VCPKG="a42af01b72c28a8e1d7b48107b33e4f286a55ef6" # 2023.11.20 Release # ci/docker/python-wheel-windows-vs2019.dockerfile. # This is a workaround for our CI problem that "archery docker build" doesn't # use pulled built images in dev/tasks/python-wheels/github.windows.yml. -PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2024-03-19 +PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2024-04-09 # Use conanio/${CONAN_BASE}:{CONAN_VERSION} for "docker-compose run --rm conan". # See https://github.com/conan-io/conan-docker-tools#readme and diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index b1d9ed5ab88d9..63fd7b1d46820 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -99,5 +99,4 @@ SHELL ["/bin/bash", "-i", "-c"] ENTRYPOINT ["/bin/bash", "-i", "-c"] COPY python/requirements-wheel-build.txt /arrow/python/ -# TODO(GH-39848) Remove the `--pre --extra-index-url` for numpy nightly again before the 16.0 release -RUN pip install -r /arrow/python/requirements-wheel-build.txt --pre --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" +RUN pip install -r /arrow/python/requirements-wheel-build.txt diff --git a/ci/docker/python-wheel-windows-vs2019.dockerfile b/ci/docker/python-wheel-windows-vs2019.dockerfile index 0ab5071abb86c..ff42de939d91f 100644 --- a/ci/docker/python-wheel-windows-vs2019.dockerfile +++ b/ci/docker/python-wheel-windows-vs2019.dockerfile @@ -89,8 +89,7 @@ RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION% RUN python -m pip install -U pip setuptools COPY python/requirements-wheel-build.txt arrow/python/ -# TODO(GH-39848) Remove the `--pre --extra-index-url` for numpy nightly again before the 16.0 release -RUN python -m pip install -r arrow/python/requirements-wheel-build.txt --pre --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" +RUN python -m pip install -r arrow/python/requirements-wheel-build.txt # ENV CLCACHE_DIR="C:\clcache" # ENV CLCACHE_COMPRESS=1 diff --git a/ci/scripts/python_wheel_macos_build.sh b/ci/scripts/python_wheel_macos_build.sh index a94dac40e931f..3ed9d5d8dd12f 100755 --- a/ci/scripts/python_wheel_macos_build.sh +++ b/ci/scripts/python_wheel_macos_build.sh @@ -50,15 +50,12 @@ echo "=== (${PYTHON_VERSION}) Install Python build dependencies ===" export PIP_SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])') export PIP_TARGET_PLATFORM="macosx_${MACOSX_DEPLOYMENT_TARGET//./_}_${arch}" -# TODO(GH-39848) Remove the `--pre --extra-index-url` for numpy nightly again before the 16.0 release pip install \ --upgrade \ --only-binary=:all: \ --target $PIP_SITE_PACKAGES \ --platform $PIP_TARGET_PLATFORM \ - -r ${source_dir}/python/requirements-wheel-build.txt \ - --pre \ - --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" + -r ${source_dir}/python/requirements-wheel-build.txt pip install "delocate>=0.10.3" echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" diff --git a/python/requirements-wheel-build.txt b/python/requirements-wheel-build.txt index 9920a38a4e288..3ea57b611f9d8 100644 --- a/python/requirements-wheel-build.txt +++ b/python/requirements-wheel-build.txt @@ -1,6 +1,6 @@ cython>=0.29.31 oldest-supported-numpy>=0.14; python_version<'3.9' -numpy>=1.25; python_version>='3.9' +numpy>=2.0.0rc1; python_version>='3.9' setuptools_scm setuptools>=58 wheel