-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
93 lines (80 loc) · 2.98 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env python
import io
import os
import re
import shutil
import sys
from pkg_resources import DistributionNotFound, get_distribution
from setuptools import find_packages, setup
def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8"),
) as fp:
return fp.read()
def get_dist(pkgname):
try:
return get_distribution(pkgname)
except DistributionNotFound:
return None
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
PATH_ROOT = os.path.dirname(__file__)
VERSION = find_version("sdriving", "__init__.py")
def load_requirements(path_dir=PATH_ROOT, comment_char="#"):
with open(os.path.join(path_dir, "requirements.txt"), "r") as file:
lines = [ln.strip() for ln in file.readlines()]
reqs = []
for ln in lines:
# filer all comments
if comment_char in ln:
ln = ln[: ln.index(comment_char)]
if ln: # if requirement is not empty
reqs.append(ln)
return reqs
setup(
# Metadata
name="sdriving",
version=VERSION,
author="Avik Pal",
author_email="[email protected]",
url="https://github.com/fidler-lab/social-driving/",
description="Design multi-agent environments and simple reward functions such that social driving behavior emerges",
license="MIT",
# Package info
packages=find_packages(exclude=("test",)),
zip_safe=True,
install_requires=load_requirements(PATH_ROOT),
long_description=open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
include_package_data=True,
keywords=["deep learning", "pytorch", "RL", "AI"],
python_requires=">=3.6",
classifiers=[
"Environment :: Console",
"Natural Language :: English",
# How mature is this project? Common values are
# 3 - Alpha, 4 - Beta, 5 - Production/Stable
"Development Status :: 3 - Alpha",
# Indicate who your project is intended for
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Scientific/Engineering :: Deep Learning",
"Topic :: Scientific/Engineering :: Reinforcement Learning",
# Pick your license as you wish
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
)