forked from DataBiosphere/toil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
118 lines (108 loc) · 4.48 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
# Copyright (C) 2015-2016 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from setuptools import find_packages, setup
botoRequirement = 'boto==2.38.0'
def runSetup():
"""
Calls setup(). This function exists so the setup() invocation preceded more internal
functionality. The `version` module is imported dynamically by importVersion() below.
"""
setup(
name='toil',
version=version.distVersion,
description='Pipeline management software for clusters.',
author='Benedict Paten',
author_email='benedict@soe.usc.edu',
url="https://github.com/BD2KGenomics/toil",
classifiers=["License :: OSI Approved :: Apache Software License"],
license="Apache License v2.0",
install_requires=[
'bd2k-python-lib>=1.14a1.dev35',
'dill==0.2.5',
'six>=1.10.0',
'future',
'docker==2.5.1'],
extras_require={
'mesos': [
'psutil==3.0.1'],
'aws': [
botoRequirement,
'futures==3.0.5',
'pycrypto==2.6.1'],
'azure': [
'azure==2.0.0',
'azure-cosmosdb-table==0.37.1'],
'encryption': [
'pynacl==1.1.2'],
'google': [
'gcs_oauth2_boto_plugin==1.9',
botoRequirement],
'cwl': [
'cwltool==1.0.20170822192924',
'schema-salad >= 2.6, < 3',
'galaxy-lib==17.9.3',
'cwltest>=1.0.20170214185319']},
package_dir={'': 'src'},
packages=find_packages(where='src',
# Note that we intentionally include the top-level `test` package for
# functionality like the @experimental and @integrative decoratorss:
exclude=['*.test.*']),
# Unfortunately, the names of the entry points are hard-coded elsewhere in the code base so
# you can't just change them here. Luckily, most of them are pretty unique strings, and thus
# easy to search for.
entry_points={
'console_scripts': [
'toil = toil.utils.toilMain:main',
'_toil_worker = toil.worker:main',
'cwltoil = toil.cwl.cwltoil:main [cwl]',
'toil-cwl-runner = toil.cwl.cwltoil:main [cwl]',
'cwl-runner = toil.cwl.cwltoil:main [cwl]',
'_toil_mesos_executor = toil.batchSystems.mesos.executor:main [mesos]']})
def importVersion():
"""
Load and return the module object for src/toil/version.py, generating it from the template if
required.
"""
import imp
try:
# Attempt to load the template first. It only exists in a working copy cloned via git.
import version_template
except ImportError:
# If loading the template fails we must be in a unpacked source distribution and
# src/toil/version.py will already exist.
pass
else:
# Use the template to generate src/toil/version.py
import os
import errno
from tempfile import NamedTemporaryFile
new = version_template.expand_()
try:
with open('src/toil/version.py') as f:
old = f.read()
except IOError as e:
if e.errno == errno.ENOENT:
old = None
else:
raise
if old != new:
with NamedTemporaryFile(dir='src/toil', prefix='version.py.', delete=False) as f:
f.write(new)
os.rename(f.name, 'src/toil/version.py')
# Unfortunately, we can't use a straight import here because that would also load the stuff
# defined in src/toil/__init__.py which imports modules from external dependencies that may
# yet to be installed when setup.py is invoked.
return imp.load_source('toil.version', 'src/toil/version.py')
version = importVersion()
runSetup()