X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/060d38d627bd1e51dd2b3c6e7de9af6aa7d7b6f3..8f4b1051209f78bff358069a2a3b2f646f7a38f8:/sdk/python/gittaggers.py diff --git a/sdk/python/gittaggers.py b/sdk/python/gittaggers.py index da73634cbf..ccf25c422e 100644 --- a/sdk/python/gittaggers.py +++ b/sdk/python/gittaggers.py @@ -12,6 +12,11 @@ class EggInfoFromGit(egg_info): 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): + 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', @@ -20,5 +25,5 @@ class EggInfoFromGit(egg_info): def tags(self): if self.tag_build is None: - self.tag_build = self.git_timestamp_tag() + self.tag_build = self.git_latest_tag()+self.git_timestamp_tag() return egg_info.tags(self)