diff --git a/.ci-helpers/get_current_version.py b/.ci-helpers/get_current_version.py index e1e67ec653f..35aad413593 100644 --- a/.ci-helpers/get_current_version.py +++ b/.ci-helpers/get_current_version.py @@ -2,7 +2,6 @@ import sys from setuptools_scm import version_from_scm -from setuptools_scm.version import guess_next_date_ver version = version_from_scm(".").tag.public diff --git a/.ci-helpers/get_next_version.py b/.ci-helpers/get_next_version.py index 89bdf3cea35..497ac2107ce 100644 --- a/.ci-helpers/get_next_version.py +++ b/.ci-helpers/get_next_version.py @@ -1,12 +1,22 @@ #!/usr/bin/env python import sys +from datetime import date from setuptools_scm import version_from_scm from setuptools_scm.version import guess_next_date_ver -version = version_from_scm(".").tag.public -version = guess_next_date_ver(version) +scm_version = version_from_scm(".").tag.public +scm_version = guess_next_date_ver(scm_version) +scm_version = [ int(i) for i in scm_version.split(".") ] + +build = scm_version[3] +release = scm_version[0:3] +iso_date = date(*release).isoformat() +iso_date = iso_date.replace("-",".") + +version = f"{iso_date}.{str(build)}" version = version.rstrip(".0") if version.endswith(".0") else version print(version) + sys.exit(0)