shithub: aubio

Download patch

ref: 87a4a5abea1a81d16ec54262c36c5ef7b9f759ca
parent: 7b9b6bae876dc6d0098c9f498f82511e6dc618dc
author: Paul Brossier <piem@piem.org>
date: Thu Mar 23 14:03:22 EDT 2017

this_version.py: build a valid pep440 version string

--- a/this_version.py
+++ b/this_version.py
@@ -76,14 +76,15 @@
 def get_aubio_pyversion(add_status=True):
     # convert to version for python according to pep 440
     # see https://www.python.org/dev/peps/pep-0440/
-    # outputs MAJ.MIN.PATCH+a0{.git<sha> , ''}
+    # outputs MAJ.MIN.PATCH[a0[+git.<sha>[.mods]]]
     vdict = get_version_info()
     verstr = '%s.%s.%s' % get_aubio_version_tuple()
     if add_status and vdict['AUBIO_VERSION_STATUS']:
-        if '~git' in vdict['AUBIO_VERSION_STATUS']:
-            verstr += "+a0." + vdict['AUBIO_VERSION_STATUS'][1:]
+        if vdict['AUBIO_VERSION_STATUS'].startswith('~git+'):
+            pep440str = vdict['AUBIO_VERSION_STATUS'].replace('+', '.')
+            verstr += pep440str.replace('~git.', 'a0+')
         elif '~alpha' in vdict['AUBIO_VERSION_STATUS']:
-            verstr += "+a0"
+            verstr += "a0"
         else:
             raise SystemError("Aubio version statut not supported : %s" %
                               vdict['AUBIO_VERSION_STATUS'])
--