Skip to content

Commit

Permalink
Parameterize Python version
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Jan 7, 2025
1 parent c0acbc5 commit 4c9872d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
# NOTE: You must update PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
# contains choco and vs2019 preinstalled
ARG base
FROM ${base}

ARG python=3.13

SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN $filename = 'python-3.13.1-amd64.exe'; \
$url = 'https://www.python.org/ftp/python/3.13.1/' + $filename; \
Invoke-WebRequest -Uri $url -OutFile $filename; \
Start-Process -FilePath $filename -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait

ENV PYTHON_CMD="py -3.13t"
ENV PYTHON_CMD="py -${python}t"

SHELL ["cmd", "/S", "/C"]
RUN %PYTHON_CMD% -m pip install -U pip setuptools
Expand All @@ -44,5 +44,5 @@ RUN %PYTHON_CMD% -m pip install \
# cffi-based tests would crash when importing cffi.
RUN %PYTHON_CMD% -m pip uninstall -y cffi

ENV PYTHON="3.13t"
ENV PYTHON="${python}t"
ENV PYTHON_GIL=0
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
# NOTE: You must update PYTHON_WHEEL_WINDOWS_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
# contains choco and vs2019 preinstalled
ARG base
FROM ${base}

ARG python=3.13

SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN $filename = 'python-3.13.1-amd64.exe'; \
$url = 'https://www.python.org/ftp/python/3.13.1/' + $filename; \
Invoke-WebRequest -Uri $url -OutFile $filename; \
Start-Process -FilePath $filename -ArgumentList '/quiet', 'Include_freethreaded=1' -Wait

ENV PYTHON_CMD="py -3.13t"
ENV PYTHON_CMD="py -${python}t"

SHELL ["cmd", "/S", "/C"]
RUN %PYTHON_CMD% -m pip install -U pip setuptools
Expand All @@ -43,4 +43,4 @@ RUN %PYTHON_CMD% -m pip install \
cython
RUN %PYTHON_CMD% -m pip install -r C:/arrow/python/requirements-wheel-build.txt

ENV PYTHON="3.13t"
ENV PYTHON="${python}t"
2 changes: 0 additions & 2 deletions ci/docker/python-wheel-windows-test-vs2019.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# NOTE: You must update PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
# contains choco and vs2019 preinstalled
ARG base
# hadolint ignore=DL3006
FROM ${base}
Expand Down
2 changes: 0 additions & 2 deletions ci/docker/python-wheel-windows-vs2019.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# NOTE: You must update PYTHON_WHEEL_WINDOWS_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
# contains choco and vs2019 preinstalled
ARG base
FROM ${base}

Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1303,17 +1303,18 @@ services:
command: arrow\\ci\\scripts\\python_wheel_windows_build.bat

python-free-threaded-wheel-windows-vs2019:
image: ${REPO}:python-3.13-free-threaded-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
image: ${REPO}:python-${PYTHON}-free-threaded-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
build:
args:
base: ${REPO}:python-wheel-windows-vs2019-base-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
python: ${PYTHON}
context: .
dockerfile: ci/docker/python-free-threaded-wheel-windows-vs2019.dockerfile
# This should make the pushed images reusable, but the image gets rebuilt.
# Uncomment if no local cache is available.
# cache_from:
# - abrarov/msvc-2019:2.11.0
# - ${REPO}:python-3.13-free-threaded-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
# - ${REPO}:python-${PYTHON}-free-threaded-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
volumes: *python-wheel-windows-vs2019-volumes
command: arrow\\ci\\scripts\\python_wheel_windows_build.bat

Expand All @@ -1336,7 +1337,7 @@ services:
command: arrow\\ci\\scripts\\python_wheel_windows_test.bat

python-free-threaded-wheel-windows-test:
image: ${REPO}:python-3.13-free-threaded-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
image: ${REPO}:python-${PYTHON}-free-threaded-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
build:
args:
base: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
Expand Down

0 comments on commit 4c9872d

Please sign in to comment.