forked from idsc-frazzoli/dg-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
56 lines (45 loc) · 1.63 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
import distutils.text_file
from pathlib import Path
from typing import List
from setuptools import setup, find_packages
def get_version(filename):
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith("__version__"):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError("No version found in %r." % filename)
if version is None:
raise ValueError(filename)
return version
def _parse_requirements(filename: str) -> List[str]:
"""Return requirements from requirements file."""
return distutils.text_file.TextFile(filename=str(Path(__file__).with_name(filename))).readlines()
install_requires = _parse_requirements("requirements.txt")
extras_require = {"all": _parse_requirements("requirements-extra.txt")}
module = "dg_commons"
package = "dg-commons"
src = "src"
version = get_version(filename=f"src/{module}/__init__.py")
setup(
name=package,
author="Alessandro Zanardi",
author_email="[email protected]",
url="https://github.com/idsc-frazzoli/dg-commons",
description="Common tools and utilities related to Driving Games",
long_description=(Path(__file__).with_name("README.md")).read_text(),
long_description_content_type="text/markdown",
package_dir={"": src},
packages=find_packages("src"),
version=version,
python_requires=">=3.8",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
],
install_requires=install_requires,
extras_require=extras_require,
)