-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
88 lines (79 loc) · 3.3 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
#!/usr/bin/env python
from distutils.core import setup
import glob
import os
from subprocess import Popen, PIPE
#Recover version from Mercurial
try:
process = Popen(["hg", "identify", "-it"], stdout=PIPE)
(output, err) = process.communicate()
exit_code = process.wait()
except OSError:
raise Exception("Cannot run hg: Mercurial is required to generate packages!")
output = output.strip().split(" ")
if len(output) < 2 or output[1] == "tip":
VERSION = output[0]
else:
VERSION = output[1]
try:
import py2exe
except ImportError:
print("Warning: py2exe not usable")
with open(os.path.join(os.path.dirname(__file__),
"lib",
"cfclient",
"version.py"), "w") as versionpy:
versionpy.write("VERSION='{}'".format(VERSION))
setup(name='cfclient',
description='Bitcraze Cazyflie nano quadcopter client',
version=VERSION,
author='Bitcraze team',
author_email='[email protected]',
url='http://www.bitcraze.se',
package_dir={'': 'lib'},
packages=['cfclient', 'cfclient.ui', 'cfclient.ui.tabs',
'cfclient.ui.toolboxes', 'cfclient.ui.widgets',
'cfclient.utils', 'cfclient.ui.dialogs', 'cflib',
'cflib.bootloader', 'cflib.crazyflie', 'cflib.drivers',
'cflib.utils', 'cflib.crtp'],
scripts=['bin/cfclient'],
# Py2exe specifics
console=[ {
"script" : 'bin/cfclient',
"icon_resources": [(1, "bitcraze.ico")]
}
],
data_files=[('', ['README.md', 'LICENSE.txt']),
('cfclient/ui',
glob.glob('lib/cfclient/ui/*.ui')),
('cfclient/ui/tabs',
glob.glob('lib/cfclient/ui/tabs/*.ui')),
('cfclient/ui/widgets',
glob.glob('lib/cfclient/ui/widgets/*.ui')),
('cfclient/ui/toolboxes',
glob.glob('lib/cfclient/ui/toolboxes/*.ui')),
('cfclient/ui/dialogs',
glob.glob('lib/cfclient/ui/dialogs/*.ui')),
('cfclient/configs',
glob.glob('lib/cfclient/configs/*.json')),
('cflib/cache',
glob.glob('lib/cflib/cache/*.json')),
('cfclient/configs/input',
glob.glob('lib/cfclient/configs/input/*.json')),
('cfclient/configs/log',
glob.glob('lib/cfclient/configs/log/*.json')),
('cfclient',
glob.glob('lib/cfclient/*.png'))],
options={"py2exe": {"includes": ["sip", "PyQt4",
"cfclient.ui.widgets",
"cflib.bootloader.cloader",
"cfclient.ui.toolboxes.*",
"cfclient.ui.*", "cfclient.ui.tabs.*",
"cfclient.ui.widgets.*",
"cfclient.ui.dialogs.*"],
"excludes": ["AppKit"],
"skip_archive": True}})
os.remove(os.path.join(os.path.dirname(__file__),
"lib",
"cfclient",
"version.py"))