From c4f291e2a3d43621cefcd4771d9dd262b8c75cd1 Mon Sep 17 00:00:00 2001
From: Pavel Korshunov <pavel.korshunov@idiap.ch>
Date: Mon, 9 Apr 2018 15:43:49 +0200
Subject: [PATCH] better tags sorting, update help docs

---
 release/release_bob.py | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/release/release_bob.py b/release/release_bob.py
index 61591c6..098b21c 100755
--- a/release/release_bob.py
+++ b/release/release_bob.py
@@ -23,28 +23,28 @@ This script can also be used to release a single package.
 `IMPORTANT`: there are some considerations that needs to be taken
 into account **before** you release a new version of a package:
 
-  * In the changelog file, write the name of this package and write the last tag.
-    For the tag name, you can either indicate `patch` to `minor` or `major`,
-    and the package will be then released with either patch, minor, or major version bump.
-    Alternatively, you can specify the version name directly but be careful that it is higher
-    than the last release tag of this package.
-    Then, under the desired new tag version of the package, please write down the changes that are applied
-    to the package between the last released version and this version. This
-    changes are written to release tags of packages in the Gitlab interface.
-    For an example look at: https://gitlab.idiap.ch/bob/bob.extension/tags
+  * In the changelog file:
+    - write the name of this package and write the last tag.
+      For the tag name, you can either indicate `patch`, `minor` or `major`,
+      and the package will be then released with either patch, minor, or major version bump.
+    - Alternatively, you can specify the version name directly but be careful that it is higher
+      than the last release tag of this package.
+      Make sure that the version that you are trying to release is not already released.
+      Also, make sure you follow semantic versions: http://semver.org.
+    - Then, under the desired new tag version of the package, please write down the changes that are applied
+      to the package between the last released version and this version. This
+      changes are written to release tags of packages in the Gitlab interface.
+      For an example look at: https://gitlab.idiap.ch/bob/bob.extension/tags
   * Make sure all the tests for the package are passing.
   * Make sure the documentation is building with the following command:
     ``sphinx-build -aEWn doc sphinx``
+  * Make sure all changes are committed to the git repository and pushed.
   * Make sure the documentation badges in README.rst are pointing to:
     https://www.idiap.ch/software/bob/docs/bob/...
-  * Make sure all changes are committed to the git repository and pushed.
   * For database packages, make sure that the '.sql3' file or other
     metadata files have been generated (if any).
   * Make sure bob.nightlies is green after the changes are submitted if the
     package is a part of the nightlies.
-  * Make sure you follow semantic versions: http://semver.org
-  * Make sure that the `stable` version that you are trying to release is not
-    already released.
   * If your package depends on an unreleased version of another Bob package,
     you need to release that package first.
 
@@ -78,7 +78,7 @@ from docopt import docopt
 import gitlab
 import datetime
 import re
-from distutils.version import StrictVersion as Version
+from distutils.version import StrictVersion
 import numpy
 import time
 
@@ -122,8 +122,10 @@ def get_latest_tag_name(gitpkg):
         return None
     # create list of tags' names but ignore the first 'v' character in each name
     tag_names = [tag.name[1:] for tag in latest_tags]
+    print(tag_names)
     # sort them correctly according to each subversion number
-    tag_names.sort(key=lambda s: [int(u) for u in s.split('.')])
+    tag_names.sort(key=StrictVersion)
+    print(tag_names)
     # take the last one, as it is the latest tag in the sorted tags
     latest_tag_name = tag_names[-1]
     return latest_tag_name
-- 
GitLab