Skip to content

Commit b73e076

Browse files
authored
Poetry 1.2 (#271)
* Use poetry 1.2 * update poetry version in CI * push changes * fix tests * update lock files * update lock files * update CI * add cloud integration dependencies * add isaacgym dependencies * test change * update lock files * update docs * update poetry version * update dependencies * Add a note during installation * update docs * quick update
1 parent 34621ff commit b73e076

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2401
-2012
lines changed

.github/workflows/tests.yaml

+23-23
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
python-version: [3.8]
19-
poetry-version: [1.1.11]
19+
poetry-version: [1.2]
2020
os: [ubuntu-18.04, macos-latest, windows-latest]
2121
runs-on: ${{ matrix.os }}
2222
steps:
@@ -31,19 +31,19 @@ jobs:
3131

3232
# classic control tests
3333
- name: Install core dependencies
34-
run: poetry install -E pytest
34+
run: poetry install --with pytest
3535
- name: Downgrade setuptools
3636
run: poetry run pip install setuptools==59.5.0
3737
- name: Run core tests
3838
run: poetry run pytest tests/test_classic_control.py
3939
- name: Install jax
4040
if: runner.os == 'Linux' || runner.os == 'macOS'
41-
run: poetry install -E jax
41+
run: poetry install --with jax
4242
- name: Run core tests with jax
4343
if: runner.os == 'Linux' || runner.os == 'macOS'
4444
run: poetry run pytest tests/test_classic_control_jax.py
4545
- name: Install tuner dependencies
46-
run: poetry install -E optuna
46+
run: poetry install --with optuna
4747
- name: Run tuner tests
4848
run: poetry run pytest tests/test_tuner.py
4949

@@ -52,7 +52,7 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
python-version: [3.8]
55-
poetry-version: [1.1.11]
55+
poetry-version: [1.2]
5656
os: [ubuntu-18.04, macos-latest, windows-latest]
5757
runs-on: ${{ matrix.os }}
5858
steps:
@@ -67,14 +67,14 @@ jobs:
6767

6868
# atari tests
6969
- name: Install atari dependencies
70-
run: poetry install -E "pytest atari"
70+
run: poetry install --with pytest,atari
7171
- name: Downgrade setuptools
7272
run: poetry run pip install setuptools==59.5.0
7373
- name: Run atari tests
7474
run: poetry run pytest tests/test_atari.py
7575
- name: Install jax
7676
if: runner.os == 'Linux' || runner.os == 'macOS'
77-
run: poetry install -E jax
77+
run: poetry install --with jax
7878
- name: Run core tests with jax
7979
if: runner.os == 'Linux' || runner.os == 'macOS'
8080
run: poetry run pytest tests/test_atari_jax.py
@@ -84,7 +84,7 @@ jobs:
8484
fail-fast: false
8585
matrix:
8686
python-version: [3.8]
87-
poetry-version: [1.1.11]
87+
poetry-version: [1.2]
8888
os: [ubuntu-18.04, macos-latest, windows-latest]
8989
runs-on: ${{ matrix.os }}
9090
steps:
@@ -99,9 +99,9 @@ jobs:
9999

100100
# pybullet tests
101101
- name: Install core dependencies
102-
run: poetry install -E pytest
102+
run: poetry install --with pytest
103103
- name: Install pybullet dependencies
104-
run: poetry install -E pybullet
104+
run: poetry install --with pybullet
105105
- name: Downgrade setuptools
106106
run: poetry run pip install setuptools==59.5.0
107107
- name: Run pybullet tests
@@ -112,7 +112,7 @@ jobs:
112112
fail-fast: false
113113
matrix:
114114
python-version: [3.8]
115-
poetry-version: [1.1.11]
115+
poetry-version: [1.2]
116116
os: [ubuntu-18.04, macos-latest, windows-latest]
117117
runs-on: ${{ matrix.os }}
118118
steps:
@@ -127,7 +127,7 @@ jobs:
127127

128128
# procgen tests
129129
- name: Install core dependencies
130-
run: poetry install -E "pytest procgen"
130+
run: poetry install --with pytest,procgen
131131
- name: Downgrade setuptools
132132
run: poetry run pip install setuptools==59.5.0
133133
- name: Run pybullet tests
@@ -139,7 +139,7 @@ jobs:
139139
fail-fast: false
140140
matrix:
141141
python-version: [3.8]
142-
poetry-version: [1.1.11]
142+
poetry-version: [1.2]
143143
os: [ubuntu-18.04]
144144
runs-on: ${{ matrix.os }}
145145
steps:
@@ -154,13 +154,13 @@ jobs:
154154

155155
# mujoco tests
156156
- name: Install core dependencies
157-
run: poetry install -E pytest
157+
run: poetry install --with pytest
158158
- name: Install pybullet dependencies
159-
run: poetry install -E pybullet
159+
run: poetry install --with pybullet
160160
- name: Install mujoco dependencies
161-
run: poetry install -E mujoco
161+
run: poetry install --with mujoco
162162
- name: Install jax dependencies
163-
run: poetry install -E jax
163+
run: poetry install --with jax
164164
- name: Downgrade setuptools
165165
run: poetry run pip install setuptools==59.5.0
166166
- name: install mujoco dependencies
@@ -178,7 +178,7 @@ jobs:
178178
fail-fast: false
179179
matrix:
180180
python-version: [3.8]
181-
poetry-version: [1.1.11]
181+
poetry-version: [1.2]
182182
os: [ubuntu-18.04]
183183
runs-on: ${{ matrix.os }}
184184
steps:
@@ -193,7 +193,7 @@ jobs:
193193

194194
# envpool tests
195195
- name: Install envpool dependencies
196-
run: poetry install -E "pytest envpool"
196+
run: poetry install --with pytest,envpool
197197
- name: Downgrade setuptools
198198
run: poetry run pip install setuptools==59.5.0
199199
- name: Run envpool tests
@@ -204,7 +204,7 @@ jobs:
204204
fail-fast: false
205205
matrix:
206206
python-version: [3.8]
207-
poetry-version: [1.1.11]
207+
poetry-version: [1.2]
208208
os: [ubuntu-18.04]
209209
runs-on: ${{ matrix.os }}
210210
steps:
@@ -219,7 +219,7 @@ jobs:
219219

220220
# atari multigpu tests
221221
- name: Install atari dependencies
222-
run: poetry install -E "pytest atari"
222+
run: poetry install --with pytest,atari
223223
- name: Downgrade setuptools
224224
run: poetry run pip install setuptools==59.5.0
225225
- name: Run atari tests
@@ -230,7 +230,7 @@ jobs:
230230
fail-fast: false
231231
matrix:
232232
python-version: [3.8]
233-
poetry-version: [1.1.11]
233+
poetry-version: [1.2]
234234
os: [ubuntu-18.04, macos-latest]
235235
runs-on: ${{ matrix.os }}
236236
steps:
@@ -245,7 +245,7 @@ jobs:
245245

246246
# pettingzoo tests
247247
- name: Install pettingzoo dependencies
248-
run: poetry install -E "pytest pettingzoo atari"
248+
run: poetry install --with pytest,pettingzoo,atari
249249
- name: Downgrade setuptools
250250
run: poetry run pip install setuptools==59.5.0
251251
- name: Install ROMs

.github/workflows/utils_test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
python-version: [3.8]
14-
poetry-version: [1.1.11]
14+
poetry-version: [1.2]
1515
os: [ubuntu-18.04]
1616
runs-on: ${{ matrix.os }}
1717
steps:
@@ -25,9 +25,9 @@ jobs:
2525
poetry-version: ${{ matrix.poetry-version }}
2626

2727
- name: Install test dependencies
28-
run: poetry install -E pytest
28+
run: poetry install --with pytest
2929
- name: Install cloud dependencies
30-
run: poetry install -E cloud
30+
run: poetry install --with cloud
3131
- name: Downgrade setuptools
3232
run: poetry run pip install setuptools==59.5.0
3333
- name: Run utils tests

.pre-commit-config.yaml

+20-9
Original file line numberDiff line numberDiff line change
@@ -38,34 +38,45 @@ repos:
3838
- --ignore-words-list=nd,reacher,thist,ths,magent
3939
- --skip=docs/css/termynal.css,docs/js/termynal.js
4040
- repo: https://github.com/python-poetry/poetry
41-
rev: 1.2.0b1
41+
rev: 1.2.1
4242
hooks:
4343
- id: poetry-export
4444
name: poetry-export requirements.txt
45-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements.txt"]
45+
args: ["--without-hashes", "-o", "requirements/requirements.txt"]
4646
stages: [manual]
4747
- id: poetry-export
4848
name: poetry-export requirements-atari.txt
49-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements-atari.txt", "-E", "atari"]
49+
args: ["--without-hashes", "-o", "requirements/requirements-atari.txt", "--with", "atari"]
5050
stages: [manual]
5151
- id: poetry-export
5252
name: poetry-export requirements-pybullet.txt
53-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements-pybullet.txt", "-E", "pybullet"]
53+
args: ["--without-hashes", "-o", "requirements/requirements-pybullet.txt", "--with", "pybullet"]
5454
stages: [manual]
5555
- id: poetry-export
5656
name: poetry-export requirements-mujoco.txt
57-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements-mujoco.txt", "-E", "mujoco"]
57+
args: ["--without-hashes", "-o", "requirements/requirements-mujoco.txt", "--with", "mujoco"]
5858
stages: [manual]
5959
- id: poetry-export
6060
name: poetry-export requirements-procgen.txt
61-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements-procgen.txt", "-E", "procgen"]
61+
args: ["--without-hashes", "-o", "requirements/requirements-procgen.txt", "--with", "procgen"]
6262
stages: [manual]
6363
- id: poetry-export
6464
name: poetry-export requirements-envpool.txt
65-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements-envpool.txt", "-E", "envpool"]
65+
args: ["--without-hashes", "-o", "requirements/requirements-envpool.txt", "--with", "envpool"]
6666
stages: [manual]
6767
- id: poetry-export
6868
name: poetry-export requirements-pettingzoo.txt
69-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements/requirements-pettingzoo.txt", "-E", "pettingzoo"]
69+
args: ["--without-hashes", "-o", "requirements/requirements-pettingzoo.txt", "--with", "pettingzoo"]
70+
stages: [manual]
71+
- id: poetry-export
72+
name: poetry-export requirements-jax.txt
73+
args: ["--without-hashes", "-o", "requirements/requirements-jax.txt", "--with", "jax"]
74+
stages: [manual]
75+
- id: poetry-export
76+
name: poetry-export requirements-docs.txt
77+
args: ["--without-hashes", "-o", "requirements/requirements-docs.txt", "--with", "docs"]
78+
stages: [manual]
79+
- id: poetry-export
80+
name: poetry-export requirements-cloud.txt
81+
args: ["--without-hashes", "-o", "requirements/requirements-cloud.txt", "--with", "cloud"]
7082
stages: [manual]
71-

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Good luck and have fun!
1010

1111
```bash
1212
poetry install
13-
poetry install -E atari
14-
poetry install -E pybullet
13+
poetry install --with atari
14+
poetry install --with pybullet
1515
```
1616

1717
Then you can run the scripts under the poetry environment in two ways: `poetry run` or `poetry shell`.

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ RUN pip install poetry
1212
COPY pyproject.toml pyproject.toml
1313
COPY poetry.lock poetry.lock
1414
RUN poetry install
15-
RUN poetry install -E atari
16-
RUN poetry install -E pybullet
15+
RUN poetry install --with atari
16+
RUN poetry install --with pybullet
1717

1818
# install mujoco
1919
RUN apt-get -y install wget unzip software-properties-common \
2020
libgl1-mesa-dev \
2121
libgl1-mesa-glx \
2222
libglew-dev \
2323
libosmesa6-dev patchelf
24-
RUN poetry install -E mujoco
24+
RUN poetry install --with mujoco
2525
RUN poetry run python -c "import mujoco_py"
2626

2727
COPY entrypoint.sh /usr/local/bin/

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Good luck have fun :rocket:
3434
## Get started
3535

3636
Prerequisites:
37-
* >=3.7.1,<3.10 (not yet 3.10)
38-
* [Poetry](https://python-poetry.org)
37+
* Python >=3.7.1,<3.10 (not yet 3.10)
38+
* [Poetry 1.2.1+](https://python-poetry.org)
3939

4040
To run experiments locally, give the following a try:
4141

@@ -75,26 +75,26 @@ python cleanrl/ppo.py --env-id CartPole-v1
7575
python cleanrl/c51.py --env-id CartPole-v1
7676
7777
# atari
78-
poetry install -E atari
78+
poetry install --with atari
7979
python cleanrl/dqn_atari.py --env-id BreakoutNoFrameskip-v4
8080
python cleanrl/c51_atari.py --env-id BreakoutNoFrameskip-v4
8181
python cleanrl/ppo_atari.py --env-id BreakoutNoFrameskip-v4
8282
8383
# NEW: 3-4x side-effects free speed up with envpool's atari (only available to linux)
84-
poetry install -E envpool
84+
poetry install --with envpool
8585
python cleanrl/ppo_atari_envpool.py --env-id BreakoutNoFrameskip-v4
8686
# Learn Pong-v5 in ~5-10 mins
8787
# Side effects such as lower sample efficiency might occur
8888
poetry run python ppo_atari_envpool.py --clip-coef=0.2 --num-envs=16 --num-minibatches=8 --num-steps=128 --update-epochs=3
8989
9090
# pybullet
91-
poetry install -E pybullet
91+
poetry install --with pybullet
9292
python cleanrl/td3_continuous_action.py --env-id MinitaurBulletDuckEnv-v0
9393
python cleanrl/ddpg_continuous_action.py --env-id MinitaurBulletDuckEnv-v0
9494
python cleanrl/sac_continuous_action.py --env-id MinitaurBulletDuckEnv-v0
9595
9696
# procgen
97-
poetry install -E procgen
97+
poetry install --with procgen
9898
python cleanrl/ppo_procgen.py --env-id starpilot
9999
python cleanrl/ppg_procgen.py --env-id starpilot
100100

benchmark/c51.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ OMP_NUM_THREADS=1 xvfb-run -a poetry run python -m cleanrl_utils.benchmark \
55
--num-seeds 3 \
66
--workers 9
77

8-
poetry install -E atari
8+
poetry install --with atari
99
OMP_NUM_THREADS=1 xvfb-run -a poetry run python -m cleanrl_utils.benchmark \
1010
--env-ids PongNoFrameskip-v4 BeamRiderNoFrameskip-v4 BreakoutNoFrameskip-v4 \
1111
--command "poetry run python cleanrl/c51_atari.py --track --capture-video" \

benchmark/ddpg.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
poetry install -E "mujoco pybullet"
1+
poetry install --with mujoco,pybullet
22
python -c "import mujoco_py"
33
OMP_NUM_THREADS=1 xvfb-run -a python -m cleanrl_utils.benchmark \
44
--env-ids HalfCheetah-v2 Walker2d-v2 Hopper-v2 InvertedPendulum-v2 Humanoid-v2 Pusher-v2 \
55
--command "poetry run python cleanrl/ddpg_continuous_action.py --track --capture-video" \
66
--num-seeds 3 \
77
--workers 3
88

9-
poetry install -E "mujoco jax"
9+
poetry install --with mujoco,jax
1010
poetry run pip install --upgrade "jax[cuda]==0.3.14" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
1111
poetry run python -c "import mujoco_py"
1212
OMP_NUM_THREADS=1 xvfb-run -a poetry run python -m cleanrl_utils.benchmark \

benchmark/dqn.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ OMP_NUM_THREADS=1 xvfb-run -a poetry run python -m cleanrl_utils.benchmark \
55
--num-seeds 3 \
66
--workers 9
77

8-
poetry install -E atari
8+
poetry install --with atari
99
OMP_NUM_THREADS=1 xvfb-run -a poetry run python -m cleanrl_utils.benchmark \
1010
--env-ids PongNoFrameskip-v4 BeamRiderNoFrameskip-v4 BreakoutNoFrameskip-v4 \
1111
--command "poetry run python cleanrl/dqn_atari.py --track --capture-video" \
1212
--num-seeds 3 \
1313
--workers 1
1414

15-
poetry install -E "jax"
15+
poetry install --with jax
1616
poetry run pip install --upgrade "jax[cuda]==0.3.14" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
1717
xvfb-run -a python -m cleanrl_utils.benchmark \
1818
--env-ids CartPole-v1 Acrobot-v1 MountainCar-v0 \
1919
--command "poetry run python cleanrl/dqn_jax.py --track --capture-video" \
2020
--num-seeds 3 \
2121
--workers 1
2222

23-
poetry install -E "atari jax"
23+
poetry install --with atari,jax
2424
poetry run pip install --upgrade "jax[cuda]==0.3.14" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
2525
xvfb-run -a python -m cleanrl_utils.benchmark \
2626
--env-ids PongNoFrameskip-v4 BeamRiderNoFrameskip-v4 BreakoutNoFrameskip-v4 \

benchmark/ppg.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# export WANDB_ENTITY=openrlbenchmark
22

3-
poetry install -E procgen
3+
poetry install --with procgen
44
xvfb-run -a poetry run python -m cleanrl_utils.benchmark \
55
--env-ids starpilot bossfight bigfish \
66
--command "poetry run python cleanrl/ppg_procgen.py --track --capture-video" \

0 commit comments

Comments
 (0)