Skip to content

Commit

Permalink
Update importlib_metadata entry_point calls (#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseFarebro authored Dec 22, 2021
1 parent 102cd1b commit eb6d826
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gym/envs/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import contextlib
from typing import Callable, Type, Optional, Union, Dict, Set, Tuple, Generator

if sys.version_info < (3, 8):
if sys.version_info < (3, 10):
import importlib_metadata as metadata # type: ignore
else:
import importlib.metadata as metadata
Expand Down Expand Up @@ -794,7 +794,7 @@ def namespace(ns: str):

def load_env_plugins(entry_point: str = "gym.envs") -> None:
# Load third-party environments
for plugin in metadata.entry_points().get(entry_point, []):
for plugin in metadata.entry_points(group=entry_point):
# Python 3.8 doesn't support plugin.module, plugin.attr
# So we'll have to try and parse this ourselves
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
install_requires=[
"numpy>=1.18.0",
"cloudpickle>=1.2.0",
"importlib_metadata>=4.8.1; python_version < '3.8'",
"importlib_metadata>=4.10.0; python_version < '3.10'",
],
extras_require=extras,
package_data={
Expand Down

0 comments on commit eb6d826

Please sign in to comment.