Skip to content

Commit

Permalink
Fix bug in setting version from git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-kotliar committed Jul 1, 2019
1 parent 1d95a8c commit 607da69
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@


def get_git_tag():
return subprocess.check_output(['git', 'describe', '--contains']).strip()
return subprocess.check_output(['git', 'describe', '--contains'], text=True).split("^")[0].strip()


def get_git_timestamp():
gitinfo = subprocess.check_output(
['git', 'log', '--first-parent', '--max-count=1',
'--format=format:%ct', '.']).strip()
['git', 'log', '--first-parent', '--max-count=1', '--format=format:%ct', '.'], text=True).strip()
return time.strftime('%Y%m%d%H%M%S', time.gmtime(int(gitinfo)))


Expand Down

0 comments on commit 607da69

Please sign in to comment.