Skip to content

Commit

Permalink
Add extra [accept-rom-license] for AutoROM (#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseFarebro authored Sep 28, 2021
1 parent 000a2a0 commit 52b7e5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions py.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin
COPY . /usr/local/gym/
WORKDIR /usr/local/gym/

RUN pip install -e .[nomujoco] && pip install -r test_requirements.txt
RUN AutoROM --accept-license
RUN pip install -e .[nomujoco,accept-rom-license] && pip install -r test_requirements.txt

ENTRYPOINT ["/usr/local/gym/bin/docker_entrypoint"]
23 changes: 14 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os.path
import sys
import itertools

from setuptools import find_packages, setup

Expand All @@ -10,6 +11,7 @@
# Environment-specific dependencies.
extras = {
"atari": ["ale-py~=0.7"],
"accept-rom-license": ["autorom[accept-rom-license]~=0.4.2"],
"box2d": ["box2d-py==2.3.5", "pyglet>=1.4.0"],
"classic_control": ["pyglet>=1.4.0"],
"mujoco": ["mujoco_py>=1.50, <2.0"],
Expand All @@ -19,17 +21,20 @@
}

# Meta dependency groups.
nomujoco_blacklist = set(["mujoco", "robotics", "accept-rom-license"])
nomujoco_groups = set(extras.keys()) - nomujoco_blacklist

extras["nomujoco"] = list(
set(
[
item
for name, group in extras.items()
if name != "mujoco" and name != "robotics"
for item in group
]
)
itertools.chain.from_iterable(map(lambda group: extras[group], nomujoco_groups))
)


all_blacklist = set(["accept-rom-license"])
all_groups = set(extras.keys()) - all_blacklist

extras["all"] = list(
itertools.chain.from_iterable(map(lambda group: extras[group], all_groups))
)
extras["all"] = list(set([item for group in extras.values() for item in group]))

setup(
name="gym",
Expand Down
1 change: 0 additions & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
lz4~=3.1
pytest~=6.2
pytest-forked~=1.3
AutoROM>=0.3

0 comments on commit 52b7e5e

Please sign in to comment.