Skip to content

Commit 8e1b7b3

Browse files
authored
chore: drop Python 3.9, set 3.10 as minimum (#3330)
* chore: update Python version from 3.9 to 3.10 across configurations and requirements * update
1 parent 4d52812 commit 8e1b7b3

15 files changed

Lines changed: 28 additions & 35 deletions

File tree

.azure/gpu-unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
matrix:
2727
"PyTorch | 2.0 oldest":
2828
# Torch does not have build wheels with old Torch versions for newer CUDA
29-
docker-image: "ubuntu22.04-cuda12.1.1-py3.9-torch2.0"
29+
docker-image: "ubuntu22.04-cuda12.1.1-py3.10-torch2.0"
3030
torch-ver: "2.0"
3131
"PyTorch | 2.X stable":
3232
docker-image: "ubuntu24.04-cuda12.6.3-py3.12-torch2.8"

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3/.devcontainer/base.Dockerfile
22

3-
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
4-
ARG VARIANT="3.9"
3+
# [Choice] Python version: 3, 3.10, 3.11, 3.12
4+
ARG VARIANT="3.10"
55
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
66

77
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3
33
{
44
"name": "PyTorch Lightning Metrics",
5-
"image": "pytorchlightning/torchmetrics:devcontainer-py3.9",
5+
"image": "pytorchlightning/torchmetrics:devcontainer-py3.10",
66
// If you want to use a different Python version, uncomment the build object below
77
// "build": {
88
// "dockerfile": "Dockerfile",
99
// "context": "..",
1010
// "args": {
11-
// // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
12-
// "VARIANT": "3.9",
11+
// // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.11, 3.12
12+
// "VARIANT": "3.10",
1313
// // Options
1414
// "NODE_VERSION": "none"
1515
// }

.github/workflows/ci-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
testing-matrix: |
3535
{
3636
"os": ["ubuntu-22.04", "macOS-14", "windows-2022"],
37-
"python-version": ["3.9", "3.11"]
37+
"python-version": ["3.10", "3.11"]
3838
}
3939
4040
check-md-links:

.github/workflows/ci-integrate.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ["ubuntu-22.04", "macOS-14", "windows-2022"]
30-
python-version: ["3.9", "3.11"]
30+
python-version: ["3.10", "3.11"]
3131
requires: ["oldest", "latest"]
32-
exclude:
33-
- { python-version: "3.10", requires: "oldest" }
34-
- { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
35-
include:
36-
- { python-version: "3.10", requires: "latest", os: "ubuntu-22.04" }
37-
# - { python-version: "3.10", requires: "latest", os: "macOS-14" } # M1 machine # todo: crashing for MPS out of memory
32+
# exclude:
33+
# - { python-version: "3.10", requires: "oldest" }
34+
# - { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
3835
env:
3936
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
4037
UV_TORCH_BACKEND: "cpu"

.github/workflows/ci-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- "2.8.0"
4949
include:
5050
# cover additional python and PT combinations
51-
- { os: "ubuntu-22.04", python-version: "3.9", pytorch-version: "2.0.1", requires: "oldest" }
51+
- { os: "ubuntu-22.04", python-version: "3.10", pytorch-version: "2.0.1", requires: "oldest" }
5252
- { os: "ubuntu-22.04", python-version: "3.12", pytorch-version: "2.7.1" }
5353
- { os: "ubuntu-22.04", python-version: "3.12", pytorch-version: "2.8.0" }
5454
# using the ARM based M1 machine
@@ -126,8 +126,8 @@ jobs:
126126

127127
- name: Install package
128128
run: |
129-
uv pip install . -U "${{ matrix.requires == 'oldest' && 'setuptools<82.0.0' || 'setuptools' }}" \
130-
-r requirements/_doctest.txt $PIP_EXTRA_URL
129+
uv pip install . -U setuptools -r requirements/_doctest.txt \
130+
$PIP_EXTRA_URL
131131
uv pip list
132132
timeout-minutes: 25
133133

.github/workflows/docker-build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
python: ["3.9", "3.10", "3.11"]
38+
python: ["3.10", "3.11"]
3939
steps:
4040
- name: Checkout
4141
uses: actions/checkout@v5
@@ -67,7 +67,6 @@ jobs:
6767
include:
6868
# These are the base images for PL release docker images,
6969
# so include at least all the combinations in release-dockers.yml.
70-
- { python: "3.9", pytorch: "2.0.1", cuda: "12.1.1", ubuntu: "22.04" }
7170
- { python: "3.10", pytorch: "2.0.1", cuda: "12.1.1", ubuntu: "22.04" }
7271
- { python: "3.11", pytorch: "2.1.2", cuda: "12.1.1", ubuntu: "22.04" }
7372
- { python: "3.11", pytorch: "2.2.2", cuda: "12.1.1", ubuntu: "22.04" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ machine: "L4_X_2"
99
parametrize:
1010
matrix:
1111
image: # note that this is setting also all oldest requirements which is linked to Torch == 2.0
12-
- "pytorchlightning/torchmetrics:ubuntu22.04-cuda12.1.1-py3.9-torch2.0"
12+
- "pytorchlightning/torchmetrics:ubuntu22.04-cuda12.1.1-py3.10-torch2.0"
1313
- "pytorchlightning/torchmetrics:ubuntu24.04-cuda12.6.3-py3.12-torch2.8"
1414
# testing: ["doctest", "common", "distributed"] # todo
1515
include: []

dockers/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ git clone https://github.com/Lightning-AI/torchmetrics.git
1111
docker image build -t torchmetrics:latest -f dockers/ubuntu-cuda/Dockerfile .
1212

1313
# build with specific arguments
14-
docker image build -t torchmetrics:ubuntu-cuda11.7.1-py3.9-torch1.13 \
14+
docker image build -t torchmetrics:ubuntu-cuda11.7.1-py3.10-torch2.0 \
1515
-f dockers/base-cuda/Dockerfile \
16-
--build-arg PYTHON_VERSION=3.9 \
17-
--build-arg PYTORCH_VERSION=1.13 \
16+
--build-arg PYTHON_VERSION=3.10 \
17+
--build-arg PYTORCH_VERSION=2.0 \
1818
--build-arg CUDA_VERSION=11.7.1 \
1919
.
2020
```
@@ -50,5 +50,5 @@ sudo systemctl restart docker
5050
and later run the docker image with `--gpus all`. For example,
5151

5252
```bash
53-
docker run --rm -it --gpus all torchmetrics:ubuntu-cuda11.7.1-py3.9-torch1.12
53+
docker run --rm -it --gpus all torchmetrics:ubuntu-cuda11.7.1-py3.10-torch2.0
5454
```

docs/.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ sphinx:
2929
build:
3030
os: "ubuntu-22.04"
3131
tools:
32-
python: "3.9"
32+
python: "3.10"
3333
commands:
3434
- printenv
3535
- pwd ; ls -lh

0 commit comments

Comments
 (0)