From 6c2f344c6717ed8c99bb5873265d800397935f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Sat, 30 Apr 2022 10:53:10 -0300 Subject: [PATCH 1/3] Force fixed number of digits in version date --- .ci-helpers/get_next_version.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci-helpers/get_next_version.py b/.ci-helpers/get_next_version.py index 89bdf3cea35..38801e824fe 100644 --- a/.ci-helpers/get_next_version.py +++ b/.ci-helpers/get_next_version.py @@ -6,7 +6,13 @@ version = version_from_scm(".").tag.public version = guess_next_date_ver(version) + version = version.rstrip(".0") if version.endswith(".0") else version +version = version.split(".") + +version[1:3] = ["0" + i if len(i) == 1 else i for i in version[1:3]] +version = ".".join(version) print(version) + sys.exit(0) From 81d864ff045a436faa95a9275703a58a0ad9f7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Tue, 3 May 2022 12:30:43 -0300 Subject: [PATCH 2/3] Use date conversion from datetime module --- .ci-helpers/get_next_version.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.ci-helpers/get_next_version.py b/.ci-helpers/get_next_version.py index 38801e824fe..497ac2107ce 100644 --- a/.ci-helpers/get_next_version.py +++ b/.ci-helpers/get_next_version.py @@ -1,17 +1,21 @@ #!/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(".") ] -version = version.rstrip(".0") if version.endswith(".0") else version -version = version.split(".") +build = scm_version[3] +release = scm_version[0:3] +iso_date = date(*release).isoformat() +iso_date = iso_date.replace("-",".") -version[1:3] = ["0" + i if len(i) == 1 else i for i in version[1:3]] -version = ".".join(version) +version = f"{iso_date}.{str(build)}" +version = version.rstrip(".0") if version.endswith(".0") else version print(version) From 748bf59f1a24d0dc8d762ec4be511d24a7b56e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Tue, 3 May 2022 12:31:59 -0300 Subject: [PATCH 3/3] Remove unused import --- .ci-helpers/get_current_version.py | 1 - 1 file changed, 1 deletion(-) 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