2022-05-10 15:35:45 +01:00
|
|
|
"""Setups the project."""
|
2022-03-31 12:50:38 -07:00
|
|
|
import itertools
|
2021-07-29 02:26:34 +02:00
|
|
|
|
|
|
|
from setuptools import find_packages, setup
|
2016-04-27 08:00:58 -07:00
|
|
|
|
2022-10-14 13:51:58 +01:00
|
|
|
|
2022-10-14 11:37:24 +01:00
|
|
|
def get_description():
|
2022-10-14 13:51:58 +01:00
|
|
|
"""Gets the description from the readme."""
|
2022-10-14 11:37:24 +01:00
|
|
|
with open("README.md") as file:
|
|
|
|
long_description = ""
|
|
|
|
header_count = 0
|
|
|
|
for line in file:
|
|
|
|
if line.startswith("##"):
|
|
|
|
header_count += 1
|
|
|
|
if header_count < 2:
|
|
|
|
long_description += line
|
|
|
|
else:
|
|
|
|
break
|
|
|
|
return header_count, long_description
|
|
|
|
|
2022-10-14 13:51:58 +01:00
|
|
|
|
2022-10-14 11:37:24 +01:00
|
|
|
def get_version():
|
2022-10-14 13:51:58 +01:00
|
|
|
"""Gets the gymnasium version."""
|
|
|
|
path = "gymnasium/__init__.py"
|
2022-10-14 11:37:24 +01:00
|
|
|
with open(path) as file:
|
2022-10-14 13:51:58 +01:00
|
|
|
lines = file.readlines()
|
|
|
|
|
|
|
|
for line in lines:
|
|
|
|
if line.startswith("__version__"):
|
|
|
|
return line.strip().split()[-1].strip().strip('"')
|
|
|
|
raise RuntimeError("bad version data in __init__.py")
|
|
|
|
|
2016-04-27 08:00:58 -07:00
|
|
|
|
2016-07-27 13:57:35 -07:00
|
|
|
# Environment-specific dependencies.
|
|
|
|
extras = {
|
2022-09-06 17:03:51 +01:00
|
|
|
"atari": ["ale-py~=0.8.0"],
|
2021-09-28 11:42:26 -06:00
|
|
|
"accept-rom-license": ["autorom[accept-rom-license]~=0.4.2"],
|
2022-09-13 12:14:08 +01:00
|
|
|
"box2d": ["box2d-py==2.3.5", "pygame==2.1.0", "swig==4.*"],
|
2022-02-11 23:48:42 +08:00
|
|
|
"classic_control": ["pygame==2.1.0"],
|
2022-05-24 08:47:51 -04:00
|
|
|
"mujoco_py": ["mujoco_py<2.2,>=2.1"],
|
2022-10-05 17:53:45 +01:00
|
|
|
"mujoco": ["mujoco==2.2", "imageio>=2.14.1"],
|
2022-06-06 22:27:34 +01:00
|
|
|
"toy_text": ["pygame==2.1.0"],
|
2022-08-22 17:21:08 +02:00
|
|
|
"other": ["lz4>=3.1.0", "opencv-python>=3.0", "matplotlib>=3.0", "moviepy>=1.0.0"],
|
2016-07-27 13:57:35 -07:00
|
|
|
}
|
|
|
|
|
2022-06-06 22:27:34 +01:00
|
|
|
# Testing dependency groups.
|
|
|
|
testing_group = set(extras.keys()) - {"accept-rom-license", "atari"}
|
|
|
|
extras["testing"] = list(
|
|
|
|
set(itertools.chain.from_iterable(map(lambda group: extras[group], testing_group)))
|
2022-10-20 11:30:14 +02:00
|
|
|
) + ["pytest==7.0.1", "gym==0.26.2"]
|
2021-09-28 11:42:26 -06:00
|
|
|
|
2022-06-06 22:27:34 +01:00
|
|
|
# All dependency groups - accept rom license as requires user to run
|
|
|
|
all_groups = set(extras.keys()) - {"accept-rom-license"}
|
2021-09-28 11:42:26 -06:00
|
|
|
extras["all"] = list(
|
2022-06-06 22:27:34 +01:00
|
|
|
set(itertools.chain.from_iterable(map(lambda group: extras[group], all_groups)))
|
2021-07-29 02:26:34 +02:00
|
|
|
)
|
2016-07-27 13:57:35 -07:00
|
|
|
|
2022-10-14 13:51:58 +01:00
|
|
|
version = get_version()
|
2022-10-14 11:37:24 +01:00
|
|
|
header_count, long_description = get_description()
|
2022-06-01 00:24:11 -04:00
|
|
|
|
2021-07-29 02:26:34 +02:00
|
|
|
setup(
|
2022-10-14 13:51:58 +01:00
|
|
|
name="Gymnasium",
|
|
|
|
version=version,
|
2022-09-08 09:30:38 -04:00
|
|
|
author="Farama Foundation",
|
2022-10-13 19:42:36 -04:00
|
|
|
author_email="contact@farama.org",
|
2022-09-08 09:30:38 -04:00
|
|
|
description="A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)",
|
2022-10-14 13:51:58 +01:00
|
|
|
url="https://gymnasium.farama.org/",
|
2022-01-27 02:26:54 +00:00
|
|
|
license="MIT",
|
2022-10-15 16:11:40 +01:00
|
|
|
license_files=("LICENSE",),
|
2022-06-01 00:24:11 -04:00
|
|
|
long_description=long_description,
|
|
|
|
long_description_content_type="text/markdown",
|
2022-10-14 13:51:58 +01:00
|
|
|
keywords=["Reinforcement Learning", "game", "RL", "AI", "gymnasium"],
|
|
|
|
python_requires=">=3.6",
|
|
|
|
tests_require=extras["testing"],
|
2022-09-08 10:11:31 +01:00
|
|
|
packages=[
|
|
|
|
package for package in find_packages() if package.startswith("gymnasium")
|
|
|
|
],
|
2021-07-29 02:26:34 +02:00
|
|
|
package_data={
|
2022-09-08 10:10:07 +01:00
|
|
|
"gymnasium": [
|
2021-07-29 02:26:34 +02:00
|
|
|
"envs/mujoco/assets/*.xml",
|
|
|
|
"envs/classic_control/assets/*.png",
|
2022-01-19 23:28:43 +01:00
|
|
|
"envs/toy_text/font/*.ttf",
|
|
|
|
"envs/toy_text/img/*.png",
|
2022-03-11 11:15:26 -06:00
|
|
|
"py.typed",
|
2021-07-29 02:26:34 +02:00
|
|
|
]
|
|
|
|
},
|
2022-10-14 13:51:58 +01:00
|
|
|
include_package_data=True,
|
|
|
|
install_requires=[
|
|
|
|
"numpy >= 1.18.0",
|
|
|
|
"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",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
],
|
|
|
|
extras_require=extras,
|
2022-06-06 22:27:34 +01:00
|
|
|
zip_safe=False,
|
2016-04-27 08:00:58 -07:00
|
|
|
)
|