Skip to content

Commit 447ae07

Browse files
hjmjohnsonclaude
andcommitted
BUG: Pin ITK dep floor to vMAJOR.MINOR of the ITK version being built
The dependency floor must match the ITK series the wheel was compiled against, not a hardcoded backward-compatible value. For ITK 6.0.0b2 the rewrite now produces "itk-io >= 6.0" instead of "itk-io >= 5.4". This ensures wheels are only installable alongside the correct ITK release series. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fc9cee6 commit 447ae07

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/build_python_instance_base.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,14 @@ def _update_module_itk_deps(pyproject_path: Path, itk_version: str) -> bool:
837837
)
838838

839839
# Determine the minimum version floor from the ITK version being built.
840-
# For "6.0.0b2.post757" -> major "6", floor "5.4" (backward compat).
841-
# For "5.4.0" -> floor "5.4".
840+
# Pin to vMAJOR.MINOR of the ITK version so the wheel is only
841+
# installable alongside the ITK series it was compiled against.
842+
# For "6.0.0b2.post757" -> "6.0", for "5.4.0" -> "5.4".
843+
parts = itk_version.split(".")
842844
try:
843-
major = int(itk_version.split(".")[0])
844-
except (ValueError, IndexError):
845-
major = 5
846-
min_floor = "5.4" if major >= 5 else itk_version.rsplit(".", 1)[0]
845+
min_floor = f"{parts[0]}.{parts[1]}"
846+
except IndexError:
847+
min_floor = itk_version
847848

848849
changed = False
849850
def _replace(m: re.Match) -> str:

0 commit comments

Comments
 (0)