Skip to content

Commit b7b233a

Browse files
committed
Try moving install of MSIX to base dockerfile
1 parent 6c57b1d commit b7b233a

File tree

3 files changed

+17
-27
lines changed

3 files changed

+17
-27
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,15 @@ RUN (if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PYTHON_CMD "py
3434
(if "%python%"=="3.13" setx PYTHON_VERSION "3.13.7" && setx PYTHON_CMD "py -3.13") & \
3535
(if "%python%"=="3.14" setx PYTHON_VERSION "3.14.0" && setx PYTHON_CMD "py -3.14")
3636

37-
SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
38-
# Install Python install manager (MSIX)
39-
RUN $msix_url = 'https://www.python.org/ftp/python/installer/python.msix'; \
40-
Invoke-WebRequest -Uri $msix_url -OutFile 'python.msix'; \
41-
Add-AppxPackage .\python.msix
42-
4337
# Use python_abi_tag env var to select regular or free-threaded Python
4438
ARG freethreaded=0
4539
ENV PYTHON_MODE=${freethreaded}
46-
RUN if ($env:PYTHON_MODE -eq '1') { \
47-
pymanager install --version $env:PYTHON_VERSION --variant freethreaded \
48-
} else { \
49-
pymanager install --version $env:PYTHON_VERSION \
50-
}
40+
RUN if "%PYTHON_MODE%"=="1" ( \
41+
pymanager install --version %PYTHON_VERSION% --variant freethreaded \
42+
) else ( \
43+
pymanager install --version %PYTHON_VERSION% \
44+
)
5145

52-
SHELL ["cmd", "/S", "/C"]
5346
# hadolint ignore=DL3059
5447
RUN %PYTHON_CMD% -m pip install -U pip setuptools & \
5548
if "%python%"=="3.13" ( \

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@ RUN `
7474

7575
# Install choco CLI
7676
#
77-
# Switch into Powershell just for this command because choco only provides a
78-
# Powershell installation script. After, we switch back to cmd.
77+
# Switch into Powershell just for this command because choco and Python install manager (MSIX)
78+
# only provide a Powershell installation script. After, we switch back to cmd.
7979
#
8080
# See https://chocolatey.org/install#completely-offline-install
8181
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
8282
RUN `
83-
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
83+
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) & \
84+
$msix_url = 'https://www.python.org/ftp/python/installer/python.msix'; \
85+
Invoke-WebRequest -Uri $msix_url -OutFile 'python.msix'; \
86+
Add-AppxPackage .\python.msix
87+
8488
SHELL ["cmd", "/S", "/C"]
8589

8690
# Install CMake and other tools

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,15 @@ RUN (if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PYTHON_CMD "py
2929
(if "%python%"=="3.13" setx PYTHON_VERSION "3.13.7" && setx PYTHON_CMD "py -3.13") & \
3030
(if "%python%"=="3.14" setx PYTHON_VERSION "3.14.0" && setx PYTHON_CMD "py -3.14")
3131

32-
SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
33-
# Install Python install manager (MSIX)
34-
RUN $msix_url = 'https://www.python.org/ftp/python/installer/python.msix'; \
35-
Invoke-WebRequest -Uri $msix_url -OutFile 'python.msix'; \
36-
Add-AppxPackage .\python.msix
37-
3832
# Use python_abi_tag env var to select regular or free-threaded Python
3933
ARG freethreaded=0
4034
ENV PYTHON_MODE=${freethreaded}
41-
RUN if ($env:PYTHON_MODE -eq '1') { \
42-
pymanager install --version $env:PYTHON_VERSION --variant freethreaded \
43-
} else { \
44-
pymanager install --version $env:PYTHON_VERSION \
45-
}
35+
RUN if "%PYTHON_MODE%"=="1" ( \
36+
pymanager install --version %PYTHON_VERSION% --variant freethreaded \
37+
) else ( \
38+
pymanager install --version %PYTHON_VERSION% \
39+
)
4640

47-
SHELL ["cmd", "/S", "/C"]
4841
RUN %PYTHON_CMD% -m pip install -U pip setuptools
4942

5043
COPY python/requirements-wheel-build.txt C:/arrow/python/

0 commit comments

Comments
 (0)