17012: when calculating the version of our Python packages, take the
[arvados.git] / sdk / python / gittaggers.py
index 4e848eda36d22f8fb35232ced1b9acd174a17acc..f3278fcc1d5e7aeab1f6748f90bc80040e6fce37 100644 (file)
@@ -13,9 +13,9 @@ class EggInfoFromGit(egg_info):
     from source package), leave it alone.
     """
     def git_latest_tag(self):
-        gitinfo = subprocess.check_output(
-            ['git', 'describe', '--abbrev=0']).strip()
-        return str(gitinfo)
+        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(