From bdf95c1adc511a10fe115942bdef7b9b5f97516d Mon Sep 17 00:00:00 2001 From: Justin Terry Date: Thu, 17 Dec 2020 14:55:52 -0500 Subject: [PATCH] Python 3.9 support (#2088) * try changes in pr 1804 * fix classifiers * typo --- .travis.yml | 3 ++- gym/wrappers/pixel_observation.py | 4 +++- setup.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7f3d094047..f051ec59bda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,12 @@ env: - PY_VER=3.6.12 - PY_VER=3.7.9 - PY_VER=3.8.6 + - PY_VER=3.9.0 install: "" # so travis doesn't do pip install requirements.txt script: - docker build -f py.Dockerfile --build-arg MUJOCO_KEY=$MUJOCO_KEY --build-arg PYTHON_VER=$PY_VER -t gym-test . - - docker run gym-test + - docker run gym-test deploy: provider: pypi diff --git a/gym/wrappers/pixel_observation.py b/gym/wrappers/pixel_observation.py index 31b6db67aac..b25211023cc 100644 --- a/gym/wrappers/pixel_observation.py +++ b/gym/wrappers/pixel_observation.py @@ -1,6 +1,7 @@ """An observation wrapper that augments observations by pixel values.""" import collections +from collections.abc import MutableMapping import copy import numpy as np @@ -8,6 +9,7 @@ from gym import spaces from gym import ObservationWrapper + STATE_KEY = 'state' @@ -60,7 +62,7 @@ def __init__(self, self._observation_is_dict = False invalid_keys = set([STATE_KEY]) elif isinstance(wrapped_observation_space, - (spaces.Dict, collections.MutableMapping)): + (spaces.Dict, MutableMapping)): self._observation_is_dict = True invalid_keys = set(wrapped_observation_space.spaces.keys()) else: diff --git a/setup.py b/setup.py index 3041b6ce547..3f661828a6d 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,6 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], )