Files
Gymnasium/setup.py

23 lines
508 B
Python
Raw Normal View History

"""Setups the project."""
2021-07-29 02:26:34 +02:00
2022-12-05 19:56:00 +08:00
import pathlib
2016-04-27 08:00:58 -07:00
2022-12-05 19:56:00 +08:00
from setuptools import setup
2022-10-14 13:51:58 +01:00
2022-12-05 19:56:00 +08:00
CWD = pathlib.Path(__file__).absolute().parent
2022-10-14 11:37:24 +01:00
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."""
2022-12-05 19:56:00 +08:00
path = CWD / "gymnasium" / "__init__.py"
content = path.read_text()
2022-10-14 13:51:58 +01:00
2022-12-05 19:56:00 +08:00
for line in content.splitlines():
2022-10-14 13:51:58 +01:00
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
2022-12-05 19:56:00 +08:00
setup(name="gymnasium", version=get_version())