Skip to content

Commit f268c43

Browse files
authored
GH-47438: [Python][Packaging] Set up wheel building for Python 3.14 (#47616)
### Rationale for this change Python 3.14 is currently in a prerelease status and is expected to have a final release in October this year (https://peps.python.org/pep-0745/). We should ensure we are fully ready to support Python 3.14 for the PyArrow 22 release. ### What changes are included in this PR? This PR updates wheels for Python 3.14. ### Are these changes tested? Tested in the CI and with extended builds. ### Are there any user-facing changes? No, but users will be able to use PyArrow with Python 3.14. * GitHub Issue: #47438 --- Todo: - Update the image revision name in `.env` - Add 3.14 conda build ([arrow/dev/tasks/tasks.yml](https://github.com/apache/arrow/blob/d803afcc43f5d132506318fd9e162d33b2c3d4cd/dev/tasks/tasks.yml#L809)) when conda-forge/pyarrow-feedstock#156 is merged Follow-ups: - #47437 Authored-by: AlenkaF <frim.alenka@gmail.com> Signed-off-by: AlenkaF <frim.alenka@gmail.com>
1 parent f66e568 commit f268c43

20 files changed

+127
-73
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ VCPKG="4334d8b4c8916018600212ab4dd4bbdc343065d1" # 2025.09.17 Release
102102
# ci/docker/python-*-windows-*.dockerfile or the vcpkg config.
103103
# This is a workaround for our CI problem that "archery docker build" doesn't
104104
# use pulled built images in dev/tasks/python-wheels/github.windows.yml.
105-
PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2025-09-04
106-
PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION=2025-09-04
105+
PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2025-10-13
106+
PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION=2025-10-13
107107

108108
# Use conanio/${CONAN_BASE}:{CONAN_VERSION} for "docker compose run --rm conan".
109109
# See https://github.com/conan-io/conan-docker-tools#readme and

ci/docker/python-free-threaded-wheel-manylinux-test-imports.dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@
1818
ARG base
1919
FROM ${base}
2020

21+
ARG python_version=3.13
22+
2123
ENV DEBIAN_FRONTEND=noninteractive
2224

2325
RUN apt-get update -y -q && \
2426
apt install -y -q --no-install-recommends software-properties-common gpg-agent && \
2527
add-apt-repository -y ppa:deadsnakes/ppa && \
2628
apt-get update -y -q && \
27-
apt install -y -q --no-install-recommends python3.13-dev python3.13-nogil python3.13-venv && \
29+
apt install -y -q --no-install-recommends python${python_version}-dev python${python_version}-nogil python${python_version}-venv && \
2830
apt-get clean && \
2931
rm -rf /var/lib/apt/lists*
3032

3133
ENV ARROW_PYTHON_VENV /arrow-dev
32-
RUN python3.13t -m venv ${ARROW_PYTHON_VENV}
34+
RUN python${python_version}t -m venv ${ARROW_PYTHON_VENV}
3335

3436
ENV PYTHON_GIL 0
3537
ENV PATH "${ARROW_PYTHON_VENV}/bin:${PATH}"

ci/docker/python-free-threaded-wheel-manylinux-test-unittests.dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ARG base
1919
FROM ${base}
2020

21+
ARG python_version=3.13
22+
2123
ENV DEBIAN_FRONTEND=noninteractive
2224

2325
RUN apt-get update -y -q && \
@@ -27,14 +29,14 @@ RUN apt-get update -y -q && \
2729
apt install -y -q --no-install-recommends \
2830
build-essential \
2931
libffi-dev \
30-
python3.13-dev \
31-
python3.13-nogil \
32-
python3.13-venv && \
32+
python${python_version}-dev \
33+
python${python_version}-nogil \
34+
python${python_version}-venv && \
3335
apt-get clean && \
3436
rm -rf /var/lib/apt/lists*
3537

3638
ENV ARROW_PYTHON_VENV /arrow-dev
37-
RUN python3.13t -m venv ${ARROW_PYTHON_VENV}
39+
RUN python${python_version}t -m venv ${ARROW_PYTHON_VENV}
3840

3941
ENV PYTHON_GIL 0
4042
ENV PATH "${ARROW_PYTHON_VENV}/bin:${PATH}"

ci/docker/python-free-threaded-wheel-musllinux-test-imports.dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
ARG base
1919
FROM ${base}
2020

21+
ARG python_version=3.13
22+
ARG python_patch_version=3.13.7
23+
2124
RUN apk add --no-cache \
2225
bash \
2326
build-base \
@@ -34,19 +37,19 @@ RUN apk add --no-cache \
3437
tzdata \
3538
zlib-dev
3639

37-
# Install Python3.13.2 without GIL
38-
RUN wget https://github.com/python/cpython/archive/refs/tags/v3.13.2.tar.gz && \
39-
tar -xzf v3.13.2.tar.gz && \
40-
rm v3.13.2.tar.gz && \
41-
cd cpython-3.13.2/ && \
40+
# Install Python without GIL
41+
RUN wget https://github.com/python/cpython/archive/refs/tags/v${python_patch_version}.tar.gz && \
42+
tar -xzf v${python_patch_version}.tar.gz && \
43+
rm v${python_patch_version}.tar.gz && \
44+
cd cpython-${python_patch_version}/ && \
4245
./configure --disable-gil --with-ensurepip && \
4346
make -j && \
4447
make install && \
4548
cd ../ && \
46-
rm -rf cpython-3.13.2/
49+
rm -rf cpython-${python_patch_version}/
4750

4851
ENV ARROW_PYTHON_VENV /arrow-dev
49-
RUN python3.13t -m venv ${ARROW_PYTHON_VENV}
52+
RUN python${python_version}t -m venv ${ARROW_PYTHON_VENV}
5053

5154
ENV PYTHON_GIL 0
5255
ENV PATH "${ARROW_PYTHON_VENV}/bin:${PATH}"

ci/docker/python-free-threaded-wheel-musllinux-test-unittests.dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
ARG base
1919
FROM ${base}
2020

21+
ARG python_version=3.13
22+
ARG python_patch_version=3.13.7
23+
2124
RUN apk add --no-cache \
2225
bash \
2326
build-base \
@@ -34,19 +37,19 @@ RUN apk add --no-cache \
3437
tzdata \
3538
zlib-dev
3639

37-
# Install Python3.13.2 without GIL
38-
RUN wget https://github.com/python/cpython/archive/refs/tags/v3.13.2.tar.gz && \
39-
tar -xzf v3.13.2.tar.gz && \
40-
rm v3.13.2.tar.gz && \
41-
cd cpython-3.13.2/ && \
40+
# Install Python without GIL
41+
RUN wget https://github.com/python/cpython/archive/refs/tags/v${python_patch_version}.tar.gz && \
42+
tar -xzf v${python_patch_version}.tar.gz && \
43+
rm v${python_patch_version}.tar.gz && \
44+
cd cpython-${python_patch_version}/ && \
4245
./configure --disable-gil --with-ensurepip && \
4346
make -j && \
4447
make install && \
4548
cd ../ && \
46-
rm -rf cpython-3.13.2/
49+
rm -rf cpython-${python_patch_version}/
4750

4851
ENV ARROW_PYTHON_VENV /arrow-dev
49-
RUN python3.13t -m venv ${ARROW_PYTHON_VENV}
52+
RUN python${python_version}t -m venv ${ARROW_PYTHON_VENV}
5053

5154
ENV PYTHON_GIL 0
5255
ENV PATH "${ARROW_PYTHON_VENV}/bin:${PATH}"

ci/docker/python-free-threaded-wheel-windows-test-vs2022.dockerfile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,34 @@ FROM ${base}
2626

2727
ARG python=3.13
2828

29+
# hadolint ignore=SC1072
30+
RUN (if "%python%"=="3.13" setx PYTHON_VERSION "3.13.1") & \
31+
(if "%python%"=="3.14" setx PYTHON_VERSION "3.14.0")
32+
2933
SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
30-
RUN $filename = 'python-3.13.1-amd64.exe'; \
31-
$url = 'https://www.python.org/ftp/python/3.13.1/' + $filename; \
34+
RUN $version = $env:PYTHON_VERSION; \
35+
$filename = 'python-' + $version + '-amd64.exe'; \
36+
$url = 'https://www.python.org/ftp/python/' + $version + '/' + $filename; \
3237
Invoke-WebRequest -Uri $url -OutFile $filename; \
3338
Start-Process -FilePath $filename -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait
3439

3540
ENV PYTHON_CMD="py -${python}t"
3641

3742
SHELL ["cmd", "/S", "/C"]
38-
RUN %PYTHON_CMD% -m pip install -U pip setuptools
39-
40-
COPY python/requirements-wheel-test-3.13t.txt C:/arrow/python/
41-
# Cython and Pandas wheels for 3.13 free-threaded are not released yet
43+
RUN %PYTHON_CMD% -m pip install -U pip setuptools & \
44+
if "%python%"=="3.13" ( \
45+
setx REQUIREMENTS_FILE "requirements-wheel-test-3.13t.txt" \
46+
) else ( \
47+
setx REQUIREMENTS_FILE "requirements-wheel-test.txt" \
48+
)
49+
50+
COPY python/requirements-wheel-test-3.13t.txt python/requirements-wheel-test.txt C:/arrow/python/
51+
# Cython and Pandas wheels for free-threaded are not released yet
4252
RUN %PYTHON_CMD% -m pip install \
4353
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
4454
--pre \
4555
--prefer-binary \
46-
-r C:/arrow/python/requirements-wheel-test-3.13t.txt
56+
-r C:/arrow/python/%REQUIREMENTS_FILE%
4757

4858
ENV PYTHON="${python}t"
4959
ENV PYTHON_GIL=0

ci/docker/python-free-threaded-wheel-windows-vs2022.dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ FROM ${base}
2626

2727
ARG python=3.13
2828

29+
RUN (if "%python%"=="3.13" setx PYTHON_VERSION "3.13.1") & \
30+
(if "%python%"=="3.14" setx PYTHON_VERSION "3.14.0")
31+
2932
SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
30-
RUN $filename = 'python-3.13.1-amd64.exe'; \
31-
$url = 'https://www.python.org/ftp/python/3.13.1/' + $filename; \
33+
RUN $version = $env:PYTHON_VERSION; \
34+
$filename = 'python-' + $version + '-amd64.exe'; \
35+
$url = 'https://www.python.org/ftp/python/' + $version + '/' + $filename; \
3236
Invoke-WebRequest -Uri $url -OutFile $filename; \
3337
Start-Process -FilePath $filename -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait
3438

ci/docker/python-wheel-musllinux.dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ RUN --mount=type=secret,id=github_repository_owner \
8282
export GITHUB_REPOSITORY_OWNER=$(cat /run/secrets/github_repository_owner); \
8383
export GITHUB_TOKEN=$(cat /run/secrets/github_token); \
8484
export VCPKG_BINARY_SOURCES=$(cat /run/secrets/vcpkg_binary_sources); \
85+
export CMAKE_POLICY_VERSION_MINIMUM=3.5; \
8586
arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} && \
8687
vcpkg install \
8788
--clean-after-build \
@@ -110,10 +111,5 @@ RUN PYTHON_ROOT=$(find /opt/python -name cp${PYTHON_VERSION/./}-${PYTHON_ABI_TAG
110111
SHELL ["/bin/bash", "-i", "-c", "-l"]
111112
ENTRYPOINT ["/bin/bash", "-i", "-c", "-l"]
112113

113-
# Remove once there are released Cython wheels for 3.13 free-threaded available
114-
RUN if [ "${python_abi_tag}" = "cp313t" ]; then \
115-
pip install cython --pre --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" --prefer-binary ; \
116-
fi
117-
118114
COPY python/requirements-wheel-build.txt /arrow/python/
119115
RUN pip install -r /arrow/python/requirements-wheel-build.txt

ci/docker/python-wheel-windows-test-vs2022.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ FROM ${base}
3030
ARG python=3.10
3131
RUN (if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PYTHON_CMD "py -3.10") & \
3232
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.9" && setx PYTHON_CMD "py -3.11") & \
33-
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.8" && setx PYTHON_CMD "py -3.12") & \
34-
(if "%python%"=="3.13" setx PYTHON_VERSION "3.13.1" && setx PYTHON_CMD "py -3.13")
33+
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.10" && setx PYTHON_CMD "py -3.12") & \
34+
(if "%python%"=="3.13" setx PYTHON_VERSION "3.13.7" && setx PYTHON_CMD "py -3.13") & \
35+
(if "%python%"=="3.14" setx PYTHON_VERSION "3.14.0" && setx PYTHON_CMD "py -3.14")
3536

3637
# hadolint ignore=DL3059
3738
RUN choco install -r -y --pre --no-progress --force python --version=%PYTHON_VERSION%

ci/docker/python-wheel-windows-vs2022.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ FROM ${base}
2525
ARG python=3.10
2626
RUN (if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PYTHON_CMD "py -3.10") & \
2727
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.9" && setx PYTHON_CMD "py -3.11") & \
28-
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.8" && setx PYTHON_CMD "py -3.12") & \
29-
(if "%python%"=="3.13" setx PYTHON_VERSION "3.13.1" && setx PYTHON_CMD "py -3.13")
28+
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.10" && setx PYTHON_CMD "py -3.12") & \
29+
(if "%python%"=="3.13" setx PYTHON_VERSION "3.13.7" && setx PYTHON_CMD "py -3.13") & \
30+
(if "%python%"=="3.14" setx PYTHON_VERSION "3.14.0" && setx PYTHON_CMD "py -3.14")
3031

3132
RUN choco install -r -y --pre --no-progress python --version=%PYTHON_VERSION%
3233
RUN %PYTHON_CMD% -m pip install -U pip setuptools

0 commit comments

Comments
 (0)