Skip to content

Commit 1ed862d

Browse files
committed
Fix building version from VERSION file
1 parent 5a47ac4 commit 1ed862d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setuptools_git_versioning.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
132132
if line.startswith('Version:'):
133133
return line[8:].strip()
134134

135+
from_file = False
135136
tag = get_tag()
136137
if tag is None:
137138
if version_callback is not None:
@@ -143,6 +144,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
143144
if not os.path.exists(version_file):
144145
return starting_version
145146
else:
147+
from_file = True
146148
tag = read_version_from_file(version_file)
147149

148150
if not count_commits_from_version_file:
@@ -155,7 +157,7 @@ def version_from_git(template=DEFAULT_TEMPLATE,
155157
dirty = is_dirty()
156158
head_sha = get_sha()
157159
ccount = count_since(tag_sha)
158-
on_tag = head_sha == tag_sha
160+
on_tag = head_sha == tag_sha and not from_file
159161
branch = get_branch()
160162

161163
if dirty:

0 commit comments

Comments
 (0)