Skip to content

Commit b743157

Browse files
authored
Move tests to py3.12. Implements #2146 (#2152)
* Move tests to py3.12 * Add missing py321 package * Update reqs * Update reqs * Update base image to ubuntu 24 * Update required_status_checks to 3.12
1 parent 0fc37ae commit b743157

10 files changed

Lines changed: 145 additions & 48 deletions

File tree

.asf.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ github:
4848
- "Unit Tests (Python 3.12)"
4949
- "Unit Tests (Python 3.13)"
5050
- "Dependency Review"
51-
# - "Run Various Lint and Other Checks (3.10)"
52-
# - "Build and upload Documentation (3.10)"
51+
- "Run Various Lint and Other Checks (3.12)"
52+
- "Build and upload Documentation (3.12)"
5353

5454
notifications:
5555
jobs: notifications@libcloud.apache.org

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
strategy:
3232
matrix:
33-
python_version: [ "3.10" ]
33+
python_version: [ "3.12" ]
3434

3535
steps:
3636
- uses: actions/checkout@v7

.github/workflows/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
strategy:
8585
matrix:
86-
python_version: [ "3.10" ]
86+
python_version: [ "3.12" ]
8787

8888
steps:
8989
- uses: actions/checkout@v7
@@ -131,7 +131,7 @@ jobs:
131131

132132
strategy:
133133
matrix:
134-
python_version: [ "3.10" ]
134+
python_version: [ "3.12" ]
135135

136136
steps:
137137
- uses: actions/checkout@v7
@@ -173,7 +173,7 @@ jobs:
173173

174174
strategy:
175175
matrix:
176-
python_version: [ "3.10" ]
176+
python_version: [ "3.12" ]
177177

178178
steps:
179179
- uses: actions/checkout@v7
@@ -231,7 +231,7 @@ jobs:
231231
tar -xzvf "${TARBALL_FILENAME}"
232232
233233
cd "apache_libcloud-${VERSION}/"
234-
tox -c tox.ini -epy3.10
234+
tox -c tox.ini -epy3.12
235235
236236
- name: Verify Wheel Release Artifact
237237
run: |
@@ -251,15 +251,15 @@ jobs:
251251
cp ../../tox.ini .
252252
cp ../../pyproject.toml .
253253
cp ../../libcloud/test/secrets.py-dist libcloud/test/secrets.py-dist
254-
tox -c tox.ini -epy3.10
254+
tox -c tox.ini -epy3.12
255255
256256
build_test_docker_image:
257257
name: Build and Verify Docker Image
258258
runs-on: ubuntu-latest
259259

260260
strategy:
261261
matrix:
262-
python_version: [ "3.10" ]
262+
python_version: [ "3.12" ]
263263

264264
steps:
265265
- uses: actions/checkout@v7
@@ -278,7 +278,7 @@ jobs:
278278

279279
strategy:
280280
matrix:
281-
python_version: [ "3.10" ]
281+
python_version: [ "3.12" ]
282282

283283
steps:
284284
- uses: actions/checkout@v7
@@ -351,7 +351,7 @@ jobs:
351351

352352
strategy:
353353
matrix:
354-
python_version: [ "3.10" ]
354+
python_version: [ "3.12" ]
355355

356356
steps:
357357
- uses: actions/checkout@v7
@@ -390,7 +390,7 @@ jobs:
390390

391391
strategy:
392392
matrix:
393-
python_version: [ "3.10" ]
393+
python_version: [ "3.12" ]
394394

395395
steps:
396396
- uses: actions/checkout@v7

.github/workflows/publish_dev_artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Use Python ${{ matrix.python_version }}
2828
uses: actions/setup-python@v6
2929
with:
30-
python-version: "3.10"
30+
python-version: "3.12"
3131
- name: Install uv
3232
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3
3333

.github/workflows/publish_pricing_to_s3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
python_version: [ "3.10" ]
20+
python_version: [ "3.12" ]
2121

2222
steps:
2323
- uses: actions/checkout@v7

contrib/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Docker image used for running tests the under all the supported Python
1717
# versions
18-
FROM ubuntu:22.04
18+
FROM ubuntu:24.04
1919

2020
ARG DEBIAN_FRONTEND=noninteractive
2121

@@ -42,8 +42,6 @@ RUN set -e && \
4242
pypy3 \
4343
pypy3-dev \
4444
python3-pip \
45-
python3-distutils \
46-
python3.10-distutils \
4745
libvirt-dev \
4846
# Needed by libvirt driver
4947
pkg-config
@@ -54,9 +52,10 @@ COPY . /libcloud
5452
RUN if [ ! -f "/libcloud/README.rst" ]; then echo "libcloud/README.rst file not found, you are likely not running docker build from the repository root directory"; exit 1; fi
5553

5654
WORKDIR /libcloud
55+
ENV PATH="/libcloud/.venv/bin:${PATH}"
5756

5857
RUN set -e && \
59-
python3.10 -m pip install uv && \
60-
python3.10 -m uv pip install --no-cache-dir --group ci "."
58+
python3.12 -m pip install --break-system-packages uv && \
59+
python3.12 -m uv sync --group ci --no-dev
6160

