[ARVADOS] updated: 1.1.3-318-gc334c1a

Git user git at public.curoverse.com
Wed Apr 4 17:42:17 EDT 2018


Summary of changes:
 sdk/pam/MANIFEST.in                         |  1 +
 sdk/{python => pam}/arvados_version.py      |  0
 sdk/pam/setup.py                            | 22 +++++++-------
 services/dockercleaner/MANIFEST.in          |  1 +
 services/dockercleaner/arvados_version.py   | 46 +++++++++++++++++++++--------
 services/dockercleaner/setup.py             | 25 ++++++++--------
 services/fuse/MANIFEST.in                   |  1 +
 services/fuse/arvados_version.py            | 46 +++++++++++++++++++++--------
 services/fuse/setup.py                      | 19 ++++--------
 services/nodemanager/MANIFEST.in            |  1 +
 services/nodemanager/arvados_version.py     | 46 +++++++++++++++++++++--------
 services/nodemanager/setup.py               | 23 +++++++--------
 tools/crunchstat-summary/MANIFEST.in        |  1 +
 tools/crunchstat-summary/arvados_version.py | 46 +++++++++++++++++++++--------
 tools/crunchstat-summary/setup.py           | 22 +++++++-------
 15 files changed, 186 insertions(+), 114 deletions(-)
 copy sdk/{python => pam}/arvados_version.py (100%)

       via  c334c1a486114024ed22bfb88a1aa79dc1d99772 (commit)
      from  7278de803df2021ddc185dda0cef1d565ab677ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c334c1a486114024ed22bfb88a1aa79dc1d99772
Author: Fernando Monserrat <fernando.monserrat at gmail.com>
Date:   Wed Apr 4 18:42:08 2018 -0300

    13200: Consolidate package version behavior in arvados_version for all the python packages
    Arvados-DCO-1.1-Signed-off-by: Fernando Monserrat <fmonserrat at veritasgenetics.com>

diff --git a/sdk/pam/MANIFEST.in b/sdk/pam/MANIFEST.in
index 553d1a5..48892fa 100644
--- a/sdk/pam/MANIFEST.in
+++ b/sdk/pam/MANIFEST.in
@@ -7,3 +7,4 @@ include README.rst
 include examples/shellinabox
 include lib/libpam_arvados.py
 include pam-configs/arvados
+include arvados_version.py
\ No newline at end of file
diff --git a/sdk/pam/arvados_version.py b/sdk/pam/arvados_version.py
new file mode 100644
index 0000000..a24d53d
--- /dev/null
+++ b/sdk/pam/arvados_version.py
@@ -0,0 +1,40 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import subprocess
+import time
+import os
+import re
+
+def git_latest_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'describe', '--abbrev=0']).strip()
+    return str(gitinfo.decode('utf-8'))
+
+def git_timestamp_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', '.']).strip()
+    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+
+def save_version(setup_dir, module, v):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+      return fp.write("__version__ = '%s'\n" % v)
+
+def read_version(setup_dir, module):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+      return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
+
+def get_version(setup_dir, module):
+    env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
+
+    if env_version:
+        save_version(setup_dir, module, env_version)
+    else:
+        try:
+            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+        except subprocess.CalledProcessError:
+            pass
+
+    return read_version(setup_dir, module)
diff --git a/sdk/pam/setup.py b/sdk/pam/setup.py
index 35ed082..23f2331 100755
--- a/sdk/pam/setup.py
+++ b/sdk/pam/setup.py
@@ -3,10 +3,11 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 
+from __future__ import absolute_import
 import glob
 import os
 import sys
-import setuptools.command.egg_info as egg_info_cmd
+import re
 import subprocess
 
 from setuptools import setup, find_packages
@@ -14,15 +15,13 @@ from setuptools import setup, find_packages
 SETUP_DIR = os.path.dirname(__file__) or '.'
 README = os.path.join(SETUP_DIR, 'README.rst')
 
