mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-07-31 22:04:31 +00:00
Remove support for Python 3.6 (#38)
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
|
@@ -27,7 +27,7 @@ repos:
|
||||
- id: isort
|
||||
args: ["--profile", "black"]
|
||||
- repo: https://github.com/pycqa/pydocstyle
|
||||
rev: 6.1.1 # pick a git hash / tag to point to
|
||||
rev: 6.1.1
|
||||
hooks:
|
||||
- id: pydocstyle
|
||||
exclude: ^(gymnasium/envs/)|(tests/)|(docs/)
|
||||
@@ -40,8 +40,7 @@ repos:
|
||||
rev: v2.32.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
# TODO: remove `--keep-runtime-typing` option
|
||||
args: ["--py36-plus", "--keep-runtime-typing"]
|
||||
args: ["--py37-plus"]
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pyright
|
||||
|
@@ -20,7 +20,7 @@ For Atari envs, add a Markdown file into `pages/environments/atari` then complet
|
||||
|
||||
#### Non-Atari env
|
||||
|
||||
Ensure the environment is in Gymnasium (or your fork). Ensure that the environment's Python file has a properly formatted markdown docstring. Pip install Gymnasium (or your fork) then run `docs/scripts/gen_mds.py`. This will automatically generate an md page for the environment. Then complete the [other steps](#other-steps).
|
||||
Ensure the environment is in Gymnasium (or your fork). Ensure that the environment's Python file has a properly formatted markdown docstring. Pip install Gymnasium (or your fork) then run `docs/scripts/gen_mds.py`. This will automatically generate a md page for the environment. Then complete the [other steps](#other-steps).
|
||||
|
||||
#### Other steps
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
"""Core API for Environment, Wrapper, ActionWrapper, RewardWrapper and ObservationWrapper."""
|
||||
import sys
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
@@ -16,17 +15,11 @@ from typing import (
|
||||
import numpy as np
|
||||
|
||||
from gymnasium import spaces
|
||||
from gymnasium.logger import warn
|
||||
from gymnasium.utils import seeding
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gymnasium.envs.registration import EnvSpec
|
||||
|
||||
if sys.version_info[0:2] == (3, 6):
|
||||
warn(
|
||||
"Gymnasium minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+"
|
||||
)
|
||||
|
||||
ObsType = TypeVar("ObsType")
|
||||
ActType = TypeVar("ActType")
|
||||
RenderFrame = TypeVar("RenderFrame")
|
||||
|
@@ -10,11 +10,8 @@ from gymnasium.utils.step_api_compatibility import (
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Protocol, runtime_checkable
|
||||
elif sys.version_info >= (3, 7):
|
||||
from typing_extensions import Protocol, runtime_checkable
|
||||
else:
|
||||
Protocol = object
|
||||
runtime_checkable = lambda x: x # noqa: E731
|
||||
from typing_extensions import Protocol, runtime_checkable
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
|
@@ -26,6 +26,6 @@ ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin"
|
||||
COPY . /usr/local/gymnasium/
|
||||
WORKDIR /usr/local/gymnasium/
|
||||
|
||||
RUN if [ "python:${PYTHON_VERSION}" = "python:3.6.15" ] ; then pip install .[box2d,classic_control,toy_text,other] pytest=="7.0.1" --no-cache-dir; else pip install .[testing] --no-cache-dir; fi
|
||||
RUN pip install .[testing] --no-cache-dir
|
||||
|
||||
ENTRYPOINT ["/usr/local/gymnasium/bin/docker_entrypoint"]
|
||||
|
@@ -15,7 +15,7 @@ strict = [
|
||||
]
|
||||
|
||||
typeCheckingMode = "basic"
|
||||
pythonVersion = "3.6"
|
||||
pythonVersion = "3.7"
|
||||
pythonPlatform = "All"
|
||||
typeshedPath = "typeshed"
|
||||
enableTypeIgnoreComments = true
|
||||
|
@@ -10,6 +10,6 @@ matplotlib>=3.0
|
||||
box2d-py==2.3.5
|
||||
pygame==2.1.0
|
||||
ale-py~=0.8.0
|
||||
mujoco==2.2.0
|
||||
mujoco==2.2
|
||||
mujoco_py<2.2,>=2.1
|
||||
imageio>=2.14.1
|
7
setup.py
7
setup.py
@@ -47,7 +47,7 @@ extras = {
|
||||
testing_group = set(extras.keys()) - {"accept-rom-license", "atari"}
|
||||
extras["testing"] = list(
|
||||
set(itertools.chain.from_iterable(map(lambda group: extras[group], testing_group)))
|
||||
) + ["pytest==7.0.1", "gym==0.26.2"]
|
||||
) + ["pytest==7.1.3", "gym==0.26.2"]
|
||||
|
||||
# All dependency groups - accept rom license as requires user to run
|
||||
all_groups = set(extras.keys()) - {"accept-rom-license"}
|
||||
@@ -70,7 +70,7 @@ setup(
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
keywords=["Reinforcement Learning", "game", "RL", "AI", "gymnasium"],
|
||||
python_requires=">=3.6",
|
||||
python_requires=">=3.7",
|
||||
tests_require=extras["testing"],
|
||||
packages=[
|
||||
package for package in find_packages() if package.startswith("gymnasium")
|
||||
@@ -90,12 +90,9 @@ setup(
|
||||
"cloudpickle >= 1.2.0",
|
||||
"importlib_metadata >= 4.8.0; python_version < '3.10'",
|
||||
"gymnasium_notices >= 0.0.1",
|
||||
"dataclasses == 0.8; python_version == '3.6'",
|
||||
],
|
||||
classifiers=[
|
||||
# Python 3.6 is minimally supported (only with basic gymnasium environments and API)
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
|
@@ -6,5 +6,5 @@ matplotlib>=3.0
|
||||
imageio>=2.14.1
|
||||
pygame==2.1.0
|
||||
mujoco_py<2.2,>=2.1
|
||||
pytest==7.0.1
|
||||
pytest==7.1.3
|
||||
gym==0.26.2
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
|
||||
import numpy as np
|
||||
@@ -81,8 +80,6 @@ def test_explicit():
|
||||
|
||||
def test_implicit():
|
||||
old_env = LegacyEnvImplicit()
|
||||
if sys.version_info >= (3, 7):
|
||||
# We need to give up on typing in Python 3.6
|
||||
assert isinstance(old_env, LegacyEnv)
|
||||
env = EnvCompatibility(old_env, render_mode="rgb_array")
|
||||
assert env.observation_space == Discrete(1)
|
||||
|
Reference in New Issue
Block a user