11857: arvados-cwl-runner defaults to crunch2 if available
[arvados.git] / sdk / cwl / setup.py
1 #!/usr/bin/env python
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 import os
7 import sys
8 import subprocess
9 import setuptools.command.egg_info as egg_info_cmd
10
11 from setuptools import setup, find_packages
12
13 SETUP_DIR = os.path.dirname(__file__) or '.'
14 README = os.path.join(SETUP_DIR, 'README.rst')
15
16 try:
17     import gittaggers
18     tagger = gittaggers.EggInfoFromGit
19 except ImportError:
20     tagger = egg_info_cmd.egg_info
21
22 versionfile = os.path.join(SETUP_DIR, "arvados_cwl/_version.py")
23 try:
24     gitinfo = subprocess.check_output(
25         ['git', 'log', '--first-parent', '--max-count=1',
26          '--format=format:%H', gittaggers.choose_version_from()]).strip()
27     with open(versionfile, "w") as f:
28         f.write("__version__ = '%s'\n" % gitinfo)
29 except Exception as e:
30     # When installing from package, it won't be part of a git repository, and
31     # check_output() will raise an exception.  But the package should include the
32     # version file, so we can proceed.
33     if not os.path.exists(versionfile):
34         raise
35
36 setup(name='arvados-cwl-runner',
37       version='1.0',
38       description='Arvados Common Workflow Language runner',
39       long_description=open(README).read(),
40       author='Arvados',
41       author_email='info@arvados.org',
42       url="https://arvados.org",
43       download_url="https://github.com/curoverse/arvados.git",
44       license='Apache 2.0',
45       packages=find_packages(),
46       package_data={'arvados_cwl': ['arv-cwl-schema.yml']},
47       scripts=[
48           'bin/cwl-runner',
49           'bin/arvados-cwl-runner'
50       ],
51       # Note that arvados/build/run-build-packages.sh looks at this
52       # file to determine what version of cwltool and schema-salad to build.
53       install_requires=[
54           'cwltool==1.0.20170525215327',
55           'schema-salad==2.5.20170428142041',
56           'typing==3.5.3.0',
57           'ruamel.yaml==0.13.7',
58           'arvados-python-client>=0.1.20170526013812',
59           'setuptools',
60           'ciso8601'
61       ],
62       data_files=[
63           ('share/doc/arvados-cwl-runner', ['LICENSE-2.0.txt', 'README.rst']),
64       ],
65       test_suite='tests',
66       tests_require=['mock>=1.0'],
67       zip_safe=True,
68       cmdclass={'egg_info': tagger},
69       )