-tagger = egg_info_cmd.egg_info
-version = os.environ.get("ARVADOS_BUILDING_VERSION")
-if not version:
-    version = "0.1"
-    try:
-        import gittaggers
-        tagger = gittaggers.EggInfoFromGit
-    except ImportError:
-        pass
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados")
+
+short_tests_only = False
+if '--short-tests-only' in sys.argv:
+    short_tests_only = True
+    sys.argv.remove('--short-tests-only')
 
 setup(name='arvados-pam',
       version=version,
@@ -56,6 +55,5 @@ setup(name='arvados-pam',
       ],
       test_suite='tests',
       tests_require=['pbr<1.7.0', 'mock>=1.0', 'python-pam'],
-      zip_safe=False,
-      cmdclass={'egg_info': tagger},
+      zip_safe=False
       )
diff --git a/services/dockercleaner/MANIFEST.in b/services/dockercleaner/MANIFEST.in
index 2a14fab..5d510b4 100644
--- a/services/dockercleaner/MANIFEST.in
+++ b/services/dockercleaner/MANIFEST.in
@@ -4,3 +4,4 @@
 
 include agpl-3.0.txt
 include arvados-docker-cleaner.service
+include arvados_version.py
\ No newline at end of file
diff --git a/services/dockercleaner/arvados_version.py b/services/dockercleaner/arvados_version.py
index db46417..a24d53d 100644
--- a/services/dockercleaner/arvados_version.py
+++ b/services/dockercleaner/arvados_version.py
@@ -4,17 +4,37 @@
 
 import subprocess
 import time
+import os
+import re
 
-class VersionInfoFromGit():
-    """Return arvados version from git
-    """
-    def git_latest_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'describe', '--abbrev=0']).strip()
-        return str(gitinfo.decode('utf-8'))
-
-    def git_timestamp_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'log', '--first-parent', '--max-count=1',
-             '--format=format:%ct', '.']).strip()
-        return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_latest_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'describe', '--abbrev=0']).strip()
+    return str(gitinfo.decode('utf-8'))
+
+def git_timestamp_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', '.']).strip()
+    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+
+def save_version(setup_dir, module, v):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+      return fp.write("__version__ = '%s'\n" % v)
+
+def read_version(setup_dir, module):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+      return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
+
+def get_version(setup_dir, module):
+    env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
+
+    if env_version:
+        save_version(setup_dir, module, env_version)
+    else:
+        try:
+            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+        except subprocess.CalledProcessError:
+            pass
+
+    return read_version(setup_dir, module)
diff --git a/services/dockercleaner/setup.py b/services/dockercleaner/setup.py
index b287bd0..ebc88b7 100644
--- a/services/dockercleaner/setup.py
+++ b/services/dockercleaner/setup.py
@@ -3,21 +3,23 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import os
 import sys
-import setuptools.command.egg_info as egg_info_cmd
+import re
 
 from setuptools import setup, find_packages
 
-tagger = egg_info_cmd.egg_info
-version = os.environ.get("ARVADOS_BUILDING_VERSION")
-if not version:
-    try:
-        import arvados_version
-        vtag = arvados_version.VersionInfoFromGit()
-        version = vtag.git_latest_tag() + vtag.git_timestamp_tag()
-    except ImportError:
-        pass
+SETUP_DIR = os.path.dirname(__file__) or '.'
+README = os.path.join(SETUP_DIR, 'README.rst')
+
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados")
+
+short_tests_only = False
+if '--short-tests-only' in sys.argv:
+    short_tests_only = True
+    sys.argv.remove('--short-tests-only')
 
 setup(name="arvados-docker-cleaner",
       version=version,
@@ -43,6 +45,5 @@ setup(name="arvados-docker-cleaner",
           'mock',
       ],
       test_suite='tests',
-      zip_safe=False,
-      cmdclass={'egg_info': tagger},
+      zip_safe=False
 )
diff --git a/services/fuse/MANIFEST.in b/services/fuse/MANIFEST.in
index 5692a68..7322a0a 100644
--- a/services/fuse/MANIFEST.in
+++ b/services/fuse/MANIFEST.in
@@ -4,3 +4,4 @@
 
 include agpl-3.0.txt
 include README.rst
+include arvados_version.py
\ No newline at end of file
diff --git a/services/fuse/arvados_version.py b/services/fuse/arvados_version.py
index db46417..a24d53d 100644
--- a/services/fuse/arvados_version.py
+++ b/services/fuse/arvados_version.py
@@ -4,17 +4,37 @@
 
 import subprocess
 import time
+import os
+import re
 
