Skip to content

ENH: Add Python 3.12 and 3.13 to build-test-package CI workflow #323

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

Conversation

N-Dekker
Copy link
Collaborator

@N-Dekker N-Dekker commented Mar 5, 2025

Python 3.12 and 3.13 now both have "bugfix" maintenance status, according to https://www.python.org/downloads/

Python 3.12 and 3.13 now both have "bugfix" maintenance status, according to
https://www.python.org/downloads/
@N-Dekker
Copy link
Collaborator Author

N-Dekker commented Mar 6, 2025

@thewtex Does the itk package already support Python 3.12 and 3.13? I don't see them at https://pypi.org/project/itk/#files

@N-Dekker N-Dekker marked this pull request as draft March 6, 2025 08:26
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

@N-Dekker we should not be trying to build 3.12 and 3.13 Python packages.

@@ -28,7 +28,7 @@ jobs:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/[email protected]
with:
python3-minor-versions: '["9","10","11"]'
python3-minor-versions: '["9","10","11","12","13"]'
Copy link
Member

Choose a reason for hiding this comment

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

We do not want 12 and 13 here. Our 3.11 wheels work with 3.12 and 3.13.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @thewtex, cool. But then, why do we have 10 and 11? Don't the 3.9 wheels work with 3.10 and 3.11?

Copy link
Member

Choose a reason for hiding this comment

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

Stable ABI was introduced with Python 3.11, see: https://docs.python.org/3.11/c-api/stable.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting! Thanks @dzenanz Do the ITK wrappings just use the "Limited API" of Python? Is Py_LIMITED_API defined for ITK?

It looks like even Python 3.9 supports a Stable ABI, although it has less documentation: https://docs.python.org/3.9/c-api/stable.html So don't you think a single Python 3.9 wheel would be sufficient to support any Python version >= 3.9? We could potentially save a lot of energy (and save a little bit more of the planet)... 😇

Copy link
Member

Choose a reason for hiding this comment

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

I know that "official", "complete", "proper" (whatever) support for Python stable ABI has started with version 3.11. I don't know where that is written.

ITK has ITK_USE_PYTHON_LIMITED_API, which is on by default if Python version is 3.11+.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I know that "official", "complete", "proper" (whatever) support for Python stable ABI has started with version 3.11. I don't know where that is written.

Ah, now I see, in What’s New In Python 3.11 section New Features:

(Contributed by Christian Heimes in bpo-45459.)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we need Python 3.11 for the CPython ABI we / our version of SWIG uses.

@N-Dekker N-Dekker closed this Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants