Skip to content

Commit 4dfc3cd

Browse files
committed
[Setup] Python 3.14 in, python 3.9 out
ghstack-source-id: 524df6f Pull-Request: #3251
1 parent 3cd740a commit 4dfc3cd

File tree

8 files changed

+84
-30
lines changed

8 files changed

+84
-30
lines changed

.github/unittest/linux/scripts/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies:
2626
- tensorboard
2727
- imageio==2.26.0
2828
- wandb
29-
- dm_control
3029
- mujoco<3.3.6
3130
- mlflow
3231
- av

.github/unittest/linux/scripts/run_all.sh

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,30 @@ set -v
88

99

1010
if [[ $OSTYPE != 'darwin'* ]]; then
11-
apt-get update && apt-get upgrade -y
11+
# Prevent interactive prompts (notably tzdata) in CI.
12+
export DEBIAN_FRONTEND=noninteractive
13+
export TZ="${TZ:-Etc/UTC}"
14+
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime || true
15+
echo "${TZ}" > /etc/timezone || true
16+
17+
apt-get update
18+
apt-get install -y --no-install-recommends tzdata
19+
dpkg-reconfigure -f noninteractive tzdata || true
20+
21+
apt-get upgrade -y
1222
apt-get install -y vim git wget cmake
1323

1424
# Enable universe repository
1525
# apt-get install -y software-properties-common
1626
# add-apt-repository universe
1727
# apt-get update
1828

19-
# apt-get install -y libsdl2-dev libsdl2-2.0-0
29+
# SDL2 and freetype needed for building pygame from source (Python 3.14+)
30+
apt-get install -y libsdl2-dev libsdl2-2.0-0 libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev
31+
apt-get install -y libfreetype6-dev pkg-config
2032

21-
apt-get install -y libglfw3 libgl1-mesa-glx libosmesa6 libglew-dev
22-
apt-get install -y libglvnd0 libgl1 libglx0 libegl1 libgles2 xvfb
33+
apt-get install -y libglfw3 libosmesa6 libglew-dev
34+
apt-get install -y libglvnd0 libgl1 libglx0 libglx-mesa0 libegl1 libgles2 xvfb
2335

2436
if [ "${CU_VERSION:-}" == cpu ] ; then
2537
# solves version `GLIBCXX_3.4.29' not found for tensorboard
@@ -99,6 +111,14 @@ conda env update --file "${this_dir}/environment.yml" --prune
99111
conda deactivate
100112
conda activate "${env_dir}"
101113

114+
# Install dm_control for Python < 3.13
115+
# labmaze (dm_control dependency) doesn't have Python 3.13+ wheels and its
116+
# WORKSPACE-based build is incompatible with Bazel 8+ (WORKSPACE deprecated)
117+
if [[ "$PYTHON_VERSION" != "3.13" && "$PYTHON_VERSION" != "3.14" ]]; then
118+
echo "installing dm_control"
119+
pip3 install dm_control
120+
fi
121+
102122
echo "installing gymnasium"
103123
if [[ "$PYTHON_VERSION" == "3.12" ]]; then
104124
pip3 install ale-py
@@ -108,13 +128,20 @@ else
108128
pip3 install "gymnasium[atari,mujoco]>=1.1" mo-gymnasium[mujoco]
109129
fi
110130

