Skip to content

Commit

Permalink
Fix building version from VERSION file
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Sep 14, 2020
1 parent 5a47ac4 commit 1ed862d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setuptools_git_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
if line.startswith('Version:'):
return line[8:].strip()

from_file = False
tag = get_tag()
if tag is None:
if version_callback is not None:
Expand All @@ -143,6 +144,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
if not os.path.exists(version_file):
return starting_version
else:
from_file = True
tag = read_version_from_file(version_file)

if not count_commits_from_version_file:
Expand All @@ -155,7 +157,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
dirty = is_dirty()
head_sha = get_sha()
ccount = count_since(tag_sha)
on_tag = head_sha == tag_sha
on_tag = head_sha == tag_sha and not from_file
branch = get_branch()

if dirty:
Expand Down

0 comments on commit 1ed862d

Please sign in to comment.