Skip to content

Commit a0ae2eb

Browse files
committed
Fix making dev version for release tags
1 parent 1d9ecb6 commit a0ae2eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

glue/python/overwrite_dev_version_with_date.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#########################################################
22
# Sets version numbers to a date-based dev version.
3+
#
4+
# Does nothing if not on a dev version.
35
#########################################################
46
# Example usage (from repo root):
57
#
@@ -22,6 +24,8 @@ def main():
2224
with open('setup.py') as f:
2325
maj_min_version_line, = [line for line in f.read().splitlines() if re.match("^version = '[^']+'", line)]
2426
maj_version, min_version, patch = maj_min_version_line.split()[-1].strip("'").split('.')
27+
if 'dev' not in patch:
28+
return # Do nothing for non-dev versions.
2529
timestamp = subprocess.check_output(['git', 'show', '-s', '--format=%ct', 'HEAD']).decode().strip()
2630
new_version = f"{maj_version}.{min_version}.dev{timestamp}"
2731

0 commit comments

Comments
 (0)