forked from bitcraze/crazyflie-clients-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
115 lines (94 loc) · 3.04 KB
/
setup.py
File metadata and controls
115 lines (94 loc) · 3.04 KB
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import subprocess
from subprocess import PIPE, Popen
from setuptools import setup, find_packages
from glob import glob
import json
import codecs
import sys
try:
import py2exe # noqa
except:
pass
if sys.version_info < (3, 4):
raise "must use python 3.4 or greater"
# Recover version from Git
def get_version():
try:
process = Popen(["git", "describe", "--tags"], stdout=PIPE)
(output, err) = process.communicate()
process.wait()
except OSError:
raise Exception("Cannot run git: " +
"Git is required to generate packages!")
version = output.strip().decode("UTF-8")
if subprocess.call(["git", "diff-index", "--quiet", "HEAD"]) != 0:
version += "_modified"
return version
VERSION = get_version()
with codecs.open('version.json', 'w', encoding='utf8') as f:
f.write(json.dumps({'version': VERSION}))
platform_requires = []
platform_dev_requires = []
if sys.platform == 'win32' or sys.platform == 'darwin':
platform_requires = ['pysdl2']
if sys.platform == 'win32':
platform_dev_requires = ['py2exe', 'jinja2']
# Initial parameters
setup(
name='cfclient',
description='Bitcraze Cazyflie quadcopter client',
version=VERSION,
author='Bitcraze team',
url='http://www.bitcraze.io',
classifiers=[
'License :: OSI Approved :: GPLv2 License',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='quadcopter crazyflie',
package_dir={'': 'src'},
packages=find_packages('src'),
entry_points={
'console_scripts': [
'cfclient=cfclient.gui:main',
'cfheadless=cfclient.headless:main',
'cfloader=cfloader:main',
'cfzmq=cfzmq:main'
],
},
install_requires=platform_requires + ['cflib', 'appdirs'],
# List of dev dependencies
# You can install them by running
# $ pip install -e .[dev]
extras_require={
'dev': platform_dev_requires + []
},
# Py2exe options
console=[
{
'script': 'bin/cfclient',
'icon_resources': [(0, 'bitcraze.ico')]
}
],
py2exe={
'includes': ['cfclient.ui.widgets.hexspinbox'],
'bundle_files': 2
},
data_files=[
('', ['README.md', 'version.json']),
('ui', glob('src/cfclient/ui/*.ui')),
('ui/tabs', glob('src/cfclient/ui/tabs/*.ui')),
('ui/widgets', glob('src/cfclient/ui/widgets/*.ui')),
('ui/toolboxes', glob('src/cfclient/ui/toolboxes/*.ui')),
('ui/dialogs', glob('src/cfclient/ui/dialogs/*.ui')),
('configs', glob('src/cfclient/configs/*.json')),
('configs/input', glob('src/cfclient/configs/input/*.json')),
('configs/log', glob('src/cfclient/configs/log/*.json')),
('', glob('src/cfclient/*.png')),
('resources', glob('src/cfclient/resources/*')),
('third_party', glob('src/cfclient/third_party/*')),
],
)