-class VersionInfoFromGit():
-    """Return arvados version from git
-    """
-    def git_latest_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'describe', '--abbrev=0']).strip()
-        return str(gitinfo.decode('utf-8'))
-
-    def git_timestamp_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'log', '--first-parent', '--max-count=1',
-             '--format=format:%ct', '.']).strip()
-        return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_latest_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'describe', '--abbrev=0']).strip()
+    return str(gitinfo.decode('utf-8'))
+
+def git_timestamp_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', '.']).strip()
+    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+
+def save_version(setup_dir, module, v):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+      return fp.write("__version__ = '%s'\n" % v)
+
+def read_version(setup_dir, module):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+      return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
+
+def get_version(setup_dir, module):
+    env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
+
+    if env_version:
+        save_version(setup_dir, module, env_version)
+    else:
+        try:
+            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+        except subprocess.CalledProcessError:
+            pass
+
+    return read_version(setup_dir, module)
diff --git a/services/fuse/setup.py b/services/fuse/setup.py
index 8bc1131..d3c5033 100644
--- a/services/fuse/setup.py
+++ b/services/fuse/setup.py
@@ -3,25 +3,19 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import os
 import sys
-import setuptools.command.egg_info as egg_info_cmd
+import re
 
 from setuptools import setup, find_packages
 
 SETUP_DIR = os.path.dirname(__file__) or '.'
 README = os.path.join(SETUP_DIR, 'README.rst')
 
-tagger = egg_info_cmd.egg_info
-version = os.environ.get("ARVADOS_BUILDING_VERSION")
-if not version:
-    try:
-        import arvados_version
-        vtag = arvados_version.VersionInfoFromGit()
-        version = vtag.git_latest_tag() + vtag.git_timestamp_tag()
-    except ImportError:
-        pass
-        
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados")
+
 short_tests_only = False
 if '--short-tests-only' in sys.argv:
     short_tests_only = True
@@ -52,6 +46,5 @@ setup(name='arvados_fuse',
         ],
       test_suite='tests',
       tests_require=['pbr<1.7.0', 'mock>=1.0', 'PyYAML'],
-      zip_safe=False,
-      cmdclass={'egg_info': tagger},
+      zip_safe=False
       )
diff --git a/services/nodemanager/MANIFEST.in b/services/nodemanager/MANIFEST.in
index 5692a68..7322a0a 100644
--- a/services/nodemanager/MANIFEST.in
+++ b/services/nodemanager/MANIFEST.in
@@ -4,3 +4,4 @@
 
 include agpl-3.0.txt
 include README.rst
+include arvados_version.py
\ No newline at end of file
diff --git a/services/nodemanager/arvados_version.py b/services/nodemanager/arvados_version.py
index db46417..a24d53d 100644
--- a/services/nodemanager/arvados_version.py
+++ b/services/nodemanager/arvados_version.py
@@ -4,17 +4,37 @@
 
 import subprocess
 import time
+import os
+import re
 
-class VersionInfoFromGit():
-    """Return arvados version from git
-    """
-    def git_latest_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'describe', '--abbrev=0']).strip()
-        return str(gitinfo.decode('utf-8'))
-
-    def git_timestamp_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'log', '--first-parent', '--max-count=1',
-             '--format=format:%ct', '.']).strip()
-        return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_latest_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'describe', '--abbrev=0']).strip()
+    return str(gitinfo.decode('utf-8'))
+
+def git_timestamp_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', '.']).strip()
+    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+
+def save_version(setup_dir, module, v):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+      return fp.write("__version__ = '%s'\n" % v)
+
+def read_version(setup_dir, module):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+      return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
+
+def get_version(setup_dir, module):
+    env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
+
+    if env_version:
+        save_version(setup_dir, module, env_version)
+    else:
+        try:
+            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+        except subprocess.CalledProcessError:
+            pass
+
+    return read_version(setup_dir, module)
diff --git a/services/nodemanager/setup.py b/services/nodemanager/setup.py
index 9ae1135..b472c88 100644
--- a/services/nodemanager/setup.py
+++ b/services/nodemanager/setup.py
@@ -3,25 +3,23 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import os
 import sys
-import setuptools.command.egg_info as egg_info_cmd
+import re
 
 from setuptools import setup, find_packages
 
-SETUP_DIR = os.path.dirname(__file__) or "."
+SETUP_DIR = os.path.dirname(__file__) or '.'
 README = os.path.join(SETUP_DIR, 'README.rst')
 
