Fix crunch script to construct toolpath before it is turned into a File object. refs...
[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.20161227200419',
52           'schema-salad==2.1.20161227191302',
53           'ruamel.yaml==0.13.7',
54           'arvados-python-client>=0.1.20160826210445',
55           'setuptools'
56       ],
57       data_files=[
58           ('share/doc/arvados-cwl-runner', ['LICENSE-2.0.txt', 'README.rst']),
59       ],
60       test_suite='tests',
61       tests_require=['mock>=1.0'],
62       zip_safe=True,
63       cmdclass={'egg_info': tagger},
64       )