forked from DataBiosphere/toil
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
187 lines (176 loc) · 6.96 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
# Copyright (C) 2015-2021 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.
import imp
import os
from tempfile import NamedTemporaryFile
from setuptools import find_packages, setup
def run_setup():
"""
Calls setup(). This function exists so the setup() invocation preceded more internal
functionality. The `version` module is imported dynamically by import_version() below.
"""
boto = 'boto>=2.48.0, <3'
boto3 = 'boto3>=1.17, <2'
futures = 'futures>=3.1.1, <4'
pycryptodome = 'pycryptodome==3.5.1'
pymesos = 'pymesos==0.3.15'
psutil = 'psutil >= 3.0.1, <6'
pynacl = 'pynacl==1.3.0'
gcs = 'google-cloud-storage==1.6.0'
gcs_oauth2_boto_plugin = 'gcs_oauth2_boto_plugin==1.14'
apacheLibcloud = 'apache-libcloud==2.2.1'
rdflibJsonld = 'rdflib-jsonld @ git+https://github.com/mskcc/[email protected]'
cwltool = 'cwltool==3.0.20201203173111'
galaxyToolUtil = 'galaxy-tool-util'
htcondor = 'htcondor>=8.6.0'
kubernetes = 'kubernetes>=12.0.1, <13'
idna = 'idna>=2'
pytz = 'pytz>=2012'
pyyaml = 'pyyaml>=5, <6'
dill = 'dill>=0.3.2, <0.4'
requests = 'requests>=2, <3'
docker = 'docker==4.3.1'
dateutil = 'python-dateutil'
addict = 'addict>=2.2.1, <2.3'
enlighten = 'enlighten>=1.5.2, <2'
wdlparse = 'wdlparse==0.1.0'
core_reqs = [
dill,
requests,
docker,
dateutil,
psutil,
addict,
pytz,
pyyaml,
enlighten]
aws_reqs = [
boto,
boto3,
futures,
pycryptodome]
cwl_reqs = [
rdflibJsonld,
cwltool,
galaxyToolUtil]
encryption_reqs = [
pynacl]
google_reqs = [
gcs_oauth2_boto_plugin, # is this being used??
apacheLibcloud,
gcs]
htcondor_reqs = [
htcondor]
kubernetes_reqs = [
kubernetes,
idna] # Kubernetes's urllib3 can mange to use idna without really depending on it.
mesos_reqs = [
pymesos,
psutil]
wdl_reqs = [
wdlparse
]
# htcondor is not supported by apple
# this is tricky to conditionally support in 'all' due
# to how wheels work, so it is not included in all and
# must be explicitly installed as an extra
all_reqs = \
aws_reqs + \
cwl_reqs + \
encryption_reqs + \
google_reqs + \
kubernetes_reqs + \
mesos_reqs + \
wdl_reqs
setup(
name='toil',
version=version.distVersion,
description='Pipeline management software for clusters.',
author='Benedict Paten and the Toil community',
author_email='[email protected]',
url="https://github.com/DataBiosphere/toil",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Intended Audience :: Healthcare Industry',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Scientific/Engineering :: Medical Science Apps.',
'Topic :: System :: Distributed Computing',
'Topic :: Utilities'],
license="Apache License v2.0",
python_requires=">=3.6",
install_requires=core_reqs,
extras_require={
'aws': aws_reqs,
'cwl': cwl_reqs,
'encryption': encryption_reqs,
'google': google_reqs,
'htcondor:sys_platform!="darwin"': htcondor_reqs,
'kubernetes': kubernetes_reqs,
'mesos': mesos_reqs,
'wdl': wdl_reqs,
'all': all_reqs},
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 decorators:
exclude=['*.test.*']),
package_data={
'': ['*.yml', 'cloud-config'],
},
# 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:cwltoil_was_removed [cwl]',
'toil-cwl-runner = toil.cwl.cwltoil:main [cwl]',
'toil-wdl-runner = toil.wdl.toilwdl:main',
'_toil_mesos_executor = toil.batchSystems.mesos.executor:main [mesos]',
'_toil_kubernetes_executor = toil.batchSystems.kubernetes:executor [kubernetes]']})
def import_version():
"""Return the module object for src/toil/version.py, generate from the template if required."""
if not os.path.exists('src/toil/version.py'):
# Use the template to generate src/toil/version.py
import version_template
with NamedTemporaryFile(mode='w', dir='src/toil', prefix='version.py.', delete=False) as f:
f.write(version_template.expand_())
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.
#
# This is also the reason we cannot switch from the "deprecated" imp library
# and use:
# from importlib.machinery import SourceFileLoader
# return SourceFileLoader('toil.version', path='src/toil/version.py').load_module()
#
# Because SourceFileLoader will error and load "src/toil/__init__.py" .
return imp.load_source('toil.version', 'src/toil/version.py')
version = import_version()
run_setup()