forked from dustcloud/smartmeshsdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
235 lines (218 loc) · 10 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
'''Setup for SmartMesh SDK python distribution
'''
# Grab the current version from the version file
import os
import sys
import platform
sys.path.append(os.path.join('libs', 'dustUI'))
sys.path.append(os.path.join('libs', 'SmartMeshSDK'))
sys.path.append(os.path.join('app', 'MuxConfig'))
sys.path.append(os.path.join('external_libs','cryptopy'))
import sdk_version
# TODO: include documentation
# TODO: include functional tests
# Platform-specific initialization
NAME = 'SmartMeshSDK'
if platform.system() in ['Darwin']:
# use setuptools on OS X
from setuptools import setup
import py2app
# use a different name because we're only building one application
NAME = 'ApiExplorer'
platform_setup_options = {
'app': [os.path.join('app', 'APIExplorer', 'APIExplorer.py')],
'options': {
'py2app': {'argv_emulation': True}
},
'setup_requires': ['py2app'],
}
elif platform.system() in ['Windows']:
# imports for Windows
# use distutils because it's easier to specify what's included
from distutils.core import setup
import py2exe
platform_setup_options = {
# py2exe parameters
'console': [
{'script': os.path.join('app', 'AclCommissioning', 'AclCommissioning.py'),},
{'script': os.path.join('app', 'BroadcastLeds', 'BroadcastLeds.py'),},
{'script': os.path.join('app', 'InstallTest', 'InstallTest.py'),},
{'script': os.path.join('app', 'JsonServer', 'JsonServer.py'),},
{'script': os.path.join('app', 'NetworkHealth', 'NetworkHealth.py'),},
{'script': os.path.join('app', 'OTAPCommunicator', 'OTAPCommunicator.py'),},
{'script': os.path.join('app', 'RawSerial', 'RawSerial.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleHartMote.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleIPMgr.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleIPMote.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleIPDownstreamMgr.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleIPDownstreamMote.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleIPUpstreamMgr.py'),},
{'script': os.path.join('app', 'Simple', 'SimpleIPUpstreamMote.py'),},
{'script': os.path.join('app', 'SyncTemp', 'SyncTemp.py'),},
{'script': os.path.join('app', 'SyncTemp', 'logAnalysis.py'),},
{'script': os.path.join('app', 'TempLogger', 'TempLogger.py'),},
{'script': os.path.join('app', 'Timelapse', 'Timelapse1Collect.py'),},
],
'windows': [
{'script': os.path.join('app', 'APIExplorer', 'APIExplorer.py'),},
{'script': os.path.join('app', 'Chaser', 'Chaser.py'),},
{'script': os.path.join('app', 'DC2126A', 'DC2126A.py'),},
{'script': os.path.join('app', 'HdlcTool', 'HdlcTool.py'),},
{'script': os.path.join('app', 'HrListener', 'HrListener.py'),},
{'script': os.path.join('app', 'LBRConnection', 'LBRConnection.py'),},
{'script': os.path.join('app', 'LEDPing', 'LEDPing.py'),},
{'script': os.path.join('app', 'MeshOfMeshes', 'MeshOfMeshes.py'),},
{'script': os.path.join('app', 'MgrListener', 'MgrListener.py'),},
{'script': os.path.join('app', 'MuxConfig', 'MuxConfig.py'),},
{'script': os.path.join('app', 'PkGen', 'PkGen.py'),},
{'script': os.path.join('app', 'SensorDataReceiver', 'SensorDataReceiver.py'),},
{'script': os.path.join('app', 'TempMonitor', 'TempMonitor.py'),},\
{'script': os.path.join('app', 'Timelapse', 'Timelapse2Analyze.py'),},
{'script': os.path.join('app', 'Upstream', 'Upstream.py'),},
{'script': os.path.join('app', 'Voting', 'Voting.py'),},
{'script': os.path.join('app', 'Xively', 'Xively.py'),},
],
'options': {
'py2exe': {
#'bundle_files': 1,
'dll_excludes': ['MSVCP90.dll', 'w9xpopen.exe'],
},
},
'zipfile': None,
}
else:
# use distutils because it's easier to specify what's included
from distutils.core import setup
platform_setup_options = {}
setup(
name = NAME,
version = '.'.join([str(v) for v in sdk_version.VERSION]),
scripts = [
'app/AclCommissioning/AclCommissioning.py',
'app/APIExplorer/APIExplorer.py',
'app/BroadcastLeds/BroadcastLeds.py',
'app/Chaser/Chaser.py',
'app/DC2126A/DC2126A.py',
'app/HdlcTool/HdlcTool.py',
'app/HrListener/HrListener.py',
'app/InstallTest/InstallTest.py',
'app/JsonServer/JsonServer.py',
'app/LBRConnection/LBRConnection.py',
'app/LEDPing/LEDPing.py',
'app/MeshOfMeshes/MeshOfMeshes.py',
'app/MgrListener/MgrListener.py',
'app/MuxConfig/MuxConfig.py',
'app/NetworkHealth/NetworkHealth.py',
'app/OTAPCommunicator/OTAPCommunicator.py',
'app/PkGen/PkGen.py',
'app/RawSerial/RawSerial.py',
'app/SensorDataReceiver/SensorDataReceiver.py',
'app/Simple/SimpleHartMote.py',
'app/Simple/SimpleIPMgr.py',
'app/Simple/SimpleIPMote.py',
'app/Simple/SimpleIPDownstreamMgr.py',
'app/Simple/SimpleIPDownstreamMote.py',
'app/Simple/SimpleIPUpstreamMgr.py',
'app/Simple/SimpleIPUpstreamMote.py',
'app/SyncTemp/SyncTemp.py',
'app/SyncTemp/logAnalysis.py',
'app/TempLogger/TempLogger.py',
'app/TempMonitor/TempMonitor.py',
'app/Timelapse/Timelapse1Collect.py',
'app/Timelapse/Timelapse2Analyze.py',
'app/Upstream/Upstream.py',
'app/Voting/Voting.py',
'app/Xively/Xively.py',
],
# TODO: is there an easier way to include packages recursively?
# maybe find_packages?
packages = [
# from external_libs/
'bottle',
'cryptopy',
'cryptopy.crypto',
'cryptopy.crypto.cipher',
'cryptopy.crypto.entropy',
'cryptopy.crypto.hash',
'cryptopy.crypto.keyedHash',
'cryptopy.crypto.passwords',
'cryptopy.fmath',
# from libs/
'dustUI',
'dustCli',
'SmartMeshSDK',
'SmartMeshSDK.ApiDefinition',
'SmartMeshSDK.HartMgrConnector',
'SmartMeshSDK.HartMoteConnector',
'SmartMeshSDK.IpMgrConnectorMux',
'SmartMeshSDK.IpMgrConnectorSerial',
'SmartMeshSDK.IpMoteConnector',
'SmartMeshSDK.LbrConnector',
'SmartMeshSDK.utils',
'SmartMeshSDK.protocols',
'SmartMeshSDK.protocols.DC2126AConverters',
'SmartMeshSDK.protocols.Hr',
'SmartMeshSDK.protocols.NetworkHealthAnalyzer',
'SmartMeshSDK.protocols.oap',
'SmartMeshSDK.protocols.otap',
'SmartMeshSDK.protocols.xivelyConnector',
'SmartMeshSDK.SerialConnector',
# application-specific packages
'MuxConfig',
],
package_dir = {
'bottle': 'external_libs/bottle',
'cryptopy': 'external_libs/cryptopy',
'dustUI': 'libs/dustUI',
'dustCli': 'libs/dustCli',
'SmartMeshSDK': 'libs/SmartMeshSDK',
# application-specific packages
'MuxConfig': 'app/MuxConfig',
},
data_files = [
# destination source
('', ['DN_LICENSE.txt']),
('', ['requirements.txt']),
('app', ['app/logging.conf']),
('app/AclCommissioning', ['app/AclCommissioning/README.md']),
('app/APIExplorer', ['app/APIExplorer/README.md']),
('app/BroadcastLeds', ['app/BroadcastLeds/README.md']),
('app/Chaser', ['app/Chaser/README.md']),
('app/DC2126A', ['app/DC2126A/README.md']),
('app/HdlcTool', ['app/HdlcTool/README.md']),
('app/HrListener', ['app/HrListener/README.md']),
('app/InstallTest', ['app/InstallTest/README.md']),
('app/LBRConnection', ['app/LBRConnection/README.md']),
('app/LEDPing', ['app/LEDPing/README.md']),
('app/MeshOfMeshes', ['app/MeshOfMeshes/README.md']),
('app/MgrListener', ['app/MgrListener/README.md']),
('app/MuxConfig', ['app/MuxConfig/README.md']),
('app/NetworkHealth', ['app/NetworkHealth/README.md']),
('app/OTAPCommunicator', ['app/OTAPCommunicator/README.md']),
('app/PkGen', ['app/PkGen/README.md']),
('app/RawSerial', ['app/RawSerial/README.md']),
('app/SensorDataReceiver', ['app/SensorDataReceiver/README.md']),
('app/Simple', ['app/Simple/README.md']),
('app/SyncTemp', ['app/SyncTemp/README.md']),
('app/TempLogger', ['app/TempLogger/README.md']),
('app/TempMonitor', ['app/TempMonitor/README.md']),
('app/Timelapse', ['app/Timelapse/README.md']),
('app/Upstream', ['app/Upstream/README.md']),
('app/Voting', ['app/Voting/README.md']),
('app/Xively', ['app/Xively/README.md']),
('app/LBRConnection', ['app/LBRConnection/guest.lbrauth']),
('app/JsonServer', ['app/JsonServer/index.html']),
('app/JsonServer', ['app/JsonServer/README.md']),
('app/JsonServer/static', ['app/JsonServer/static/jquery-1.8.0.min.js']),
('app/JsonServer/static', ['app/JsonServer/static/jquery-1.8.0.min.license']),
('', ['app/SyncTemp/configuration_DO_NOT_DELETE.txt']),
('libs/dustUI', ['libs/dustUI/dust.ico']),
#('external_libs/cryptopy',['external_libs/cryptopy/LICENSE.txt']),
],
# url =
author = 'Linear Technology',
author_email = "[email protected]",
license = 'see DN_LICENSE.txt',
# platform-specific options
**platform_setup_options
)