forked from ros-visualization/python_qt_binding
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·47 lines (43 loc) · 1.65 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
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup()
except ImportError:
# extract information from package.xml manually when catkin_pkg is unavailable
from xml.etree import ElementTree
tree = ElementTree.parse('package.xml')
root = tree.getroot()
d = {
'name': root.find('./name').text,
'version': root.find('./version').text,
'maintainer': root.findall('./maintainer')[0].text,
'maintainer_email': root.findall('./maintainer')[0].attrib['email'],
'license': ', '.join([x.text for x in root.findall('./license')]),
'url': root.findall('./url')[0].text,
'author': ', '.join([x.text for x in root.findall('./author')]),
}
description = root.find('./description').text.strip()
if len(description) <= 200:
d['description'] = description
else:
d['description'] = description[:197] + '...'
d['long_description'] = description
d.update({
'packages': [d['name']],
'package_dir': {'': 'src'},
'classifiers': [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: BSD License',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'License :: OSI Approved :: GNU General Public License (GPL)',
],
})
setup(**d)