diff --git a/setup.py b/setup.py index 33f4337b..47c06ad4 100755 --- a/setup.py +++ b/setup.py @@ -7,11 +7,11 @@ def get_version(): version = __version__ if os.path.exists('.git'): import subprocess - p = subprocess.Popen(['git','describe','--dirty'], + p = subprocess.Popen(['git','describe','--dirty','--match=v*'], stdout=subprocess.PIPE) result = p.communicate()[0] assert p.returncode == 0, 'git returned non-zero' - new_version = result.split()[0] + new_version = result.split()[0][1:] assert new_version.split('-')[0] == version, '__version__ must match the last git annotated tag' version = new_version.replace('-', '.') return version