111-
# sanity check: remove?
112-
python -c """
131+
# sanity check
132+
if [[ "$PYTHON_VERSION" != "3.13" && "$PYTHON_VERSION" != "3.14" ]]; then
133+
python -c """
113134
import dm_control
114135
from dm_control import composer
115136
from tensorboard import *
116137
from google.protobuf import descriptor as _descriptor
117138
"""
139+
else
140+
python -c """
141+
from tensorboard import *
142+
from google.protobuf import descriptor as _descriptor
143+
"""
144+
fi
118145

119146
# ============================================================================================ #
120147
# ================================ PyTorch & TorchRL ========================================= #

.github/unittest/linux_optdeps/scripts/run_all.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@ set -e
99

1010

1111
if [[ $OSTYPE != 'darwin'* ]]; then
12-
apt-get update && apt-get upgrade -y
12+
# Prevent interactive prompts (notably tzdata) in CI.
13+
export DEBIAN_FRONTEND=noninteractive
14+
export TZ="${TZ:-Etc/UTC}"
15+
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime || true
16+
echo "${TZ}" > /etc/timezone || true
17+
18+
apt-get update
19+
apt-get install -y --no-install-recommends tzdata
20+
dpkg-reconfigure -f noninteractive tzdata || true
21+
22+
apt-get upgrade -y
1323
apt-get install -y vim git wget cmake
1424

15-
apt-get install -y libglfw3 libgl1-mesa-glx libosmesa6 libglew-dev
16-
apt-get install -y libglvnd0 libgl1 libglx0 libegl1 libgles2
25+
apt-get install -y libglfw3 libosmesa6 libglew-dev
26+
apt-get install -y libglvnd0 libgl1 libglx0 libglx-mesa0 libegl1 libgles2
1727

1828
if [ "${CU_VERSION:-}" == cpu ] ; then
1929
# solves version `GLIBCXX_3.4.29' not found for tensorboard

.github/unittest/linux_sota/scripts/run_all.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ set -v
77
# ================================ Init ============================================== #
88

99

10-
apt-get update && apt-get upgrade -y
10+
export DEBIAN_FRONTEND=noninteractive
11+
export TZ="${TZ:-Etc/UTC}"
12+
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime || true
13+
echo "${TZ}" > /etc/timezone || true
14+
15+
apt-get update
16+
apt-get install -y --no-install-recommends tzdata
17+
dpkg-reconfigure -f noninteractive tzdata || true
18+
19+
apt-get upgrade -y
1120
apt-get install -y vim git wget cmake
1221

1322
apt-get install -y libglfw3 libgl1-mesa-glx libosmesa6 libglew-dev libosmesa6-dev

.github/workflows/nightly_build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242
matrix:
4343
os: [['linux', 'ubuntu-22.04'], ['macos', 'macos-latest']]
4444
python_version: [
45-
["3.9", "cp39-cp39"],
4645
["3.10", "cp310-cp310"],
4746
["3.11", "cp311-cp311"],
4847
["3.12", "cp312-cp312"],
4948
["3.13", "cp313-cp313"],
49+
["3.14", "cp314-cp314"],
5050
]
5151
cuda_support: [["", "cpu", "cpu"]]
5252
steps:
@@ -88,11 +88,11 @@ jobs:
8888
matrix:
8989
os: [['linux', 'ubuntu-22.04'], ['macos', 'macos-latest']]
9090
python_version: [
91-
["3.9", "cp39-cp39"],
9291
["3.10", "cp310-cp310"],
9392
["3.11", "cp311-cp311"],
9493
["3.12", "cp312-cp312"],
9594
["3.13", "cp313-cp313"],
95+
["3.14", "cp314-cp314"],
9696
]
9797
cuda_support: [["", "cpu", "cpu"]]
9898
steps:
@@ -162,11 +162,11 @@ jobs:
162162
matrix:
163163
os: [['linux', 'ubuntu-22.04'], ['macos', 'macos-latest']]
164164
python_version: [
165-
["3.9", "cp39-cp39"],
166165
["3.10", "cp310-cp310"],
167166
["3.11", "cp311-cp311"],
168167
["3.12", "cp312-cp312"],
169168
["3.13", "cp313-cp313"],
169+
["3.14", "cp314-cp314"],
170170
]
171171
cuda_support: [["", "cpu", "cpu"]]
172172
steps:
@@ -204,11 +204,11 @@ jobs:
204204
strategy:
205205
matrix:
206206
python_version: [
207-
["3.9", "3.9"],
208207
["3.10", "3.10.3"],
209208
["3.11", "3.11"],
210209
["3.12", "3.12"],
211210
["3.13", "3.13"],
211+
["3.14", "3.14"],
212212
]
213213
steps:
214214
- name: Setup Python
@@ -244,11 +244,11 @@ jobs:
244244
strategy:
245245
matrix:
246246
python_version: [
247-
["3.9", "3.9"],
248247
["3.10", "3.10.3"],
249248
["3.11", "3.11"],
250249
["3.12", "3.12"],
251250
["3.13", "3.13"],
251+
["3.14", "3.14"],
252252
]
253253
steps:
254254
- name: Setup Python
@@ -314,11 +314,11 @@ jobs:
314314
strategy:
315315
matrix:
316316
python_version: [
317-
["3.9", "3.9"],
318317
["3.10", "3.10.3"],
319318
["3.11", "3.11"],
320319
["3.12", "3.12"],
321320
["3.13", "3.13"],
321+
["3.14", "3.14"],
322322
]
323323
steps:
324324
- name: Checkout torchrl

.github/workflows/test-linux.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
tests-cpu:
2727
strategy:
2828
matrix:
29-
python_version: ["3.9", "3.10", "3.11", "3.12"]
29+
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3030
fail-fast: false
3131
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3232
with:
3333
runner: linux.12xlarge
3434
repository: pytorch/rl
35-
docker-image: "nvidia/cuda:12.2.0-devel-ubuntu22.04"
35+
docker-image: "nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04"
3636
timeout: 90
3737
script: |
3838
if [[ "${{ github.ref }}" =~ release/* ]]; then
@@ -56,14 +56,14 @@ jobs:
5656
tests-gpu:
5757
strategy:
5858
matrix:
59-
python_version: ["3.11"]
60-
cuda_arch_version: ["12.8"]
59+
python_version: ["3.12"]
60+
cuda_arch_version: ["13.0"]
6161
fail-fast: false
6262
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
6363
with:
6464
runner: linux.g5.4xlarge.nvidia.gpu
6565
repository: pytorch/rl
66-
docker-image: "nvidia/cuda:12.4.0-devel-ubuntu22.04"
66+
docker-image: "nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04"
6767
gpu-arch-type: cuda
6868
gpu-arch-version: ${{ matrix.cuda_arch_version }}
6969
timeout: 90
@@ -128,14 +128,14 @@ jobs:
128128
tests-optdeps:
129129
strategy:
130130
matrix:
131-
python_version: ["3.11"]
132-
cuda_arch_version: ["12.8"]
131+
python_version: ["3.12"]
132+
cuda_arch_version: ["13.0"]
133133
fail-fast: false
134134
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
135135
with:
136136
runner: linux.g5.4xlarge.nvidia.gpu
137137
repository: pytorch/rl
138-
docker-image: "nvidia/cuda:12.4.0-devel-ubuntu22.04"
138+
docker-image: "nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04"
139139
gpu-arch-type: cuda
140140
gpu-arch-version: ${{ matrix.cuda_arch_version }}
141141
timeout: 90
@@ -163,14 +163,14 @@ jobs:
163163
tests-stable-gpu:
164164
strategy:
165165
matrix:
166-
python_version: ["3.10"] # "3.9", "3.10", "3.11"
167-
cuda_arch_version: ["11.8"] # "11.6", "11.7"
166+
python_version: ["3.12"] # "3.9", "3.10", "3.11"
167+
cuda_arch_version: ["13.0"] # "11.6", "11.7"
168168
fail-fast: false
169169
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
170170
with:
171171
runner: linux.g5.4xlarge.nvidia.gpu
172172
repository: pytorch/rl
173-
docker-image: "nvidia/cuda:12.4.0-devel-ubuntu22.04"
173+
docker-image: "nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04"
174174
gpu-arch-type: cuda
175175
gpu-arch-version: ${{ matrix.cuda_arch_version }}
176176
timeout: 90

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ maintainers = [
1616
]
1717
keywords = ["reinforcement-learning", "pytorch", "rl", "machine-learning"]
1818
classifiers = [
19-
"Programming Language :: Python :: 3.9",
2019
"Programming Language :: Python :: 3.10",
2120
"Programming Language :: Python :: 3.11",
2221
"Programming Language :: Python :: 3.12",
2322
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
2424
"Operating System :: OS Independent",
2525
"Development Status :: 4 - Beta",
2626
"Intended Audience :: Developers",

test/smoke_test_deps.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66

77
import argparse
88
import os
9+
import sys
910
import tempfile
1011

1112
import pytest
1213

1314

15+
@pytest.mark.skipif(
16+
sys.version_info >= (3, 13),
17+
reason="dm_control not available on Python 3.13+ (labmaze lacks wheels)",
18+
)
1419
def test_dm_control():
1520
import dm_control # noqa: F401
1621
import dm_env # noqa: F401
@@ -23,9 +28,13 @@ def test_dm_control():
2328
env.reset()
2429

2530

31+
@pytest.mark.skipif(
32+
sys.version_info >= (3, 13),
33+
reason="dm_control not available on Python 3.13+ (labmaze lacks wheels)",
34+
)
2635
@pytest.mark.skip(reason="Not implemented yet")
2736
def test_dm_control_pixels():
28-
from torchrl.envs.libs.dm_control import _has_dmc, DMControlEnv # noqa
37+
from torchrl.envs.libs.dm_control import DMControlEnv
2938

3039
env = DMControlEnv("cheetah", "run", from_pixels=True)
3140
env.reset()

0 commit comments

Comments
 (0)