setup.py: produce PEP440 compatible version when repositoty is dirty
This commit is contained in:
parent
7199504489
commit
cf8a95af50
2
setup.py
2
setup.py
|
@ -98,6 +98,8 @@ def get_version():
|
||||||
if '-' in result: # not a tagged version
|
if '-' in result: # not a tagged version
|
||||||
real_number, commit_count, commit_hash = result.split('-', 2)
|
real_number, commit_count, commit_hash = result.split('-', 2)
|
||||||
version = '%s.post%s+%s' % (real_number, commit_count, commit_hash)
|
version = '%s.post%s+%s' % (real_number, commit_count, commit_hash)
|
||||||
|
elif result.endswith('.dirty'):
|
||||||
|
version = result[:-6] + '+dirty'
|
||||||
else:
|
else:
|
||||||
version = result
|
version = result
|
||||||
return version
|
return version
|
||||||
|
|
Loading…
Reference in New Issue