generated from duckietown/template-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
75 lines (64 loc) · 1.97 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
from setuptools import find_packages, setup
# :==> Fill in your project data here
# The package name is the name on PyPI
# it is not the python module names.
package_name = "dt-state-estimation"
library_webpage = f"http://github.com/duckietown/lib-{package_name}"
maintainer = "Andrea F. Daniele"
maintainer_email = "afdaniele@duckietown.com"
short_description = "State estimation components of Duckietown's autonomy behavior."
full_description = """
State estimation components of the autonomous behavior pipeline running on Duckietown robots.
"""
# Read version from the __init__ file
def get_version_from_source(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
version = get_version_from_source(f"src/{package_name.replace('-', '_')}/__init__.py")
install_requires = [
# opencv4
"opencv-python-headless",
"numpy<=1.26.4",
"scipy<=1.13.0",
"reprep",
"transformations~=2021.6.6"
]
tests_require = []
# compile description
underline = "=" * (len(package_name) + len(short_description) + 2)
description = """
{name}: {short}
{underline}
{long}
""".format(
name=package_name,
short=short_description,
long=full_description,
underline=underline,
)
packages = find_packages("./src")
print("The following packages were found:\n\t - " + "\n\t - ".join(packages) + "\n")
# setup package
setup(
name=f"lib-{package_name}",
author=maintainer,
author_email=maintainer_email,
url=library_webpage,
tests_require=tests_require,
install_requires=install_requires,
package_dir={"": "src"},
packages=find_packages("./src"),
long_description=description,
version=version,
include_package_data=True
)