[ARVADOS] created: 2.1.0-98-g469f6863e

Git user git at public.arvados.org
Tue Nov 17 14:53:14 UTC 2020


        at  469f6863e7f7bfe8bb04385959f0f28ff2a63d5c (commit)


commit 469f6863e7f7bfe8bb04385959f0f28ff2a63d5c
Author: Ward Vandewege <ward at curii.com>
Date:   Tue Nov 17 09:52:53 2020 -0500

    17012: remove old gittaggers.py files.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/sdk/cwl/gittaggers.py b/sdk/cwl/gittaggers.py
deleted file mode 100644
index d6a4c24a7..000000000
--- a/sdk/cwl/gittaggers.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) The Arvados Authors. All rights reserved.
-#
-# SPDX-License-Identifier: Apache-2.0
-
-from builtins import str
-from builtins import next
-
-from setuptools.command.egg_info import egg_info
-import subprocess
-import time
-import os
-
-SETUP_DIR = os.path.dirname(__file__) or '.'
-
-def choose_version_from():
-    sdk_ts = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', os.path.join(SETUP_DIR, "../python")]).strip()
-    cwl_ts = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', SETUP_DIR]).strip()
-    if int(sdk_ts) > int(cwl_ts):
-        getver = os.path.join(SETUP_DIR, "../python")
-    else:
-        getver = SETUP_DIR
-    return getver
-
-class EggInfoFromGit(egg_info):
-    """Tag the build with git commit timestamp.
-
-    If a build tag has already been set (e.g., "egg_info -b", building
-    from source package), leave it alone.
-    """
-    def git_latest_tag(self):
-        gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-        gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-        return str(next(iter(gittags)).decode('utf-8'))
-
-    def git_timestamp_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'log', '--first-parent', '--max-count=1',
-             '--format=format:%ct', choose_version_from()]).strip()
-        return time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo)))
-
-    def tags(self):
-        if self.tag_build is None:
-            self.tag_build = self.git_latest_tag() + self.git_timestamp_tag()
-        return egg_info.tags(self)
diff --git a/sdk/python/gittaggers.py b/sdk/python/gittaggers.py
deleted file mode 100644
index f3278fcc1..000000000
--- a/sdk/python/gittaggers.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) The Arvados Authors. All rights reserved.
-#
-# SPDX-License-Identifier: Apache-2.0
-
-from setuptools.command.egg_info import egg_info
-import subprocess
-import time
-
-class EggInfoFromGit(egg_info):
-    """Tag the build with git commit timestamp.
-
-    If a build tag has already been set (e.g., "egg_info -b", building
-    from source package), leave it alone.
-    """
-    def git_latest_tag(self):
-        gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-        gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-        return str(next(iter(gittags)).decode('utf-8'))
-
-    def git_timestamp_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'log', '--first-parent', '--max-count=1',
-             '--format=format:%ct', '.']).strip()
-        return time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo)))
-
-    def tags(self):
-        if self.tag_build is None:
-            self.tag_build = self.git_latest_tag()+self.git_timestamp_tag()
-        return egg_info.tags(self)
diff --git a/services/dockercleaner/gittaggers.py b/services/dockercleaner/gittaggers.py
deleted file mode 120000
index a9ad861d8..000000000
--- a/services/dockercleaner/gittaggers.py
+++ /dev/null
@@ -1 +0,0 @@
-../../sdk/python/gittaggers.py
\ No newline at end of file
diff --git a/services/fuse/gittaggers.py b/services/fuse/gittaggers.py
deleted file mode 120000
index a9ad861d8..000000000
--- a/services/fuse/gittaggers.py
+++ /dev/null
@@ -1 +0,0 @@
-../../sdk/python/gittaggers.py
\ No newline at end of file
diff --git a/tools/crunchstat-summary/gittaggers.py b/tools/crunchstat-summary/gittaggers.py
deleted file mode 120000
index a9ad861d8..000000000
--- a/tools/crunchstat-summary/gittaggers.py
+++ /dev/null
@@ -1 +0,0 @@
-../../sdk/python/gittaggers.py
\ No newline at end of file

