Skip to content

Commit 2743575

Browse files
committed
Calculate the suffix in one place.
1 parent 421fa88 commit 2743575

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setuptools_scm/version.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ def guess_next_version(tag_version, distance):
9292
if '.dev' in version:
9393
prefix, tail = version.rsplit('.dev', 1)
9494
assert tail == '0', 'own dev numbers are unsupported'
95-
return '%s.dev%s' % (prefix, distance)
9695
else:
9796
prefix, tail = re.match('(.*?)(\d+)$', version).groups()
98-
return '%s%d.dev%s' % (prefix, int(tail) + 1, distance)
97+
prefix = '%s%d' % (prefix, int(tail) + 1)
98+
suffix = '.dev%s' % distance
99+
return prefix + suffix
99100

100101

101102
def guess_next_dev_version(version):

0 commit comments

Comments
 (0)