From ec98dfb8545de4010883e9010ade05871487fa0d Mon Sep 17 00:00:00 2001 From: pseudo-rnd-thoughts Date: Thu, 7 Mar 2024 10:47:01 +0000 Subject: [PATCH] Remove atari tests and update test ignore warnings --- .github/workflows/optional-test-atari.yml | 19 ------------ bin/atari.Dockerfile | 37 ----------------------- setup.py | 2 +- tests/test_bsuite.py | 2 +- tests/test_dm_control.py | 2 +- tests/test_gym.py | 2 +- tests/test_meltingpot.py | 1 - 7 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/optional-test-atari.yml delete mode 100644 bin/atari.Dockerfile diff --git a/.github/workflows/optional-test-atari.yml b/.github/workflows/optional-test-atari.yml deleted file mode 100644 index e11c2d9f..00000000 --- a/.github/workflows/optional-test-atari.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: build -on: [pull_request, push] - -permissions: - contents: read # to fetch code (actions/checkout) - -jobs: - optional-test-atari: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Atari - - run: | - docker build -f bin/atari.Dockerfile \ - --build-arg PYTHON_VERSION='3.10' \ - --tag shimmy-atari-docker . - - name: Run atari tests - run: docker run shimmy-atari-docker pytest tests/test_atari.py diff --git a/bin/atari.Dockerfile b/bin/atari.Dockerfile deleted file mode 100644 index 06827560..00000000 --- a/bin/atari.Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# A Dockerfile that sets up a full shimmy install with test dependencies - -# if PYTHON_VERSION is not specified as a build argument, set it to 3.10. -ARG PYTHON_VERSION -ARG PYTHON_VERSION=${PYTHON_VERSION:-3.10} -FROM python:$PYTHON_VERSION - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN pip install --upgrade pip - -# Install Shimmy requirements -RUN apt-get -y update \ - && apt-get install --no-install-recommends -y \ - unzip \ - libglu1-mesa-dev \ - libgl1-mesa-dev \ - libosmesa6-dev \ - xvfb \ - patchelf \ - ffmpeg cmake \ - && apt-get autoremove -y \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -COPY . /usr/local/shimmy/ -WORKDIR /usr/local/shimmy/ - -# Install Shimmy -RUN if [ -f "pyproject.toml" ]; then \ - pip install ".[atari, testing]" --no-cache-dir; \ - else \ - pip install -U "shimmy[atari, testing] @ git+https://github.com/Farama-Foundation/Shimmy.git" --no-cache-dir; \ - mkdir -p bin && mv docker_entrypoint bin/docker_entrypoint; \ - fi - -ENTRYPOINT ["/usr/local/shimmy/bin/docker_entrypoint"] diff --git a/setup.py b/setup.py index acc217a6..dc37c9d4 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def get_version(): ], "dm-lab": ["dm-env>=1.6"], "openspiel": ["open_spiel>=1.2", "pettingzoo>=1.23"], - "meltingpot": ["pettingzoo>=1.23", "dm-meltingpot>=2.2.0; python_version > '3.9'"], + "meltingpot": ["pettingzoo>=1.23", "dm-meltingpot>=2.2.0; python_version > '3.9'", "chex>=1.85"], "bsuite": ["bsuite>=0.3.5"], } extras["all"] = [ diff --git a/tests/test_bsuite.py b/tests/test_bsuite.py index 8a308d2d..0d76c3ea 100644 --- a/tests/test_bsuite.py +++ b/tests/test_bsuite.py @@ -60,7 +60,7 @@ def test_bsuite_suite_envs(): f"\x1b[33mWARN: {message}\x1b[0m" for message in [ "A Box observation space minimum value is -infinity. This is probably too low.", - "A Box observation space maximum value is -infinity. This is probably too high.", + "A Box observation space maximum value is infinity. This is probably too high.", "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (28, 28)", "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (42, 42)", "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (10, 5)", diff --git a/tests/test_dm_control.py b/tests/test_dm_control.py index 10e3199b..d1122455 100644 --- a/tests/test_dm_control.py +++ b/tests/test_dm_control.py @@ -42,7 +42,7 @@ def test_dm_control_suite_envs(): f"\x1b[33mWARN: {message}\x1b[0m" for message in [ "A Box observation space minimum value is -infinity. This is probably too low.", - "A Box observation space maximum value is -infinity. This is probably too high.", + "A Box observation space maximum value is infinity. This is probably too high.", "For Box action spaces, we recommend using a symmetric and normalized space (range=[-1, 1] or [0, 1]). See https://stable-baselines3.readthedocs.io/en/master/guide/rl_tips.html for more information.", "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: ()", "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (8, 2)", diff --git a/tests/test_gym.py b/tests/test_gym.py index 443c0319..3a2eb739 100644 --- a/tests/test_gym.py +++ b/tests/test_gym.py @@ -19,7 +19,7 @@ for message in [ "This version of the mujoco environments depends on the mujoco-py bindings, which are no longer maintained and may stop working. Please upgrade to the v4 versions of the environments (which depend on the mujoco python bindings instead), unless you are trying to precisely replicate previous works).", "A Box observation space minimum value is -infinity. This is probably too low.", - "A Box observation space maximum value is -infinity. This is probably too high.", + "A Box observation space maximum value is infinity. This is probably too high.", "For Box action spaces, we recommend using a symmetric and normalized space (range=[-1, 1] or [0, 1]). See https://stable-baselines3.readthedocs.io/en/master/guide/rl_tips.html for more information.", "The environment CartPole-v0 is out of date. You should consider upgrading to version `v1`.", ] diff --git a/tests/test_meltingpot.py b/tests/test_meltingpot.py index cc90bce5..1d874365 100644 --- a/tests/test_meltingpot.py +++ b/tests/test_meltingpot.py @@ -10,7 +10,6 @@ pytest.importorskip("meltingpot") -import meltingpot from meltingpot.substrate import SUBSTRATES from shimmy.meltingpot_compatibility import MeltingPotCompatibilityV0