62-
CMD ["tox", "-e", "lint,isort-check,black-check,bandit,py3.10,py3.11,py3.12,py3.13,pypypy3.10"]
61+
CMD ["tox", "-e", "lint,isort-check,black-check,bandit,py3.12,py3.10,py3.11,py3.13,pypypy3.10"]

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ test = [
8686
"pytest-xdist==3.6.1",
8787
"pytest-timeout==2.4.0",
8888
"pytest-benchmark[histogram]==5.1.0; python_version >= '3.10'",
89-
"cryptography==46.0.7",
90-
"pyopenssl==26.0.0",
89+
"cryptography==49.0.0; python_version >= '3.11'",
90+
"pyopenssl==26.3.0; python_version >= '3.11'",
91+
"cryptography==46.0.7; python_version < '3.11'",
92+
"pyopenssl==26.0.0; python_version < '3.11'",
9193
"fasteners",
9294
"paramiko==5.0.0; platform_python_implementation != 'PyPy'",
9395
"libvirt-python==12.0.0",
@@ -238,7 +240,7 @@ indent-string = " "
238240

239241

240242
[tool.mypy]
241-
python_version = "3.10"
243+
python_version = "3.12"
242244
platform = "linux"
243245
show_error_context = true
244246
show_column_numbers = true

scripts/time_imports.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ find . -name "*.pyc" -print0 | xargs -0 rm
2626

2727
# Example line:
2828
# import time: 1112 | 70127 | libcloud
29-
LIBCLOUD_IMPORT_TIMINGS=$(python3.10 -X importtime -c "import libcloud" 2>&1)
29+
LIBCLOUD_IMPORT_TIMINGS=$(python3.12 -X importtime -c "import libcloud" 2>&1)
3030
LIBCLOUD_IMPORT_TIME_CUMULATIVE_US=$(echo -e "${LIBCLOUD_IMPORT_TIMINGS}" | tail -1 | grep "| libcloud" | awk '{print $5}')
3131

3232
echo "Import timings for \"libcloud\" module"
@@ -40,7 +40,7 @@ fi
4040
# Clean up any cached files to ensure consistent and clean environment
4141
find . -name "*.pyc" -print0 | xargs -0 rm
4242

43-
EC2_DRIVER_IMPORT_TIMINGS=$(python3.10 -X importtime -c "import libcloud.compute.drivers.ec2" 2>&1)
43+
EC2_DRIVER_IMPORT_TIMINGS=$(python3.12 -X importtime -c "import libcloud.compute.drivers.ec2" 2>&1)
4444
EC2_DRIVER_IMPORT_TIME_CUMULATIVE_US=$(echo -e "$EC2_DRIVER_IMPORT_TIMINGS}" | tail -1 | grep "| libcloud.compute.drivers.ec2" | awk '{print $5}')
4545

4646
echo ""

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{pypy3,3.10,3.11,pyjion},checks,lint,pylint,pyupgrade,isort,black,mypy,docs,coverage,integration-storage
2+
envlist = py{pypy3,3.12,3.11,pyjion},checks,lint,pylint,pyupgrade,isort,black,mypy,docs,coverage,integration-storage
33
skipsdist = true
44
requires =
55
wheel
@@ -25,7 +25,7 @@ basepython =
2525
pypypy3.10: pypy3.10
2626
pypypy-3.10: pypy3.10
2727
pypyjion: pyjion
28-
{docs,checks,black,black-check,bandit,lint,pylint,mypy,micro-benchmarks,coverage,import-timings,isort,isort-check,pyupgrade,integration-storage}: python3.10
28+
{docs,checks,black,black-check,bandit,lint,pylint,mypy,micro-benchmarks,coverage,import-timings,isort,isort-check,pyupgrade,integration-storage}: python3.12
2929
{py3.10,py3.10-dist,py3.10-dist-wheel}: python3.10
3030
{py3.11,py3.11-dist,py3.11-dist-wheel}: python3.11
3131
{py3.12,py3.12-dist,py3.12-dist-wheel}: python3.12
@@ -139,11 +139,11 @@ commands = rstcheck --report-level warning ../README.rst
139139
sphinx-build -j auto -b html -d {envtmpdir}/doctrees . _build/html
140140

141141
[testenv:provider-tables]
142-
basepython: python3.10
142+
basepython: python3.12
143143
commands = python ./contrib/generate_provider_feature_matrix_table.py
144144

145145
[testenv:scrape-and-publish-provider-prices]
146-
basepython: python3.10
146+
basepython: python3.12
147147
# Needed to avoid urllib3 errors related to old openssl version
148148
# https://github.com/urllib3/urllib3/issues/2168
149149
dependency_groups =
@@ -178,7 +178,7 @@ commands =
178178
echo "https://libcloud-pricing-data.s3.amazonaws.com/pricing.json.sha512"
179179

180180
[testenv:scrape-provider-prices]
181-
basepython: python3.10
181+
basepython: python3.12
182182
# Needed to avoid urllib3 errors related to old openssl version
183183
# https://github.com/urllib3/urllib3/issues/2168
184184
dependency_groups =
@@ -202,7 +202,7 @@ commands =
202202
bash -c "(cd libcloud/data/ ; sha512sum pricing.json > {toxinidir}/libcloud/data/pricing.json.sha512)"
203203

204204
[testenv:scrape-ec2-prices]
205-
basepython: python3.10
205+
basepython: python3.12
206206
# Needed to avoid urllib3 errors related to old openssl version
207207
# https://github.com/urllib3/urllib3/issues/2168
208208
dependency_groups =
@@ -214,7 +214,7 @@ deps = urllib3==1.26.6
214214
commands = python contrib/scrape-ec2-prices.py
215215

216216
[testenv:scrape-ec2-sizes]
217-
basepython: python3.10
217+
basepython: python3.12
218218
# Needed to avoid urllib3 errors related to old openssl version
219219
# https://github.com/urllib3/urllib3/issues/2168
220220
dependency_groups =

0 commit comments

Comments
 (0)