Merge branch '10467-client-disconnect' refs #10467
[arvados.git] / sdk / cwl / setup.py
index 43cae78a9ad05bb9d4ba0a4e54837af4f18e0c9f..7751644f51795e60271759287290381919f3dc4d 100644 (file)
@@ -2,6 +2,7 @@
 
 import os
 import sys
+import subprocess
 import setuptools.command.egg_info as egg_info_cmd
 
 from setuptools import setup, find_packages
@@ -15,6 +16,20 @@ try:
 except ImportError:
     tagger = egg_info_cmd.egg_info
 
+versionfile = os.path.join(SETUP_DIR, "arvados_cwl/_version.py")
+try:
+    gitinfo = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%H', gittaggers.choose_version_from()]).strip()
+    with open(versionfile, "w") as f:
+        f.write("__version__ = '%s'\n" % gitinfo)
+except Exception as e:
+    # When installing from package, it won't be part of a git repository, and
+    # check_output() will raise an exception.  But the package should include the
+    # version file, so we can proceed.
+    if not os.path.exists(versionfile):
+        raise
+
 setup(name='arvados-cwl-runner',
       version='1.0',
       description='Arvados Common Workflow Language runner',
@@ -33,7 +48,7 @@ setup(name='arvados-cwl-runner',
       # Make sure to update arvados/build/run-build-packages.sh as well
       # when updating the cwltool version pin.
       install_requires=[
-          'cwltool==1.0.20161007181528',
+          'cwltool==1.0.20161128202906',
           'arvados-python-client>=0.1.20160826210445'
       ],
       data_files=[