|
1 | 1 | FROM ubuntu:22.04
|
2 | 2 |
|
3 | 3 | ## Main python version to install + use for tox
|
4 |
| -ARG PYTHON_MAIN_VERSION=3.11 |
| 4 | +ARG PYTHON_MAIN_VERSION=3.13 |
5 | 5 | ## Other python versions to install
|
6 | 6 | # Must be available either in the deadsnakes PPA or in
|
7 | 7 | # the official Ubuntu repositories
|
8 |
| -ARG PYTHON_OTHER_VERSIONS="3.7 3.8 3.9 3.10 3.12" |
| 8 | +ARG PYTHON_OTHER_VERSIONS="3.9 3.10 3.11 3.12 3.13" |
9 | 9 | ## PyPy version to install
|
10 | 10 | # for versions see https://www.pypy.org/download.html
|
11 | 11 | ARG PYTHON_PYPY_VERSION=3.9-v7.3.12
|
@@ -48,17 +48,26 @@ RUN set -eux \
|
48 | 48 | ; rm -rf /var/lib/apt/lists/*
|
49 | 49 |
|
50 | 50 | # Install pip3, all python versions and tox in the main python version
|
| 51 | +# distutils got removed in Python3.12 (https://docs.python.org/dev/whatsnew/3.12.html) |
51 | 52 | # hadolint ignore=DL3008,SC2086
|
52 | 53 | RUN set -eux \
|
53 | 54 | ; apt-get update \
|
54 | 55 | ; apt-get install -y --no-install-recommends python3-pip \
|
55 | 56 | ; for version in ${PYTHON_OTHER_VERSIONS} ${PYTHON_MAIN_VERSION} \
|
56 | 57 | ; do \
|
57 |
| - apt-get install -y --no-install-recommends \ |
58 |
| - python${version} \ |
59 |
| - python${version}-dev \ |
60 |
| - python${version}-venv \ |
61 |
| - python${version}-distutils \ |
| 58 | + if dpkg --compare-versions "$version" lt "3.12" \ |
| 59 | + ; then \ |
| 60 | + apt-get install -y --no-install-recommends \ |
| 61 | + python${version} \ |
| 62 | + python${version}-dev \ |
| 63 | + python${version}-venv \ |
| 64 | + python${version}-distutils \ |
| 65 | + ; else \ |
| 66 | + apt-get install -y --no-install-recommends \ |
| 67 | + python${version} \ |
| 68 | + python${version}-dev \ |
| 69 | + python${version}-venv \ |
| 70 | + ; fi \ |
62 | 71 | ; python${version} -m pip install --upgrade pip || python${version} -m ensurepip --upgrade \
|
63 | 72 | ; done \
|
64 | 73 | ; python${PYTHON_MAIN_VERSION} -m pip install --no-cache tox \
|
|
0 commit comments