Skip to content

Commit

Permalink
Ignore git-tag version on non tagged commits
Browse files Browse the repository at this point in the history
Our version reporting is a little brittle for non-released installs from
git: If there is no tag (yet), but the intended version maintained in
`setup.py::version` is higher than the latest available tag, the version
description will be incorrect.

With this commit, we ignore the tag part on un-tagged git commits, which
allows for a better version resolution, especially during CI (i.e. PRs
for a version bump).
  • Loading branch information
konradkonrad committed Sep 8, 2017
1 parent 1091427 commit 634e3a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def read_version_from_git():
spec, _, commit = git_version.split('-')
if commit.startswith('g'):
commit = commit[1:]
return '{}+git.r{}'.format(spec, commit)
return '{}+git.r{}'.format(version, commit)
elif git_version.count('.') == 2:
return git_version
else:
Expand Down

0 comments on commit 634e3a8

Please sign in to comment.