Skip to content

Commit 8084003

Browse files
committed
Merge branch 'update-python-versions' into 'main'
chore: docker: update Python versions according to https://endoflife.date/python See merge request divio/incubator/multi-python!6
2 parents 4979c6b + 39b8d69 commit 8084003

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

Dockerfile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:22.04
22

33
## Main python version to install + use for tox
4-
ARG PYTHON_MAIN_VERSION=3.11
4+
ARG PYTHON_MAIN_VERSION=3.13
55
## Other python versions to install
66
# Must be available either in the deadsnakes PPA or in
77
# 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"
99
## PyPy version to install
1010
# for versions see https://www.pypy.org/download.html
1111
ARG PYTHON_PYPY_VERSION=3.9-v7.3.12
@@ -48,17 +48,26 @@ RUN set -eux \
4848
; rm -rf /var/lib/apt/lists/*
4949

5050
# 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)
5152
# hadolint ignore=DL3008,SC2086
5253
RUN set -eux \
5354
; apt-get update \
5455
; apt-get install -y --no-install-recommends python3-pip \
5556
; for version in ${PYTHON_OTHER_VERSIONS} ${PYTHON_MAIN_VERSION} \
5657
; 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 \
6271
; python${version} -m pip install --upgrade pip || python${version} -m ensurepip --upgrade \
6372
; done \
6473
; python${PYTHON_MAIN_VERSION} -m pip install --no-cache tox \

test/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tox]
2-
envlist = py37,py38,py39,py3.10,py3.11,py3.12,pypy3
2+
envlist = py39,py3.10,py3.11,py3.12,py3.13,pypy3
33
skip_missing_interpreters = false

0 commit comments

Comments
 (0)