Skip to content

Commit

Permalink
fixed __version__ to be pypi compatible for git tag
Browse files Browse the repository at this point in the history
	modified:   setup.py
  • Loading branch information
VCHui committed Nov 29, 2017
1 parent 6924793 commit 27fea57
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

def getversion():
"return the pypi version convention of git describe"
describe = subprocess.check_output('git describe --abbrev=1 HEAD'.split())
tag,ncommit = describe.decode().strip().split("-")[:2]
if ncommit == 0:
return tag
return tag + '.post' + ncommit
describes = subprocess.check_output('git describe --abbrev=1 HEAD'.split())
describes = describes.decode().strip().split("-")
if len(describes) == 1:
return describes[0]
return '.post'.join(describes[:-1])


def suite():
Expand Down

0 comments on commit 27fea57

Please sign in to comment.