Changeset 1eb8c0e
- Timestamp:
- Mar 13, 2017, 5:10:55 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 8259e09
- Parents:
- 67b6618
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/moresetuptools.py
r67b6618 r1eb8c0e 32 32 AUBIO_PATCH_VERSION])) 33 33 34 if AUBIO_VERSION_STATUS is not None: 34 AUBIO_GIT_SHA = get_git_revision_hash() 35 """ append sha to version in alpha release 36 """ 37 if '~alpha' in AUBIO_VERSION_STATUS : 38 if AUBIO_GIT_SHA: 39 AUBIO_VERSION_STATUS = '~git'+AUBIO_GIT_SHA 40 if AUBIO_VERSION_STATUS is not None : 35 41 verstr += AUBIO_VERSION_STATUS 36 42 return verstr … … 40 46 # see https://www.python.org/dev/peps/pep-0440/ 41 47 verstr = get_aubio_version() 42 if '~alpha' in verstr: 43 verstr = verstr.split('~')[0] + 'a1' 48 if '~alpha' in verstr or '~git' in verstr: 49 verstr = verstr.split('~')[0] + '+a1' 50 gitsha = get_git_revision_hash(short=True) 51 if gitsha: 52 verstr+='.git.'+gitsha 44 53 # TODO: add rc, .dev, and .post suffixes, add numbering 45 54 return verstr 55 56 57 58 def get_git_revision_hash( short=True): 59 def which(program): 60 61 def is_exe(fpath): 62 return os.path.isfile(fpath) and os.access(fpath, os.X_OK) 63 64 fpath, fname = os.path.split(program) 65 if fpath: 66 if is_exe(program): 67 return program 68 else: 69 for path in os.environ["PATH"].split(os.pathsep): 70 path = path.strip('"') 71 exe_file = os.path.join(path, program) 72 if is_exe(exe_file): 73 return exe_file 74 75 return None 76 if not which('git'): 77 print 'no git found on this system : can\'t get sha' 78 return "" 79 80 import subprocess 81 this_file_dir = os.path.dirname(os.path.abspath(__file__)) 82 aubio_dir = os.path.join(this_file_dir, '..', '..') 83 aubio_dir = os.path.abspath(aubio_dir) 84 if not os.path.exists(aubio_dir): 85 raise SystemError("git / root folder not found") 86 gitcmd = ['git','-C',aubio_dir ,'rev-parse'] 87 if short: 88 gitcmd.append('--short') 89 gitcmd.append('HEAD') 90 return subprocess.check_output(gitcmd).strip() 46 91 47 92 # inspired from https://gist.github.com/abergmeier/9488990 -
setup.py
r67b6618 r1eb8c0e 7 7 from python.lib.gen_external import generate_external, header, output_path 8 8 9 __version__ = get_aubio_pyversion() 9 __version__ = get_aubio_version() 10 __pip_version__ = get_aubio_pyversion() 10 11 11 12 include_dirs = [] … … 55 56 56 57 distrib = setup(name='aubio', 57 version = __ version__,58 version = __pip_version__, 58 59 packages = ['aubio'], 59 60 package_dir = {'aubio':'python/lib/aubio'}, -
src/wscript_build
r67b6618 r1eb8c0e 47 47 # install headers, except _priv.h ones 48 48 ctx.install_files('${INCLUDEDIR}/aubio/', 49 ctx.path.ant_glob('**/*.h', excl = ['**_priv.h' , 'config.h']),49 ctx.path.ant_glob('**/*.h', excl = ['**_priv.h']), 50 50 relative_trick=True) -
wscript
r67b6618 r1eb8c0e 17 17 # source VERSION 18 18 for l in open('VERSION').readlines(): exec (l.strip()) 19 20 def get_git_revision_hash( short=True): 21 import os 22 def which(program): 23 def is_exe(fpath): 24 return os.path.isfile(fpath) and os.access(fpath, os.X_OK) 25 26 fpath, fname = os.path.split(program) 27 if fpath: 28 if is_exe(program): 29 return program 30 else: 31 for path in os.environ["PATH"].split(os.pathsep): 32 path = path.strip('"') 33 exe_file = os.path.join(path, program) 34 if is_exe(exe_file): 35 return exe_file 36 37 return None 38 39 if not which('git'): 40 print 'no git found on this system : can\'t get sha' 41 return "" 42 43 import subprocess 44 aubio_dir = os.path.abspath(os.curdir) 45 if not os.path.exists(aubio_dir): 46 raise SystemError("git / root folder not found") 47 gitcmd = ['git','-C',aubio_dir ,'rev-parse'] 48 if short: 49 gitcmd.append('--short') 50 gitcmd.append('HEAD') 51 return subprocess.check_output(gitcmd).strip() 52 53 AUBIO_GIT_SHA = get_git_revision_hash() 54 """ append sha to version in alpha release 55 """ 56 if '~alpha' in AUBIO_VERSION_STATUS : 57 if AUBIO_GIT_SHA: 58 AUBIO_VERSION_STATUS = '~git'+AUBIO_GIT_SHA 59 60 61 19 62 20 63 VERSION = '.'.join ([str(x) for x in [ … … 132 175 ctx.env['DEST_OS'] = target_platform 133 176 177 ctx.define('AUBIO_VERSION',VERSION) 178 ctx.define('AUBIO_MAJOR_VERSION',AUBIO_MAJOR_VERSION) 179 ctx.define('AUBIO_MINOR_VERSION',AUBIO_MINOR_VERSION) 180 ctx.define('AUBIO_PATCH_VERSION',AUBIO_PATCH_VERSION) 181 ctx.define('AUBIO_VERSION_STATUS',AUBIO_VERSION_STATUS) 182 ctx.define('AUBIO_GIT_SHA',AUBIO_GIT_SHA) 134 183 if ctx.options.build_type == "debug": 135 184 ctx.define('DEBUG', 1)
Note: See TracChangeset
for help on using the changeset viewer.