commit e5083f90b6990ab67720b5e56c31765778bc58d7
Author: Ward Vandewege <ward at curii.com>
Date:   Mon Nov 16 15:08:26 2020 -0500

    17012: when calculating the version of our Python packages, take the
           build directory into account.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/sdk/cwl/arvados_version.py b/sdk/cwl/arvados_version.py
index d5f48c066..4bfd3fc7e 100644
--- a/sdk/cwl/arvados_version.py
+++ b/sdk/cwl/arvados_version.py
@@ -13,11 +13,17 @@ def choose_version_from():
     sdk_ts = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
          '--format=format:%ct', os.path.join(SETUP_DIR, "../python")]).strip()
-    cwl_ts = subprocess.check_output(
+    build_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")]).strip()
+    this_ts = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
          '--format=format:%ct', SETUP_DIR]).strip()
-    if int(sdk_ts) > int(cwl_ts):
+    m = max(int(sdk_ts),int(build_ts),int(this_ts))
+    if m == int(sdk_ts):
         getver = os.path.join(SETUP_DIR, "../python")
+    elif m == int(build_ts):
+        getver = os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")
     else:
         getver = SETUP_DIR
     return getver
@@ -26,7 +32,7 @@ def git_version_at_commit():
     curdir = choose_version_from()
     myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
                                        '--format=%H', curdir]).strip()
-    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    myversion = subprocess.check_output([SETUP_DIR+'/../../build/version-at-commit.sh', myhash]).strip().decode()
     return myversion
 
 def save_version(setup_dir, module, v):
@@ -46,7 +52,8 @@ def get_version(setup_dir, module):
     else:
         try:
             save_version(setup_dir, module, git_version_at_commit())
-        except (subprocess.CalledProcessError, OSError):
+        except (subprocess.CalledProcessError, OSError) as err:
+            print("ERROR: {0}".format(err))
             pass
 
     return read_version(setup_dir, module)
diff --git a/sdk/python/arvados_version.py b/sdk/python/arvados_version.py
index 36804bf5b..3d06095d0 100644
--- a/sdk/python/arvados_version.py
+++ b/sdk/python/arvados_version.py
@@ -7,11 +7,29 @@ import time
 import os
 import re
 
+SETUP_DIR = os.path.dirname(os.path.abspath(__file__))
+
+def choose_version_from():
+    sdk_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', SETUP_DIR]).strip()
+    build_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")]).strip()
+    m = max(int(sdk_ts),int(build_ts))
+    if m == int(sdk_ts):
+        getver = SETUP_DIR
+        print("SDK")
+    else:
+        getver = os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")
+        print("BUILD")
+    return getver
+
 def git_version_at_commit():
-    curdir = os.path.dirname(os.path.abspath(__file__))
+    curdir = choose_version_from()
     myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
                                        '--format=%H', curdir]).strip()
-    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    myversion = subprocess.check_output([SETUP_DIR+'/../../build/version-at-commit.sh', myhash]).strip().decode()
     return myversion
 
 def save_version(setup_dir, module, v):
@@ -31,7 +49,8 @@ def get_version(setup_dir, module):
     else:
         try:
             save_version(setup_dir, module, git_version_at_commit())
-        except (subprocess.CalledProcessError, OSError):
+        except (subprocess.CalledProcessError, OSError) as err:
+            print("ERROR: {0}".format(err))
             pass
 
     return read_version(setup_dir, module)
diff --git a/services/dockercleaner/arvados_version.py b/services/dockercleaner/arvados_version.py
index 36804bf5b..88eb13bde 100644
--- a/services/dockercleaner/arvados_version.py
+++ b/services/dockercleaner/arvados_version.py
@@ -7,11 +7,25 @@ import time
 import os
 import re
 
+def choose_version_from():
+    build_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")]).strip()
+    this_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', SETUP_DIR]).strip()
+    m = max(int(build_ts),int(this_ts))
+    if m == int(build_ts):
+        getver = os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")
+    else:
+        getver = SETUP_DIR
+    return getver
+
 def git_version_at_commit():
-    curdir = os.path.dirname(os.path.abspath(__file__))
+    curdir = choose_version_from()
     myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
                                        '--format=%H', curdir]).strip()
