ENH: YYYYMMDD tweak version for between-tag gating (supersedes #6665)#6667
ENH: YYYYMMDD tweak version for between-tag gating (supersedes #6665)#6667hjmjohnson wants to merge 2 commits into
Conversation
Set the fourth (tweak) version component to the UTC date of the most recent migration-inducing change and export ITK_VERSION_TWEAK and ITK_VERSION_FULL through ITKConfig.cmake. Downstream projects building against untagged commits (e.g. during git bisect) can gate at configure time with ITK_VERSION_FULL VERSION_GREATER_EQUAL M.m.p.YYYYMMDD; version ordering expires the value at each release tag with no extra checklist steps. Policy, recorded in AGENTS.md and the migration-guide index: a change requiring a migration-guide entry or altering public API must bump ITK_VERSION_TWEAK; other key changes may. EXACT find_package matches on the three-component version are preserved.
This comment was marked as resolved.
This comment was marked as resolved.
dzenanz
left a comment
There was a problem hiding this comment.
I have not taken a look at Utilities/Maintenance/BumpVersionTweak.py. The rest looks good on a glance. It would be good if someone else reviewed, too.
|
I have concerns about manually updating this one file. I think it would be nice of the tweak was just automatically determined from the last commit on the main branch or similarly. |
@blowekamp I also don't like the manual updating of this file, but trying to use git commits past a tag is also very difficult. We need to have workarounds for tarballs that will not be able to compute the offests. I'll make another attempt at using git tag offsets to compute the value automatically. Previous concerns that arose when I did that resulted in me using the #6665 solution. I'll create a PR with the git count offset from the current version tag, I know that that solution has failure modes, but perhaps the simpler user interface will make the failure modes tolerable. |
You may want to look into the .git_archival.txt that is a something used by Python's setuptools scm. I am currently looking at using this file more in SimpleITK. |
|
Superseded by #6676, which implements @blowekamp's suggestion to determine the tweak automatically instead of hand-editing a file. #6676 computes Closing in favor of #6676. |
Set the fourth (tweak) version component at configure time to the number of commits since the closest v* tag, instead of a hand-edited date. A Python helper computes it from `git describe` in a working tree, and from the git-archive-substituted `.git_archival.txt` in an exported tarball (the setuptools-scm mechanism), falling back to 0 when neither is available. ITK_VERSION_TWEAK and ITK_VERSION_FULL are exported through ITKConfig.cmake for downstream between-tag gating. The value never reaches itkConfigure.h, so the per-commit count cannot invalidate ccache. Supersedes the manual-file approach of InsightSoftwareConsortium#6667. Co-Authored-By: Bradley Lowekamp <321061+blowekamp@users.noreply.github.com>
Supersedes #6665 with the simpler design from its review discussion: the fourth (tweak) version component carries the
YYYYMMDD(UTC) date of the most recent migration-inducing change, exported asITK_VERSION_TWEAK/ITK_VERSION_FULLviaITKConfig.cmake, so downstream projects can gate at configure time between release tags — including duringgit bisecton untagged commits.A second commit (
DOC:) documents the current Python 3.11+ wrapping floor in the ITK 6 migration guide — surfaced during review ofBumpVersionTweak.py's use ofdatetime.UTC(which is correct:pyupgrade --py311-plusandITK_WRAP_PYTHON_MINIMUM_VERSION 3.11both enforce it).Policy (documented in
AGENTS.md,Documentation/AI/git-commits.md, and the migration-guide index): a change requiring a migration-guide entry or altering public API must bumpITK_VERSION_TWEAK; other key changes may. The value is never reset — release-tag version ordering expires it naturally, so no release-checklist steps are added.Design notes vs #6665
ITK_VERSION_FULLunset → comparison false → legacy branch).Utilities/Maintenance/BumpVersionTweak.py: sets the tweak to today's UTC date or a given date, refuses to move it backwards, idempotent.itkConfigure.h'sITK_VERSION_STRINGis major.minor only, so the tweak never reaches compiled headers.ITKConfigVersion.cmake.ingains the tweak inPACKAGE_VERSION;find_package(ITK 6.0.0 EXACT)still matches via an explicit three-component equality arm.20260715= date of the latest migration-guide change onmain(fb2117c).Verification
project(VERSION)withitkVersion.cmakeincluded:PROJECT_VERSION=6.0.0.20260715,VERSION_GREATER_EQUALgates true/false correctly on either side of the date.BumpVersionTweak.pyexercised: forward bump, backward-date rejection (exit 1), same-date no-op.pre-commit run --all-filesclean.