From: Paul Brossier Date: Thu, 23 Mar 2017 17:03:22 +0000 (+0100) Subject: this_version.py: build a valid pep440 version string X-Git-Tag: 0.4.5~45^2~9 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=87a4a5abea1a81d16ec54262c36c5ef7b9f759ca;p=aubio.git this_version.py: build a valid pep440 version string --- 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'])