[ARVADOS] updated: 1.1.3-317-g7278de8
Git user
git at public.curoverse.com
Wed Apr 4 16:57:56 EDT 2018
Summary of changes:
sdk/cwl/MANIFEST.in | 1 +
sdk/cwl/arvados_version.py | 46 +++++++++++++++++++++++++++++++------------
sdk/cwl/setup.py | 25 +++--------------------
sdk/python/MANIFEST.in | 1 +
sdk/python/arvados_version.py | 46 +++++++++++++++++++++++++++++++------------
sdk/python/setup.py | 24 +++-------------------
6 files changed, 74 insertions(+), 69 deletions(-)
via 7278de803df2021ddc185dda0cef1d565ab677ff (commit)
from 196cb2e84834de79f25414de09a8d00bbe1a5eae (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 7278de803df2021ddc185dda0cef1d565ab677ff
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Wed Apr 4 16:57:27 2018 -0400
13200: Consolidate package version behavior in arvados_version
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/sdk/cwl/MANIFEST.in b/sdk/cwl/MANIFEST.in
index d1388b3..50a2923 100644
--- a/sdk/cwl/MANIFEST.in
+++ b/sdk/cwl/MANIFEST.in
@@ -4,3 +4,4 @@
include LICENSE-2.0.txt
include README.rst
+include arvados_version.py
\ No newline at end of file
diff --git a/sdk/cwl/arvados_version.py b/sdk/cwl/arvados_version.py
index db46417..a24d53d 100644
--- a/sdk/cwl/arvados_version.py
+++ b/sdk/cwl/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/sdk/cwl/setup.py b/sdk/cwl/setup.py
index d67b5ed..aed96c6 100644
--- a/sdk/cwl/setup.py
+++ b/sdk/cwl/setup.py
@@ -3,36 +3,17 @@
#
# SPDX-License-Identifier: Apache-2.0
+from __future__ import absolute_import
import os
import sys
-import re
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__) or '.'
README = os.path.join(SETUP_DIR, 'README.rst')
-env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
-
-def save_version(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(module):
- with open(os.path.join(SETUP_DIR, module, "_version.py"), 'r') as fp:
- return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
-
-if env_version:
- save_version("arvados_cwl", env_version)
-else:
- try:
- import arvados_version
- vtag = arvados_version.VersionInfoFromGit()
- save_version("arvados_cwl", vtag.git_latest_tag() + vtag.git_timestamp_tag())
- except ImportError:
- pass
-
-version = read_version("arvados_cwl")
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados_cwl")
setup(name='arvados-cwl-runner',
version=version,
diff --git a/sdk/python/MANIFEST.in b/sdk/python/MANIFEST.in
index d1388b3..50a2923 100644
--- a/sdk/python/MANIFEST.in
+++ b/sdk/python/MANIFEST.in
@@ -4,3 +4,4 @@
include LICENSE-2.0.txt
include README.rst
+include arvados_version.py
\ No newline at end of file
diff --git a/sdk/python/arvados_version.py b/sdk/python/arvados_version.py
index db46417..a24d53d 100644
--- a/sdk/python/arvados_version.py
+++ b/sdk/python/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/sdk/python/setup.py b/sdk/python/setup.py
index a19b876..4f487af 100644
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
+from __future__ import absolute_import
import os
import sys
import re
@@ -12,27 +13,8 @@ from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__) or '.'
README = os.path.join(SETUP_DIR, 'README.rst')
-env_version = os.environ.get("ARVADOS_BUILDING_VERSION")
-
-def save_version(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(module):
- with open(os.path.join(SETUP_DIR, module, "_version.py"), 'r') as fp:
- return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
-
-if env_version:
- save_version("arvados", env_version)
-else:
- try:
- import arvados_version
- vtag = arvados_version.VersionInfoFromGit()
- save_version("arvados", vtag.git_latest_tag() + vtag.git_timestamp_tag())
- except ImportError:
- pass
-
-version = read_version("arvados")
+import arvados_version
+version = arvados_version.get_version(SETUP_DIR, "arvados")
short_tests_only = False
if '--short-tests-only' in sys.argv:
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list