@@ -49,15 +49,26 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4949 apt-get update && \
5050 apt-get install -y curl git-core python3-pip \
5151 python3.8 python3.8-venv python3.8-dev \
52+ python3.10 python3.10-venv python3.10-dev \
5253 python3.11 python3.11-venv python3.11-dev \
54+ python3.12 python3.12-venv python3.12-dev \
55+ python3.13 python3.13-venv python3.13-dev \
5356 virtualenv net-tools libev4 libev-dev wget gcc libxml2 libxslt1-dev \
5457 vim lsof sudo libjemalloc2 dumb-init locales rsync \
5558 openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk openjdk-21-jdk ant ant-optional
5659
5760RUN update-alternatives --remove java /usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)/jre/bin/java
5861RUN update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)/bin/java 1081
59- RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
60- RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 3
62+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
63+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
64+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
65+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1
66+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1
67+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
68+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
69+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
70+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
71+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1
6172RUN python3.8 -m pip install --upgrade pip
6273
6374# generate locales for the standard en_US.UTF8 value we use for testing
@@ -101,7 +112,7 @@ RUN bash /tmp/_prepopulate_maven_deps.sh /home/image-cache/.m2/repository
101112RUN cp -a /home/cassandra-tmp/.gradle /home/image-cache/.gradle
102113
103114# run pip commands and setup virtualenv (note we do this after we switch to cassandra user so we
104- # setup the virtualenv for the cassandra user and not the root user by accident ) for Python 3.8/3.11
115+ # setup the virtualenv for the cassandra user, not root) for Python 3.8-3.13
105116# Don't build cython extensions when installing cassandra-driver. During test execution the driver
106117# dependency is refreshed via pip install --upgrade, so that driver changes can be pulled in without
107118# requiring the image to be rebuilt. Rebuilding compiled extensions is costly and is disabled by
@@ -118,6 +129,16 @@ RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
118129 && pip3 install -r /opt/requirements.txt \
119130 && pip3 freeze --user"
120131
132+ RUN virtualenv --python=python3.10 ${BUILD_HOME}/env3.10
133+ RUN chmod +x ${BUILD_HOME}/env3.10/bin/activate
134+
135+ RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
136+ && source ${BUILD_HOME}/env3.10/bin/activate \
137+ && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 \
138+ && pip3 install --upgrade \"pip<25.0\" \"setuptools==60.8.2\" wheel \
139+ && pip3 install --no-build-isolation -r /opt/requirements.txt \
140+ && pip3 freeze --user"
141+
121142RUN python3.11 -m venv ${BUILD_HOME}/env3.11
122143RUN chmod +x ${BUILD_HOME}/env3.11/bin/activate
123144
@@ -128,6 +149,28 @@ RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
128149 && pip3 install --no-build-isolation -r /opt/requirements.txt \
129150 && pip3 freeze --user"
130151
152+ RUN virtualenv --python=python3.12 ${BUILD_HOME}/env3.12
153+ RUN chmod +x ${BUILD_HOME}/env3.12/bin/activate
154+
155+ RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
156+ && source ${BUILD_HOME}/env3.12/bin/activate \
157+ && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 \
158+ && pip3 install --upgrade \"pip<25.0\" \"setuptools>=65.5.0,<70.0.0\" wheel \
159+ && sed -i 's/pkgutil.ImpImporter/type(\"ImpImporter\", (object,), {})/g' ${BUILD_HOME}/env3.12/lib/python3.12/site-packages/pkg_resources/__init__.py \
160+ && pip3 install --no-build-isolation -r /opt/requirements.txt \
161+ && pip3 freeze --user"
162+
163+ RUN virtualenv --python=python3.13 ${BUILD_HOME}/env3.13
164+ RUN chmod +x ${BUILD_HOME}/env3.13/bin/activate
165+
166+ RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
167+ && source ${BUILD_HOME}/env3.13/bin/activate \
168+ && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 \
169+ && pip3 install --upgrade \"pip<25.0\" \"setuptools>=65.5.0,<70.0.0\" wheel \
170+ && sed -i 's/pkgutil.ImpImporter/type(\"ImpImporter\", (object,), {})/g' ${BUILD_HOME}/env3.13/lib/python3.13/site-packages/pkg_resources/__init__.py \
171+ && pip3 install --no-build-isolation -r /opt/requirements.txt \
172+ && pip3 freeze --user"
173+
131174# 4* requires java8, sudo doesn't work on cross-platform builds
132175USER root
133176RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)/bin/java
0 commit comments