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