forked from MichaelGrupp/evo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
124 lines (108 loc) · 3.53 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
from setuptools import setup, Command
from setuptools.command.install import install
import os
import sys
import shutil
import subprocess as sp
from pathlib import Path
# monkey patch because setuptools entry_points are slow as fuck
# https://github.com/ninjaaron/fast-entry_points
import fastentrypoints # pylint: disable=unused-import
HERE = Path(__file__).absolute().parent
def activate_argcomplete():
if os.name == "nt":
return
print("Activating argcomplete...")
try:
sp.check_call("activate-global-python-argcomplete", shell=True)
print("Done - argcomplete should work now.")
except sp.CalledProcessError as e:
print("Error:", e.output, file=sys.stderr)
def _post_install(install_lib_dir):
activate_argcomplete()
class CustomInstall(install):
def run(self):
install.run(self)
self.execute(_post_install, (self.install_lib, ),
msg="Running post install task of evo...")
# cmd: python setup.py upload
class UploadCommand(Command):
description = "Build and publish the package."
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
print("Removing previous dist/ ...")
shutil.rmtree(HERE / "dist")
except OSError:
pass
print("Building source distribution...")
sp.check_call([sys.executable, "setup.py", "sdist"])
print("Uploading package to PyPi...")
sp.check_call(["twine", "upload", "dist/*"])
sys.exit()
# yapf: disable
setup(
name="evo",
version=open("evo/version").read(),
description="Python package for the evaluation of odometry and SLAM",
author="Michael Grupp",
author_email="[email protected]",
url="https://github.com/MichaelGrupp/evo",
license="GPLv3",
long_description=open(HERE / "README.md").read(),
long_description_content_type="text/markdown",
keywords=[
"SLAM", "odometry", "trajectory", "evaluation", "metric",
"vision", "laser", "visual", "robotics"
],
packages=["evo", "evo.core", "evo.tools"],
package_data={"evo": ["version", "LICENSE"]},
entry_points={"console_scripts": [
"evo_ape=evo.entry_points:ape",
"evo_rpe=evo.entry_points:rpe",
"evo_traj=evo.entry_points:traj",
"evo_res=evo.entry_points:res",
"evo_config=evo.main_config:main",
"evo_fig=evo.main_fig:main",
"evo_ipython=evo.main_ipython:main",
"evo=evo.main_evo:main"
]},
zip_safe=False,
cmdclass={
"install": CustomInstall,
"upload": UploadCommand
},
install_requires=[
"numpy>=1.18.5",
"matplotlib",
"scipy>=1.2",
"pandas",
"numexpr>=2.7.3",
"seaborn>=0.9",
"natsort",
"argcomplete",
"colorama>=0.3",
"pygments",
"pyyaml",
"pillow",
"rosbags>=0.9.20",
],
python_requires=">=3.8",
classifiers=[
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Topic :: Scientific/Engineering",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython"
]
)
# yapf: enable