-
Notifications
You must be signed in to change notification settings - Fork 30
/
setup.installers.py
executable file
·255 lines (219 loc) · 7.98 KB
/
setup.installers.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/usr/bin/env python
# coding=utf-8
import os, sys
from copy import copy
import collections
from setuptools import setup, find_packages
__version__ = open(os.path.join('pathomx','VERSION'),'rU').read()
print __version__
sys.path.insert(0,'pathomx')
# Defaults for py2app / cx_Freeze
default_build_options=dict(
packages=[
'PyQt4',
"PyQt4.uic.port_v3.proxy_base",
'numpy',
'scipy',
'pandas',
'IPython',
'matplotlib',
'dateutil',
'requests',
'sklearn',
'sklearn.decomposition',
'nmrglue',
'nmrglue.fileio.fileiobase',
'gpml2svg',
'icoshift',
'mplstyler',
'pyqtconfig',
"zmq",
"zmq.utils.garbage",
"zmq.backend.cython",
"pygments",
],
includes=[
'sip',
'pydot',
],
excludes=[
'_xmlplus',
'test',
'networkx',
'wx',
'mpl-data',
'Tkinter',
"collections.abc",
"PyQt5",
],
)
build_all = dict()
build_mac = dict()
build_exe = dict()
build_py2app = dict()
bdist_msi = dict()
executables = []
try:
from cx_Freeze import setup, Executable
except:
excutables = None
else:
# cx_Freeze setup
base = None
exceutables = None
build_all['include_files']=[
('pathomx/static', 'static'),
('pathomx/database', 'database'),
('pathomx/plugins', 'plugins'),
('pathomx/demos', 'demos'),
('pathomx/identities', 'identities'),
('pathomx/html', 'html'),
('pathomx/icons', 'icons'),
]
build_exe = copy(build_all)
build_mac = copy(build_all)
build_mac['iconfile'] = 'pathomx/static/icon.icns'
base = None
if sys.platform == "win32":
base = "Win32GUI"
build_exe['include_msvcr'] = True
build_exe['icon'] = 'pathomx/static/icon.ico'
# FIXME: The following is a hack to correctly copy all files required for
# numpy, scipy and nmrglue on Windows. At present cx_Freeze misses a number of
# the .pyd files. The fix is to copy *all* of them regardless if they're used.
# This means bigger binaries (.msi) but they work.
import os, glob2, numpy, scipy, nmrglue
explore_dirs = [
os.path.dirname(numpy.__file__),
os.path.dirname(scipy.__file__),
os.path.dirname(nmrglue.__file__),
]
files = []
for d in explore_dirs:
files.extend( glob2.glob( os.path.join(d, '**', '*.pyd') ) )
# Add DLLs to avoid target needing to install MS distributable packages
# This is a specific hack to build a distributable version on my own Windows 8 PC
# PyQt is built using vc110, but only vc90 (Python2.7) is included. This will go away
# when migrated to Python 3 (also vc110).
for f in [
'C:/Windows/System32/msvcr110.dll',
'C:/Windows/System32/msvcp110.dll',
#'C:/Windows/WinSxS/amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5/msvcr90.dll',
#'C:/Windows/WinSxS/amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5/msvcp90.dll',
]:
build_all['include_files'].append( (f, os.path.basename(f) ) )
# Now we have a list of .pyd files; iterate to build a list of tuples into
# include files containing the source path and the basename
for f in files:
build_all['include_files'].append( (f, os.path.basename(f) ) )
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"Pathomx", # Name
"TARGETDIR", # Component_
"[TARGETDIR]Pathomx.exe",# Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
),
("Shortcut", # Shortcut
"ProgramMenuFolder", # Directory_
"Pathomx", # Name
"TARGETDIR", # Component_
"[TARGETDIR]Pathomx.exe",# Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
)
]
# Change some default MSI options and specify the use of the above defined tables
bdist_msi['data'] = {"Shortcut": shortcut_table}
# cx_freeze GUI applications require a different base on Windows (the default is for a
# console application).
executables=[
Executable(
"Pathomx.py",
base=base,
copyDependentFiles=True,
replacePaths=True,
#shortcutName="Pathomx",
#shortcutDir="ProgramMenuFolder",
)]
# Apply default build options to cx/py2app build targets
build_exe.update( default_build_options )
build_mac.update( default_build_options )
setup(
name='Pathomx',
version=__version__,
author='Martin Fitzpatrick',
author_email='martin.fitzpatrick@gmail.com',
url='https://github.com/pathomx/pathomx',
download_url='https://github.com/pathomx/pathomx/zipball/master',
description='Metabolic pathway visualisation and analysis.',
long_description='Pathomx is workflow-based scientific data processing, analysis and \
visualisation too. Built on IPython notebooks it allows rapid prototyping of \
analysis approaches, sharing of workflows and export of generated IPython notebooks \
that capture the approach. The included notebook tools are aimed towards the analysis of \
metabolomic data inlucindg: NMR data processing, integration with the BioCyc database, \
dynamic metabolic pathway drawing and support for GPML/KEGG.',
packages = find_packages(),
include_package_data = True,
package_data = {
'': ['*.txt', '*.rst', '*.md'],
},
exclude_package_data = { '': ['README.txt'] },
executables = executables,
entry_points={
'gui_scripts': [
'Pathomx = pathomx.Pathomx:main',
]
},
install_requires = [
#'PyQt5',
'numpy>=1.5.0',
'scipy>=0.14.0',
'pandas>=0.14.0',
'IPython>=2.0.0',
'matplotlib>=1.4.0',
'mplstyler',
'pyqtconfig',
'dill',
'scikit-learn',
'requests',
'yapsy',
],
install_recommends = [
'gpml2svg',
'icoshift',
'nmrglue',
'pydot',
'nmrglue',
'nmrglue.fileio.fileiobase',
],
keywords='bioinformatics data analysis metabolomics research science',
license='GPL',
classifiers=['Development Status :: 3 - Alpha',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Education',
'Intended Audience :: Science/Research',
'Intended Audience :: Education',
],
# cx_freeze/py2app settings for building the .app file
options={
"build_exe": build_exe,
"build_mac": build_mac,
"bdist_msi": bdist_msi,
},
)