setup.py: manage only tag starting v
This commit is contained in:
parent
add3ea00c3
commit
d009115d63
4
setup.py
4
setup.py
|
@ -7,11 +7,11 @@ def get_version():
|
||||||
version = __version__
|
version = __version__
|
||||||
if os.path.exists('.git'):
|
if os.path.exists('.git'):
|
||||||
import subprocess
|
import subprocess
|
||||||
p = subprocess.Popen(['git','describe','--dirty'],
|
p = subprocess.Popen(['git','describe','--dirty','--match=v*'],
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
result = p.communicate()[0]
|
result = p.communicate()[0]
|
||||||
assert p.returncode == 0, 'git returned non-zero'
|
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'
|
assert new_version.split('-')[0] == version, '__version__ must match the last git annotated tag'
|
||||||
version = new_version.replace('-', '.')
|
version = new_version.replace('-', '.')
|
||||||
return version
|
return version
|
||||||
|
|
Reference in New Issue