forked from hungpham2511/toppra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
69 lines (59 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
from setuptools import setup, Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy as np
import sys
NAME = "toppra"
with open("VERSION", "r") as file_:
VERSION = file_.read()
DESCR = "toppra: time-optimal parametrization of trajectories for robots subject to constraints."
LONG_DESCRIPTION = "An implementation of TOPP-RA (TOPP via Reachability Analysis) for time-parametrizing" \
"trajectories for robots subject to kinematic (velocity and acceleration) and dynamic" \
"(torque) constraints. Some other kinds of constraints are also supported."
URL = "https://github.com/hungpham2511/toppra"
# requirements
if sys.version[0] == '2':
with open("requirements.txt", "r") as f:
REQUIRES = ["scipy==0.18.0", "numpy", "enum34", "coloredlogs"]
DEV_REQUIRES = [line.strip() for line in f if line.strip()]
else:
with open("requirements3.txt", "r") as f:
REQUIRES = ["scipy>0.18", "numpy", "enum34", "coloredlogs"]
DEV_REQUIRES = [line.strip() for line in f if line.strip()]
AUTHOR = "Hung Pham"
EMAIL = "hungpham2511@gmail.com"
LICENSE = "MIT"
SRC_DIR = "toppra"
PACKAGES = ["toppra",
"toppra.constraint",
"toppra.algorithm",
"toppra.algorithm.reachabilitybased",
"toppra.solverwrapper"]
ext_1 = Extension(SRC_DIR + "._CythonUtils",
[SRC_DIR + "/_CythonUtils.pyx"],
libraries=[],
include_dirs=[np.get_include()])
ext_2 = Extension(SRC_DIR + ".solverwrapper.cy_seidel_solverwrapper",
[SRC_DIR + "/solverwrapper/cy_seidel_solverwrapper.pyx"],
extra_compile_args=['-O1'],
include_dirs=[np.get_include()])
EXTENSIONS = [ext_1, ext_2]
if __name__ == "__main__":
setup(install_requires=REQUIRES,
setup_requires=["numpy", "cython"],
extras_require={
'dev': DEV_REQUIRES
},
packages=PACKAGES,
zip_safe=False,
name=NAME,
version=VERSION,
description=DESCR,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
author_email=EMAIL,
url=URL,
license=LICENSE,
cmdclass={"build_ext": build_ext},
ext_modules=cythonize(EXTENSIONS)
)