Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force constant version date length #1995

Merged
merged 3 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci-helpers/get_current_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import sys
from setuptools_scm import version_from_scm
from setuptools_scm.version import guess_next_date_ver
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import


version = version_from_scm(".").tag.public

Expand Down
14 changes: 12 additions & 2 deletions .ci-helpers/get_next_version.py
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?


print(version)

sys.exit(0)