|
1 | 1 | # This list must match the versions specified in |
2 | 2 | # uv/lib/dependabot/uv/language.rb: PRE_INSTALLED_PYTHON_VERSIONS_RAW |
3 | 3 | # Python versions are pinned to the release of each minor/patch version. |
| 4 | +ARG PY_3_14=3.14.0 |
4 | 5 | ARG PY_3_13=3.13.5 |
5 | 6 | ARG PY_3_12=3.12.11 |
6 | 7 | ARG PY_3_11=3.11.13 |
7 | 8 | ARG PY_3_10=3.10.18 |
8 | 9 | ARG PY_3_9=3.9.23 |
9 | | -ARG PYENV_VERSION=v2.5.2 |
| 10 | +# https://github.com/pyenv/pyenv/releases |
| 11 | +ARG PYENV_VERSION=v2.6.11 |
| 12 | + |
10 | 13 | # This cannot be inlined below (e.g., COPY --from=...) because Dependabot does not support that syntax yet |
11 | 14 | FROM ghcr.io/astral-sh/uv:0.8.4 AS uv |
12 | 15 |
|
13 | 16 | FROM ghcr.io/dependabot/dependabot-updater-core AS python-core |
| 17 | +ARG PY_3_14 |
14 | 18 | ARG PY_3_13 |
15 | 19 | ARG PY_3_12 |
16 | 20 | ARG PY_3_11 |
@@ -123,6 +127,23 @@ RUN find $PYTHON_INSTALL_LOCATION/bin -type f -exec sed -i "1s|^#!/usr/local/bin |
123 | 127 | # Ensure pyenv works and it's the python version we expect |
124 | 128 | RUN PYENV_VERSION=$PY_3_13 pyenv exec python --version | grep "Python $PY_3_13" || exit 1 |
125 | 129 | RUN bash /opt/python/helpers/build $PY_3_13 |
| 130 | +RUN cd $PYENV_ROOT/versions \ |
| 131 | + && tar -acf $PY_3_13.tar.zst $PY_3_13 |
| 132 | + |
| 133 | +## 3.14 |
| 134 | +# Docker doesn't support parametrizing `COPY --from:python:$PY_1_23-bookworm`, so work around it using an alias. |
| 135 | +# TODO: If upstream adds support for Ubuntu, use that instead of Debian as the base suffix: https://github.com/docker-library/python/pull/791 |
| 136 | +FROM docker.io/library/python:$PY_3_14-bookworm AS upstream-python-3.14 |
| 137 | +FROM python-core AS python-3.14 |
| 138 | +ARG PYTHON_INSTALL_LOCATION="$PYENV_ROOT/versions/$PY_3_14" |
| 139 | +COPY --from=upstream-python-3.14 --chown=dependabot:dependabot /usr/local/bin $PYTHON_INSTALL_LOCATION/bin |
| 140 | +COPY --from=upstream-python-3.14 --chown=dependabot:dependabot /usr/local/include $PYTHON_INSTALL_LOCATION/include |
| 141 | +COPY --from=upstream-python-3.14 --chown=dependabot:dependabot /usr/local/lib $PYTHON_INSTALL_LOCATION/lib |
| 142 | +# `pip` and other scripts need their shebangs rewritten for the new location |
| 143 | +RUN find $PYTHON_INSTALL_LOCATION/bin -type f -exec sed -i "1s|^#!/usr/local/bin/python|#!${PYTHON_INSTALL_LOCATION}/bin/python|" {} + |
| 144 | +# Ensure pyenv works and it's the python version we expect |
| 145 | +RUN PYENV_VERSION=$PY_3_14 pyenv exec python --version | grep "Python $PY_3_14" || exit 1 |
| 146 | +RUN bash /opt/python/helpers/build $PY_3_14 |
126 | 147 | # This is the default Python, so no need to tar it |
127 | 148 |
|
128 | 149 | FROM python-core |
@@ -155,12 +176,13 @@ COPY --from=python-3.9 $PYENV_ROOT/versions/$PY_3_9.tar.zst $PYENV_ROOT/versions |
155 | 176 | COPY --from=python-3.10 $PYENV_ROOT/versions/$PY_3_10.tar.zst $PYENV_ROOT/versions/$PY_3_10.tar.zst |
156 | 177 | COPY --from=python-3.11 $PYENV_ROOT/versions/$PY_3_11.tar.zst $PYENV_ROOT/versions/$PY_3_11.tar.zst |
157 | 178 | COPY --from=python-3.12 $PYENV_ROOT/versions/$PY_3_12.tar.zst $PYENV_ROOT/versions/$PY_3_12.tar.zst |
158 | | -COPY --from=python-3.13 $PYENV_ROOT/versions/ $PYENV_ROOT/versions/ |
| 179 | +COPY --from=python-3.13 $PYENV_ROOT/versions/$PY_3_13.tar.zst $PYENV_ROOT/versions/$PY_3_13.tar.zst |
| 180 | +COPY --from=python-3.14 $PYENV_ROOT/versions/ $PYENV_ROOT/versions/ |
159 | 181 |
|
160 | 182 | # Copy the output of the build script, it should be identical across Python versions |
161 | | -COPY --from=python-3.13 /opt/python/ /opt/python/ |
| 183 | +COPY --from=python-3.14 /opt/python/ /opt/python/ |
162 | 184 |
|
163 | | -RUN pyenv global $PY_3_13 |
| 185 | +RUN pyenv global $PY_3_14 |
164 | 186 |
|
165 | 187 | USER root |
166 | 188 |
|
|
0 commit comments