generated from duckietown/template-library
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
83 lines (72 loc) · 2.29 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
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-computer-vision"
library_webpage = f"http://github.com/duckietown/lib-{package_name}"
maintainer = "Andrea F. Daniele"
maintainer_email = "afdaniele@duckietown.com"
short_description = "Computer Vision components of Duckietown's autonomy behavior."
full_description = """
Computer Vision 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<=4.9.0.80",
# numpy
"numpy<=1.26.4",
# requests
"requests<=2.31.0",
]
tests_require = [
"pytest",
"pytest-cov",
]
# 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,
)
# Assuming your test package is in src/dt_computer_vision_tests
packages = find_packages("src", include=["dt_computer_vision", "dt_computer_vision.*", "dt_computer_vision_tests", "dt_computer_vision_tests.*"])
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,
extras_require={
"test": tests_require,
},
install_requires=install_requires,
package_dir={"": "src"},
packages=packages,
include_package_data=True,
long_description=description,
version=version,
test_suite='dt_computer_vision_tests', # Ensure this points to your test package
)