forked from Farama-Foundation/HighwayEnv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
24 lines (16 loc) · 738 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Following PEP 517/518, this file should not not needed and replaced instead by the setup.cfg file and pyproject.toml.
# Unfortunately it is still required py the pip editable mode `pip install -e`
# See https://stackoverflow.com/a/60885212
import pathlib
from setuptools import setup
CWD = pathlib.Path(__file__).absolute().parent
def get_version():
"""Gets the gymnasium version."""
path = CWD / "highway_env" / "__init__.py"
content = path.read_text()
for line in content.splitlines():
if line.startswith("__version__"):
return line.strip().split()[-1].strip().strip('"')
raise RuntimeError("bad version data in __init__.py")
if __name__ == "__main__":
setup(version=get_version())