From 87a4a5abea1a81d16ec54262c36c5ef7b9f759ca Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 23 Mar 2017 18:03:22 +0100 Subject: [PATCH] this_version.py: build a valid pep440 version string --- this_version.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/this_version.py b/this_version.py index 797ff4e7..d78c878d 100644 --- a/this_version.py +++ b/this_version.py @@ -76,14 +76,15 @@ def get_aubio_version(add_status=True): 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 , ''} + # outputs MAJ.MIN.PATCH[a0[+git.[.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']) -- 2.11.0