Skip to content

Commit

Permalink
Fix making dev version for release tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jan 30, 2022
1 parent 1d9ecb6 commit a0ae2eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions glue/python/overwrite_dev_version_with_date.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#########################################################
# Sets version numbers to a date-based dev version.
#
# Does nothing if not on a dev version.
#########################################################
# Example usage (from repo root):
#
Expand All @@ -22,6 +24,8 @@ def main():
with open('setup.py') as f:
maj_min_version_line, = [line for line in f.read().splitlines() if re.match("^version = '[^']+'", line)]
maj_version, min_version, patch = maj_min_version_line.split()[-1].strip("'").split('.')
if 'dev' not in patch:
return # Do nothing for non-dev versions.
timestamp = subprocess.check_output(['git', 'show', '-s', '--format=%ct', 'HEAD']).decode().strip()
new_version = f"{maj_version}.{min_version}.dev{timestamp}"

Expand Down

0 comments on commit a0ae2eb

Please sign in to comment.