diff --git a/setup.py b/setup.py index ec7f1628aada2..d66ac345aa61a 100755 --- a/setup.py +++ b/setup.py @@ -189,7 +189,7 @@ def build_extensions(self): MAJOR = 0 MINOR = 12 MICRO = 0 -ISRELEASED = True +ISRELEASED = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) QUALIFIER = '' @@ -199,19 +199,20 @@ def build_extensions(self): try: import subprocess try: - pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"], + pipe = subprocess.Popen(["git", "describe", "HEAD"], stdout=subprocess.PIPE).stdout except OSError: # msysgit compatibility pipe = subprocess.Popen( - ["git.cmd", "rev-parse", "--short", "HEAD"], + ["git.cmd", "describe", "HEAD"], stdout=subprocess.PIPE).stdout rev = pipe.read().strip() # makes distutils blow up on Python 2.7 if sys.version_info[0] >= 3: rev = rev.decode('ascii') - FULLVERSION += "-%s" % rev + FULLVERSION = rev.lstrip('v') + except: warnings.warn("WARNING: Couldn't get git revision") else: