This repository has been archived by the owner on Jun 27, 2018. It is now read-only.
forked from gc3pie/gc3pie
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·263 lines (241 loc) · 8.55 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#!/usr/bin/env python
"""
Setup file for installing GC3Pie.
"""
import sys
# ensure we run a "recent enough" version of `setuptools` (CentOS7 still ships
# with setuptools 0.9.8!). There has been some instability in the support for
# PEP-496 environment markers in recent versions of `setuptools`, but
# Setuptools 20.10.0 seems to have restored full support for them, including
# `python_implementation`
from ez_setup import use_setuptools
use_setuptools(version='21.0.0')
import setuptools
import setuptools.dist
# avoid setuptools including `.svn` directories into the PyPI package
from setuptools.command import sdist
try:
del sdist.finders[:]
except AttributeError:
# `.finders` was removed from setuptools long ago
pass
## auxiliary functions
#
def read_whole_file(path):
"""
Return file contents as a string.
"""
with open(path, 'r') as stream:
return stream.read()
## test runner setup
#
# See http://tox.readthedocs.org/en/latest/example/basic.html#integration-with-setuptools-distribute-test-commands # noqa
# on how to run tox when python setup.py test is run
#
from setuptools.command.test import test as TestCommand
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import tox
errno = tox.cmdline(self.test_args)
sys.exit(errno)
## conditional dependencies
#
# Although PEP-508 and a number of predecessors specify a syntax for
# conditional dependencies in Python packages, support for it is inconsistent
# (at best) among the PyPA tools. An attempt to use the conditional syntax has
# already caused issues #308, #249, #227, and many more headaches to me while
# trying to find a combination of `pip`, `setuptools`, `wheel`, and dependency
# specification syntax that would work reliably across all supported Linux
# distributions. I give up, and revert to computing the dependencies via
# explicit Python code in `setup.py`; this will possibly break wheels but it's
# the least damage I can do ATM.
python_version = sys.version_info[:2]
if python_version == (2, 6):
openstack_requires = [
# None, GC3Pie's OpenStack support on Python 2.6 ceased during
# the release cycle leading to version 2.5
]
elif python_version == (2, 7):
openstack_requires = [
# The following Python modules are required by GC3Pie's `openstack`
# backend. Since OpenStack ceased support for Python 2.6 around
# version 3.0.0 of the client libraries, we have to include separate
# dependecy lists for Python 2.7+ and Python 2.6
'python-novaclient',
'os-client-config',
]
else:
raise RuntimeError("GC3Pie requires Python 2.6 or 2.7")
## real setup description begins here
#
setuptools.setup(
name="gc3pie",
version="2.5.dev", # see PEP 440
packages=setuptools.find_packages(exclude=['ez_setup']),
# metadata for upload to PyPI
description=(
"A Python library and simple command-line frontend for"
" computational job submission to multiple resources."
),
long_description=read_whole_file('README.rst'),
author="S3IT, Zentrale Informatik, University of Zurich",
author_email="[email protected]",
license="LGPL",
keywords=str.join(' ', [
"batch",
"cloud",
"cluster",
"differential optimization",
"ec2",
"gridengine",
"job management",
"large-scale data analysis",
"openstack",
"pbs",
"remote execution",
"sge",
"slurm",
"ssh",
"torque",
"workflow",
]),
url="http://gc3pie.googlecode.com/", # project home page
# see http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU Library or"
" Lesser General Public License (LGPL)",
"License :: DFSG approved",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: System :: Distributed Computing",
],
entry_points={
'console_scripts': [
# the generic, catch-all script:
'gc3utils = gc3utils.frontend:main',
# entry points to specific subcommands:
'gclean = gc3utils.frontend:main',
'gget = gc3utils.frontend:main',
'ginfo = gc3utils.frontend:main',
'gkill = gc3utils.frontend:main',
'gservers = gc3utils.frontend:main',
'gresub = gc3utils.frontend:main',
'gstat = gc3utils.frontend:main',
'gsub = gc3utils.frontend:main',
'gtail = gc3utils.frontend:main',
'gsession = gc3utils.frontend:main',
'gselect = gc3utils.frontend:main',
'gcloud = gc3utils.frontend:main',
],
},
# run-time dependencies
install_requires=[
'coloredlogs',
'dictproxyhack',
# paramiko and pycrypto are required for SSH operations
'paramiko',
'pycrypto',
# prettytable -- format tabular text output
'prettytable',
# pyCLI -- object-oriented command-line app programming
'pyCLI',
# Needed by SqlStore
'sqlalchemy',
# Needed for parsing human-readable dates (gselect uses it).
'parsedatetime',
# Needed by `gc3libs.cmdline`
'python-daemon',
'pyyaml',
# needed by DependentTaskCollection
# (but incompatible with Py 2.6, so we include a patched copy)
#toposort==1.0
],
extras_require={
'ec2': [
# The following Python modules are required by GC3Pie's `ec2`
# resource backend.
'boto',
],
'daemon': [
# daemon and inotifyx required for SessionBasedDaemon
# but `inotifyx` only works on Linux, so this is an
# optional feature ...
'inotifyx',
],
'openstack': openstack_requires,
'optimizer': [
# The following Python modules are required by GC3Pie's
# `gc3libs.optimizer` module.
'numpy',
],
},
# Apparently, this list is read from right to left...
tests_require=[
'tox', 'pytest', 'mock',
],
cmdclass={'test': Tox},
# additional non-Python files to be bundled in the package
package_data={
'gc3libs': [
# helper scripts for classes in the core library
'etc/codeml.pl',
'etc/rosetta.sh',
'etc/run_R.sh',
'etc/turbomole.sh',
'etc/run_matlab.sh',
# Downloader script
'etc/downloader.py',
# example files
'etc/gc3pie.conf.example',
'etc/logging.conf.example',
'etc/minibacct.c',
# helper scripts for specific gc3apps
'etc/gbenchmark_infomap_wrapper.sh',
'etc/gbenchmark_wrapper.sh',
'etc/gbenchmark_wrapper_allinone.py',
'etc/gcelljunction_wrapper.sh',
'etc/geosphere_wrapper.sh',
'etc/geotop_wrap.sh',
'etc/geotop_wrap.sh',
'etc/gmodis_wrapper.sh',
'etc/gndn_wrapper.sh',
'etc/gnfs-cmd',
'etc/gnlp_wrapper.py',
'etc/gpyrad_wrapper.sh',
'etc/grdock_wrapper.sh',
'etc/gstructure_wrapper.sh',
'etc/gweight_wrap.sh',
'etc/gwrappermc_wrapper.sh',
'etc/run_gtsub_control.sh',
'etc/smd_projections_wrapper.sh',
'etc/square.sh',
],
},
data_files=[
('gc3apps', [
'gc3apps/gc3.uzh.ch/gridrun.py',
'gc3apps/codeml/gcodeml.py',
'gc3apps/gamess/grundb.py',
'gc3apps/gamess/ggamess.py',
]),
],
# `zip_safe` can ease deployment, but is only allowed if the package
# do *not* do any __file__/__path__ magic nor do they access package data
# files by file name (use `pkg_resources` instead).
zip_safe=True,
)