-    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    myversion = subprocess.check_output([SETUP_DIR+'/../../build/version-at-commit.sh', myhash]).strip().decode()
     return myversion
 
 def save_version(setup_dir, module, v):
@@ -31,7 +45,8 @@ def get_version(setup_dir, module):
     else:
         try:
             save_version(setup_dir, module, git_version_at_commit())
-        except (subprocess.CalledProcessError, OSError):
+        except (subprocess.CalledProcessError, OSError) as err:
+            print("ERROR: {0}".format(err))
             pass
 
     return read_version(setup_dir, module)
diff --git a/services/fuse/arvados_version.py b/services/fuse/arvados_version.py
index 0d307c1be..df80a6425 100644
--- a/services/fuse/arvados_version.py
+++ b/services/fuse/arvados_version.py
@@ -13,11 +13,17 @@ def choose_version_from():
     sdk_ts = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
          '--format=format:%ct', os.path.join(SETUP_DIR, "../../sdk/python")]).strip()
-    cwl_ts = subprocess.check_output(
+    build_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")]).strip()
+    this_ts = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
          '--format=format:%ct', SETUP_DIR]).strip()
-    if int(sdk_ts) > int(cwl_ts):
+    m = max(int(sdk_ts),int(build_ts),int(this_ts))
+    if m == int(sdk_ts):
         getver = os.path.join(SETUP_DIR, "../../sdk/python")
+    elif m == int(build_ts):
+        getver = os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")
     else:
         getver = SETUP_DIR
     return getver
@@ -26,7 +32,7 @@ def git_version_at_commit():
     curdir = choose_version_from()
     myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
                                        '--format=%H', curdir]).strip()
-    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    myversion = subprocess.check_output([SETUP_DIR+'/../../build/version-at-commit.sh', myhash]).strip().decode()
     return myversion
 
 def save_version(setup_dir, module, v):
@@ -46,7 +52,8 @@ def get_version(setup_dir, module):
     else:
         try:
             save_version(setup_dir, module, git_version_at_commit())
-        except (subprocess.CalledProcessError, OSError):
+        except (subprocess.CalledProcessError, OSError) as err:
+            print("ERROR: {0}".format(err))
             pass
 
     return read_version(setup_dir, module)
diff --git a/tools/crunchstat-summary/arvados_version.py b/tools/crunchstat-summary/arvados_version.py
index 0d307c1be..b54d89915 100644
--- a/tools/crunchstat-summary/arvados_version.py
+++ b/tools/crunchstat-summary/arvados_version.py
@@ -13,20 +13,27 @@ def choose_version_from():
     sdk_ts = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
          '--format=format:%ct', os.path.join(SETUP_DIR, "../../sdk/python")]).strip()
-    cwl_ts = subprocess.check_output(
+    build_ts = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")]).strip()
+    this_ts = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
          '--format=format:%ct', SETUP_DIR]).strip()
-    if int(sdk_ts) > int(cwl_ts):
-        getver = os.path.join(SETUP_DIR, "../../sdk/python")
+    m = max(int(sdk_ts),int(build_ts),int(this_ts))
+    if m == int(sdk_ts):
+        getver = os.path.join(SETUP_DIR, "../python")
+    elif m == int(build_ts):
+        getver = os.path.join(SETUP_DIR, "../../build/version-at-commit.sh")
     else:
         getver = SETUP_DIR
     return getver
 
+
 def git_version_at_commit():
     curdir = choose_version_from()
     myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
                                        '--format=%H', curdir]).strip()
-    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    myversion = subprocess.check_output([SETUP_DIR+'/../../build/version-at-commit.sh', myhash]).strip().decode()
     return myversion
 
 def save_version(setup_dir, module, v):
@@ -46,7 +53,8 @@ def get_version(setup_dir, module):
     else:
         try:
             save_version(setup_dir, module, git_version_at_commit())
-        except (subprocess.CalledProcessError, OSError):
+        except (subprocess.CalledProcessError, OSError) as err:
+            print("ERROR: {0}".format(err))
             pass
 
     return read_version(setup_dir, module)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list