From 79ef3b359300e5e57df1ad4c73359d5135fe85cc Mon Sep 17 00:00:00 2001 From: Martin Hermant Date: Mon, 13 Mar 2017 17:48:53 +0100 Subject: [PATCH] hide AUBIO_GIT_SHA in release fix py3 syntax error --- python/lib/moresetuptools.py | 4 +++- wscript | 15 +++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/python/lib/moresetuptools.py b/python/lib/moresetuptools.py index 5fdf43c0..97d1aa3d 100644 --- a/python/lib/moresetuptools.py +++ b/python/lib/moresetuptools.py @@ -31,12 +31,14 @@ def get_aubio_version(): AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION])) - AUBIO_GIT_SHA = get_git_revision_hash() + # append sha to version in alpha release # MAJ.MIN.PATCH.{~git , ''} if '~alpha' in AUBIO_VERSION_STATUS : + AUBIO_GIT_SHA = get_git_revision_hash() if AUBIO_GIT_SHA: AUBIO_VERSION_STATUS = '~git'+AUBIO_GIT_SHA + if AUBIO_VERSION_STATUS is not None : verstr += AUBIO_VERSION_STATUS return verstr diff --git a/wscript b/wscript index f939ca44..2c9f7904 100644 --- a/wscript +++ b/wscript @@ -33,9 +33,8 @@ def get_git_revision_hash( short=True): exe_file = os.path.join(path, program) if is_exe(exe_file): return exe_file - return None - + if not which('git'): print('no git found on this system : can\'t get sha') return "" @@ -48,12 +47,12 @@ def get_git_revision_hash( short=True): if short: gitcmd.append('--short') gitcmd.append('HEAD') - return subprocess.check_output(gitcmd).strip() + return str(subprocess.check_output(gitcmd).strip()) + -AUBIO_GIT_SHA = get_git_revision_hash() -""" append sha to version in alpha release -""" -if '~alpha' in AUBIO_VERSION_STATUS : +# append sha to version in alpha release +if AUBIO_VERSION_STATUS and '~alpha' in AUBIO_VERSION_STATUS : + AUBIO_GIT_SHA = get_git_revision_hash() if AUBIO_GIT_SHA: AUBIO_VERSION_STATUS = '~git'+AUBIO_GIT_SHA @@ -179,7 +178,7 @@ def configure(ctx): ctx.define('AUBIO_MINOR_VERSION',AUBIO_MINOR_VERSION) ctx.define('AUBIO_PATCH_VERSION',AUBIO_PATCH_VERSION) ctx.define('AUBIO_VERSION_STATUS',AUBIO_VERSION_STATUS) - ctx.define('AUBIO_GIT_SHA',AUBIO_GIT_SHA) + # ctx.define('AUBIO_GIT_SHA',AUBIO_GIT_SHA) if ctx.options.build_type == "debug": ctx.define('DEBUG', 1) else: -- 2.11.0