-tagger = egg_info_cmd.egg_info
-version = os.environ.get("ARVADOS_BUILDING_VERSION")
-if not version:
-    try:
-        import arvados_version
-        vtag = arvados_version.VersionInfoFromGit()
-        version = vtag.git_latest_tag() + vtag.git_timestamp_tag()
-    except ImportError:
-        pass
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados")
 
+short_tests_only = False
+if '--short-tests-only' in sys.argv:
+    short_tests_only = True
+    sys.argv.remove('--short-tests-only')
 
 setup(name='arvados-node-manager',
       version=version,
@@ -51,6 +49,5 @@ setup(name='arvados-node-manager',
           'mock>=1.0',
           'apache-libcloud>=2.3',
       ],
-      zip_safe=False,
-      cmdclass={'egg_info': tagger},
+      zip_safe=False
       )
diff --git a/tools/crunchstat-summary/MANIFEST.in b/tools/crunchstat-summary/MANIFEST.in
index d1c3037..764a473 100644
--- a/tools/crunchstat-summary/MANIFEST.in
+++ b/tools/crunchstat-summary/MANIFEST.in
@@ -5,3 +5,4 @@
 include agpl-3.0.txt
 include crunchstat_summary/dygraphs.js
 include crunchstat_summary/synchronizer.js
+include arvados_version.py
\ No newline at end of file
diff --git a/tools/crunchstat-summary/arvados_version.py b/tools/crunchstat-summary/arvados_version.py
index db46417..a24d53d 100644
--- a/tools/crunchstat-summary/arvados_version.py
+++ b/tools/crunchstat-summary/arvados_version.py
@@ -4,17 +4,37 @@
 
 import subprocess
 import time
+import os
+import re
 
-class VersionInfoFromGit():
-    """Return arvados version from git
-    """
-    def git_latest_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'describe', '--abbrev=0']).strip()
-        return str(gitinfo.decode('utf-8'))
-
-    def git_timestamp_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'log', '--first-parent', '--max-count=1',
-             '--format=format:%ct', '.']).strip()
-        return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_latest_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'describe', '--abbrev=0']).strip()
+    return str(gitinfo.decode('utf-8'))
+
+def git_timestamp_tag():
+    gitinfo = subprocess.check_output(
+        ['git', 'log', '--first-parent', '--max-count=1',
+         '--format=format:%ct', '.']).strip()
+    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+
+def save_version(setup_dir, module, v):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+      return fp.write("__version__ = '%s'\n" % v)
+
+def read_version(setup_dir, module):
+  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+      return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
+
+def get_version(setup_dir, module):
+    env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
+
+    if env_version:
+        save_version(setup_dir, module, env_version)
+    else:
+        try:
+            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+        except subprocess.CalledProcessError:
+            pass
+
+    return read_version(setup_dir, module)
diff --git a/tools/crunchstat-summary/setup.py b/tools/crunchstat-summary/setup.py
index 0965fae..6cd22b1 100755
--- a/tools/crunchstat-summary/setup.py
+++ b/tools/crunchstat-summary/setup.py
@@ -3,24 +3,23 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+from __future__ import absolute_import
 import os
 import sys
-import setuptools.command.egg_info as egg_info_cmd
+import re
 
 from setuptools import setup, find_packages
 
 SETUP_DIR = os.path.dirname(__file__) or '.'
+README = os.path.join(SETUP_DIR, 'README.rst')
 
-tagger = egg_info_cmd.egg_info
-version = os.environ.get("ARVADOS_BUILDING_VERSION")
-if not version:
-    try:
-        import arvados_version
-        vtag = arvados_version.VersionInfoFromGit()
-        version = vtag.git_latest_tag() + vtag.git_timestamp_tag()
-    except ImportError:
-        pass
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados")
 
+short_tests_only = False
+if '--short-tests-only' in sys.argv:
+    short_tests_only = True
+    sys.argv.remove('--short-tests-only')
 
 setup(name='crunchstat_summary',
       version=version,
@@ -43,6 +42,5 @@ setup(name='crunchstat_summary',
       ],
       test_suite='tests',
       tests_require=['pbr<1.7.0', 'mock>=1.0'],
-      zip_safe=False,
-      cmdclass={'egg_info': tagger},
+      zip_safe=False
       )

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list