Repository navigation
COMP: Raise minimum wrapped Python to 3.11 - #6490
Conversation
Bump PYTHON_VERSION_MIN so FindPython3 requires CPython 3.11+ when building the Python wrapping. First step in retiring 3.10 support.
dzenanz
left a comment
There was a problem hiding this comment.
Mostly looks good. I don't really understand the last commit.
|
|
||
| ls -1 dist/ | ||
| itk-6.0.0.dev20260401-cp310-cp310-manylinux2014_x86_64.whl | ||
| itk-6.0.0.dev20260401-cp311-cp311-manylinux2014_x86_64.whl |
There was a problem hiding this comment.
We probably need to update these dates.
There was a problem hiding this comment.
Good catch. Rather than swap in another concrete date that will just go stale again, I've replaced the rot-prone version+date segment with a descriptive placeholder:
itk-<ITK_VERSION>-cp311-cp311-manylinux2014_x86_64.whl
itk-<ITK_VERSION>-cp311-cp311-macosx_11_0_arm64.whl
The cp311 tag stays concrete since it's the literal argument passed to the build script just above, so the example still shows cause and effect. This avoids the "comment rot" of hard-coded 6.0.0.devYYYYMMDD strings that were already stale on main.
There was a problem hiding this comment.
Expanded the placeholders to cover every variable field per the binary distribution format:
itk-<ITK_VERSION>-cp<PYTAG>-cp<PYTAG>-manylinux<MANYLINUX_VERSION>_<ARCH>.whl
itk-<ITK_VERSION>-cp<PYTAG>-cp<PYTAG>-macosx_<MACOS_VERSION>_<ARCH>.whl
Added a short legend under the Linux example mapping each placeholder (<ITK_VERSION> release vs X.Y.Z.devYYYYMMDD dev build, <PYTAG> CPython tag, platform tag = ABI baseline + OS + arch). <MANYLINUX_VERSION> ties back to the MANYLINUX_VERSION env var set just above. Nothing hard-coded left to rot.
|
You're correct, that last commit is a little bit out of scope for this PR. The last commit annotates the But you're right that it's a separate concern from the version-floor enforcement, and it deserves its own validation (mypy/pyright before-and-after evidence) that this PR's CI doesn't provide. I'll drop it from here and bring it back as a focused follow-up PR once this lands. |
Bump the three Azure pipelines still pinned to 3.10 (Linux, LinuxPython, Batch) up to 3.11, matching the new wrapping floor. Advance the BumpITKVersionInCI.sh wheel matrix to drop 3.10.
Bump the import-time version check emitted into every wrapped module (igenerator.py) and the static pyBase.i guard to match PYTHON_VERSION_MIN.
Update the python_packaging contributing guide to match the new PYTHON_VERSION_MIN. Historical release notes are left untouched.
With the 3.11 floor the "3.10-3.11" branch in the __buffer__/__array__ docstrings no longer applies; describe only the supported 3.11 behavior.
e6e8af2 to
82e3893
Compare
|
| Filename | Overview |
|---|---|
| CMake/ITKSetPython3Vars.cmake | Single-line bump of PYTHON_VERSION_MIN from 3.10 to 3.11; correct and consistent with all other changes. |
| Wrapping/Generators/Python/PyBase/pyBase.i | Runtime version guard updated to (3, 11, 0) and two docstring version-range references trimmed from "3.10-3.11" to "3.11". |
| Wrapping/Generators/SwigInterface/igenerator.py | Generated-header runtime guard bumped from (3, 10, 0) to (3, 11, 0); mirrors the pyBase.i change correctly. |
| Testing/ContinuousIntegration/AzurePipelinesBatch.yml | UsePythonVersion versionSpec bumped from 3.10 to 3.11. |
| Testing/ContinuousIntegration/AzurePipelinesLinux.yml | UsePythonVersion versionSpec bumped from 3.10 to 3.11. |
| Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml | UsePythonVersion versionSpec bumped from 3.10 to 3.11. |
| Utilities/Maintenance/BumpITKVersionInCI.sh | Wheel matrix sed patterns updated from [310, 311]/[10, 11] to [311, 312]/[11, 12]; comment updated accordingly. |
| Documentation/docs/contributing/python_packaging.md | Minimum Python version updated from 3.10 to 3.11 in prose and example wheel script invocations; example wheel filenames replaced with a parameterized template. |
| Modules/Core/Common/wrapping/test/itkImageLifetimeTest.py | Test comment updated from "3.10-3.11 primary path" to "3.11 primary path" to match the new floor. |
Reviews (1): Last reviewed commit: "COMP: Drop dead Python 3.10 references f..." | Re-trigger Greptile
dzenanz
left a comment
There was a problem hiding this comment.
Good as-is. I am indecisive about concrete version number.
|
|
||
| ls -1 dist/ | ||
| itk-6.0.0.dev20260401-cp310-cp310-manylinux2014_x86_64.whl | ||
| itk-<ITK_VERSION>-cp<PYTAG>-cp<PYTAG>-manylinux<MANYLINUX_VERSION>_<ARCH>.whl |
There was a problem hiding this comment.
A concrete version number has documentary value too, even if it is out of date.
6fc0363
into
InsightSoftwareConsortium:main
Raises ITK's minimum wrapped Python from 3.10 to 3.11 across build, CI, runtime guards, and docs, and removes the now-dead 3.10 codepaths. Deliberately leaves the Python limited-API (SABI) configuration untouched so it composes cleanly with the in-flight SWIG 4.4.1 work (#6484).
Commits
b0ee513PYTHON_VERSION_MIN3.10→3.11fc698e6BumpITKVersionInCI.shwheel matrix drops 3.10d9fbaa9igenerator.py+pyBase.i→(3, 11, 0)40c2f63python_packaging.mdminimum>= 3.11+cp310→cp311examples14ebbd1__buffer__/__array__docstrings + a test commente6e8af2typing.TypeAliasonitk.support.typesaliases (PEP 613, now guaranteed at 3.11)Scope & coordination
ITKSetPython3Vars.cmakeis intentionally not modified here — this PR's only change to that file is the one-linePYTHON_VERSION_MINbump.USE_SABIpinning). This PR is ordered to land first and is conflict-free with COMP: Move ITK Python wrapping to SWIG 4.4.1 #6484 (verified viagit merge-tree).3.10-version strings (FFTW3.3.10,CMP0070 #3.10.0, numeric test data) are left untouched.Verification
pre-commit run --all-files→ clean (exit 0, no modifications)pixi run build-python(CPython 3.13.9) → exit 0;import itksucceeds (exercises the bumped runtime guards); functional smoke (filled image → numpy view) passesfound suitable version "3.13.9", required range is "3.11...3.999"