2022-05-10 15:35:45 +01:00
|
|
|
"""Setups the project."""
|
2022-03-31 12:50:38 -07:00
|
|
|
import itertools
|
2022-12-01 12:18:01 +00:00
|
|
|
from typing import Dict, List
|
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.
|
2022-12-01 12:18:01 +00:00
|
|
|
extras: Dict[str, List[str]] = {
|
2022-12-01 12:04:57 +00:00
|
|
|
"atari": ["shimmy[atari]>=0.1.0,<1.0"],
|
2021-09-28 11:42:26 -06:00
|
|
|
"accept-rom-license": ["autorom[accept-rom-license]~=0.4.2"],
|
2022-12-01 15:52:45 -05:00
|
|
|
"box2d": ["box2d-py==2.3.5", "pygame==2.1.0", "swig==4.*"],
|
|
|
|
"classic_control": ["pygame==2.1.0"],
|
|
|
|
"mujoco_py": ["mujoco_py<2.2,>=2.1"],
|
|
|
|
"mujoco": ["mujoco>=2.3.0", "imageio>=2.14.1"],
|
|
|
|
"toy_text": ["pygame==2.1.0"],
|
|
|
|
"jax": ["jax==0.3.20", "jaxlib==0.3.20"],
|
2022-12-03 19:46:01 +00:00
|
|
|
"other": [
|
|
|
|
"lz4>=3.1.0",
|
|
|
|
"opencv-python>=3.0",
|
|
|
|
"matplotlib>=3.0",
|
|
|
|
"moviepy>=1.0.0",
|
|
|
|
"tensorflow>=2.1.0",
|
|
|
|
"torch>=1.0.0",
|
|
|
|
],
|
2016-07-27 13:57:35 -07: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
|
|
|
)
|
2022-12-01 12:18:01 +00:00
|
|
|
extras["testing"] = [
|
|
|
|
"pytest==7.1.3",
|
|
|
|
]
|
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"],
|
2022-10-25 14:41:09 +01:00
|
|
|
python_requires=">=3.7",
|
2022-10-14 13:51:58 +01:00
|
|
|
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=[
|
2022-11-15 14:09:22 +00:00
|
|
|
"numpy >= 1.21.0",
|
2022-12-01 21:36:11 +01:00
|
|
|
"jax-jumpy >= 0.2.0",
|
2022-10-14 13:51:58 +01:00
|
|
|
"cloudpickle >= 1.2.0",
|
|
|
|
"importlib_metadata >= 4.8.0; python_version < '3.10'",
|
|
|
|
"gymnasium_notices >= 0.0.1",
|
2022-12-01 12:04:57 +00:00
|
|
|
"shimmy>=0.1.0, <1.0",
|
2022-10-14 13:51:58 +01:00
|
|
|
],
|
|
|
|
classifiers=[
|
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"Programming Language :: Python :: 3.7",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
"Programming Language :: Python :: 3.9",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
2022-12-01 12:51:17 +00:00
|
|
|
"Programming Language :: Python :: 3.11",
|
2022-10-14 13:51:58 +01:00
|
|
|
],
|
|
|
|
extras_require=extras,
|
2022-06-06 22:27:34 +01:00
|
|
|
zip_safe=False,
|
2016-04-27 08:00:58 -07:00
|
|
|
)
|