diff --git a/highway_env/__init__.py b/highway_env/__init__.py index ffcc0b53b..a1c1d9138 100644 --- a/highway_env/__init__.py +++ b/highway_env/__init__.py @@ -1,10 +1,9 @@ import os import sys -import gymnasium as gym +from gymnasium.envs.registration import register - -__version__ = "1.9.0" +__version__ = "2.0.0" try: from farama_notifications import notifications @@ -25,94 +24,94 @@ def _register_highway_envs(): from highway_env.envs.common.abstract import MultiAgentWrapper # exit_env.py - gym.register( + register( id="exit-v0", entry_point="highway_env.envs.exit_env:ExitEnv", ) # highway_env.py - gym.register( + register( id="highway-v0", entry_point="highway_env.envs.highway_env:HighwayEnv", ) - gym.register( + register( id="highway-fast-v0", entry_point="highway_env.envs.highway_env:HighwayEnvFast", ) # intersection_env.py - gym.register( + register( id="intersection-v0", entry_point="highway_env.envs.intersection_env:IntersectionEnv", ) - gym.register( + register( id="intersection-v1", entry_point="highway_env.envs.intersection_env:ContinuousIntersectionEnv", ) - gym.register( + register( id="intersection-multi-agent-v0", entry_point="highway_env.envs.intersection_env:MultiAgentIntersectionEnv", ) - gym.register( + register( id="intersection-multi-agent-v1", entry_point="highway_env.envs.intersection_env:MultiAgentIntersectionEnv", additional_wrappers=(MultiAgentWrapper.wrapper_spec(),), ) # lane_keeping_env.py - gym.register( + register( id="lane-keeping-v0", entry_point="highway_env.envs.lane_keeping_env:LaneKeepingEnv", max_episode_steps=200, ) # merge_env.py - gym.register( + register( id="merge-v0", entry_point="highway_env.envs.merge_env:MergeEnv", ) # parking_env.py - gym.register( + register( id="parking-v0", entry_point="highway_env.envs.parking_env:ParkingEnv", ) - gym.register( + register( id="parking-ActionRepeat-v0", entry_point="highway_env.envs.parking_env:ParkingEnvActionRepeat", ) - gym.register( + register( id="parking-parked-v0", entry_point="highway_env.envs.parking_env:ParkingEnvParkedVehicles", ) # racetrack_env.py - gym.register( + register( id="racetrack-v0", entry_point="highway_env.envs.racetrack_env:RacetrackEnv", ) # roundabout_env.py - gym.register( + register( id="roundabout-v0", entry_point="highway_env.envs.roundabout_env:RoundaboutEnv", ) # two_way_env.py - gym.register( + register( id="two-way-v0", entry_point="highway_env.envs.two_way_env:TwoWayEnv", max_episode_steps=15, ) # u_turn_env.py - gym.register(id="u-turn-v0", entry_point="highway_env.envs.u_turn_env:UTurnEnv") + register(id="u-turn-v0", entry_point="highway_env.envs.u_turn_env:UTurnEnv") _register_highway_envs() diff --git a/setup.cfg b/setup.cfg index fd2a62b7c..3c9a99bf5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,7 @@ setup_requires= pytest-runner install_requires= farama-notifications - gymnasium>=0.27 + gymnasium>=0.28 numpy pygame>=2.0.2 matplotlib diff --git a/tests/envs/test_gym.py b/tests/envs/test_gym.py index 6246d8060..7514b6924 100644 --- a/tests/envs/test_gym.py +++ b/tests/envs/test_gym.py @@ -45,7 +45,7 @@ def test_highway_api(env_id): for warning in caught_warnings: if "is different from the unwrapped version" in warning.message.args[0]: continue - if warning.message.args[0] not in CHECK_ENV_IGNORE_WARNINGS: + elif warning.message.args[0] not in CHECK_ENV_IGNORE_WARNINGS: raise gym.error.Error(f"Unexpected warning: {warning.message}")