10008: Merge branch 'master' into 10008-flaky-token-test
[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', SETUP_DIR]).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       # Make sure to update arvados/build/run-build-packages.sh as well
49       # when updating the cwltool version pin.
50       install_requires=[
51           'cwltool==1.0.20161007181528',
52           'arvados-python-client>=0.1.20160826210445'
53       ],
54       data_files=[
55           ('share/doc/arvados-cwl-runner', ['LICENSE-2.0.txt', 'README.rst']),
56       ],
57       test_suite='tests',
58       tests_require=['mock>=1.0'],
59       zip_safe=True,
60       cmdclass={'egg_info': tagger},
61       )