forked from SwissDataScienceCenter/renku-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
290 lines (254 loc) · 8.28 KB
/
setup.py
File metadata and controls
290 lines (254 loc) · 8.28 KB
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# -*- coding: utf-8 -*-
#
# Copyright 2017-2020 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# 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.
"""Python SDK and CLI for the Renku platform."""
import os
import shutil
from pathlib import Path
from tempfile import TemporaryDirectory
from setuptools import Command, find_packages, setup
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.build_py import build_py as _build_py
from setuptools.command.develop import develop as _develop
URL = 'https://github.com/SwissDataScienceCenter/renku-project-template'
REFERENCE = '0.1.11'
class DownloadTemplates(Command):
description = 'Download renku repository templates'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
from renku.core.commands.init import fetch_template, \
read_template_manifest
with TemporaryDirectory() as tempdir:
# download and extract template data
temppath = Path(tempdir)
print('downloading Renku templates...')
fetch_template(URL, REFERENCE, temppath)
read_template_manifest(temppath, checkout=True)
# copy templates
current_path = Path.cwd()
template_path = current_path / 'renku' / 'templates'
if template_path.exists():
shutil.rmtree(str(template_path))
shutil.copytree(
str(temppath),
str(template_path),
ignore=shutil.ignore_patterns('.git')
)
class bdist_egg(_bdist_egg):
def run(self):
self.run_command('DownloadTemplates')
_bdist_egg.run(self)
class build_ext(_build_ext):
def run(self):
self.run_command('DownloadTemplates')
_build_ext.run(self)
class build_py(_build_py):
def run(self):
self.run_command('DownloadTemplates')
_build_py.run(self)
class develop(_develop):
def run(self):
self.run_command('DownloadTemplates')
_develop.run(self)
readme = open('README.rst').read()
history = open('CHANGES.rst').read()
tests_require = [
'black>=19.10b0',
'check-manifest>=0.37',
'coverage>=4.5.3',
'fakeredis==1.4.1',
'flake8>=3.5,<3.8',
'flaky==3.6.1',
'freezegun>=0.3.12',
'isort==4.3.21',
'six>=1.13.0',
'pydocstyle>=3.0.0',
'pytest-cache>=1.0',
'pytest-cov>=2.5.1',
'pytest-flake8>=1.0.4',
'pytest-timeout>=1.3.4',
'pytest-pep8>=1.0.6',
'pytest>=4.0.0',
'responses>=0.7.0',
'unify>=0.4',
]
extras_require = {
'docs': [
'Jinja2>=2.10.1',
'Sphinx>=1.6.3',
'renku-sphinx-theme>=0.1.0',
],
'runner': ['cwlref-runner>=1.0', ],
'notebook': [],
'sentry': ['sentry-sdk>=0.7.4', ],
'tests': tests_require,
}
setup_requires = [
'pytest-runner>=2.6.2',
'setuptools_scm>=3.1.0',
]
extras_require['all'] = list(setup_requires)
for name, reqs in extras_require.items():
if name.startswith(':'):
continue
extras_require['all'].extend(reqs)
extras_require['nodocs'] = list(setup_requires)
for name, reqs in extras_require.items():
if name.startswith(':') or name == 'docs':
continue
extras_require['nodocs'].extend(reqs)
install_requires = [
'appdirs>=1.4.3',
'apispec==3.3.1',
'attrs>=19.3.0',
'calamus>=0.2.0',
'click-completion>=0.5.0',
'click>=7.0',
'cryptography>=2.7',
'cwlgen>=0.4.0',
'cwltool==3.0.20200530110633',
'environ_config>=18.2.0',
'filelock>=3.0.0',
'flask==1.1.2',
'flask-apispec==0.9.0',
'flask-swagger-ui==3.25.0',
'gitdb2==3.0.1',
'gitpython==3.1.0',
'humanize==2.4.1',
'jinja2>=2.10.3',
'pathspec>=0.7.0',
'patool>=1.12',
'pluggy>=0.13.1',
'psutil>=5.4.7',
'pyasn1>=0.4.5',
'PyYAML>=3.12',
'pyld>=2.0.2',
'pyOpenSSL>=19.0.0',
'pyshacl>=0.11.3.post1',
'python-dateutil>=2.6.1',
'python-editor>=1.0.4',
'redis==3.5.3',
'rdflib==4.2.2',
'rdflib-jsonld>=0.4.0,<0.5.0',
'requests>=2.21.0',
'rq==1.4.3',
'rq-scheduler==0.10.0',
'ndg-httpsclient>=0.5.1',
'marshmallow==3.6.1',
'idna==2.10',
'setuptools_scm>=3.1.0',
'tabulate>=0.7.7',
'tqdm==4.47.0',
'walrus>=0.8.0',
'wcmatch>=6.0.0',
'werkzeug>=0.15.5',
]
complete_setup_requires = list(set(install_requires + setup_requires))
packages = find_packages()
version_template = """\
# -*- coding: utf-8 -*-
#
# Copyright 2017-%d - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# 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.
\"\"\"Version information for Renku.\"\"\"
__version__ = {version!r}
def _get_disribution_url():
try:
import pkg_resources
d = pkg_resources.get_distribution('renku')
metadata = d._get_metadata(d.PKG_INFO)
home_page = [m for m in metadata if m.startswith('Home-page:')]
return home_page[0].split(':', 1)[1].strip()
except Exception:
return 'N/A'
version_url = '{{}}/tree/{{}}'.format(_get_disribution_url(), 'v' + __version__)
"""
setup(
name='renku',
use_scm_version={
'local_scheme': 'dirty-tag',
'write_to': os.path.join('renku', 'version.py'),
'write_to_template': version_template,
},
description=__doc__,
long_description=readme + '\n\n' + history,
long_description_content_type='text/x-rst',
keywords='Renku CLI',
license='Apache License 2.0',
author='Swiss Data Science Center',
author_email='contact@datascience.ch',
url='https://github.com/swissdatasciencecenter/renku-python',
project_urls={
'Changelog': (
'https://github.com/swissdatasciencecenter/renku-python'
'/blob/master/CHANGES.rst'
),
'Docs': 'https://renku-python.rtfd.io/',
},
packages=packages,
zip_safe=False,
include_package_data=True,
platforms='any',
entry_points={
'console_scripts': ['renku=renku.cli:cli'],
},
extras_require=extras_require,
install_requires=install_requires,
setup_requires=complete_setup_requires,
tests_require=tests_require,
cmdclass={
'bdist_egg': bdist_egg,
'build_py': build_py,
'build_ext': build_ext,
'develop': develop,
'DownloadTemplates': DownloadTemplates,
},
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Development Status :: 4 - Beta',
],
)