Skip to content

Commit 1b9d7d8

Browse files
committed
Ensure Python versions ending in t are isntalled to a dir ending in t
The t denotes that it is a free threading version of Python, so could potentially be installed along side a non-free-threaded version of Python
1 parent aecc6f4 commit 1b9d7d8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ FROM builder-py-base as builder-py-3_13t
4646
# --disable-test-modules --enable-optimizations --with-lto
4747
ENV PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto --with-system-expat --without-ensurepip'
4848
RUN /build_python.sh 3.13.0rc3t
49-
RUN mv /snekbin/python/3.13 /snekbin/python/3.13t
5049
# ------------------------------------------------------------------------------
5150
FROM python:3.12-slim-bookworm as base
5251

scripts/build_python.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ shopt -s inherit_errexit
44

55
py_version="${1}"
66

7-
# Install Python interpreter under e.g. /snekbin/python/3.11/ (no patch version).
7+
# Install Python interpreter under e.g. /snekbin/python/3.13/ (no patch version)
8+
# By dropping everything after, and including, the last period.
9+
install_path="${1%[-.]*}"
10+
11+
# If python version ends with a t, then ensure Python is installed to a dir ending with a t.
12+
if [[ $py_version == *t ]]; then
13+
install_path+="t"
14+
fi
15+
816
"${PYENV_ROOT}/plugins/python-build/bin/python-build" \
917
"${py_version}" \
10-
"/snekbin/python/${py_version%[-.]*}"
11-
"/snekbin/python/${py_version%[-.]*}/bin/python" -m pip install -U pip
18+
"/snekbin/python/${install_path}"
19+
"/snekbin/python/${install_path}/bin/python" -m pip install -U pip
1220

1321
# Clean up some unnecessary files to reduce image size bloat.
1422
find /snekbin/python/ -depth \

0 commit comments

Comments
 (0)