Skip to content

ENH: Add free-threaded Python (3.14t) packaging support - for release - #2580

Merged
blowekamp merged 3 commits into
SimpleITK:releasefrom
blowekamp:backport-free-threaded-python
May 4, 2026
Merged

blowekamp merged 3 commits into
SimpleITK:releasefrom
blowekamp:backport-free-threaded-python

Conversation

@blowekamp

Copy link
Copy Markdown
Member
  • Python.i: declare module GIL-safe for free-threaded builds via PyUnstable_Module_SetGIL under Py_GIL_DISABLED guard
  • Package.yml: add cp314-cp314t to manylinux PYTHON_VERSIONS and a continue-on-error 'Package Python 3.14t' step for macOS/Windows
  • package_python/action.yml: bump setup-python from v5 to v6
  • cmd.sh: replace deprecated distutils.util.get_platform() with sysconfig.get_platform()

blowekamp added 2 commits May 3, 2026 08:04
Under Py_GIL_DISABLED, call PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED)
in the module init block to declare the module compatible with free-threaded
Python (PEP 703).
CMake 3.30 added FindPython support for free-threaded Python (PEP 703).
Earlier versions resolve Python::Module to python3XXt.lib incorrectly,
linking against python3XX.dll instead of python3XXt.dll and causing an
access violation on module import.

Emit a FATAL_ERROR if a free-threaded interpreter is detected (identified
by a 't' in Python_SOABI) and CMake is older than 3.30.
@blowekamp
blowekamp force-pushed the backport-free-threaded-python branch from 994ca7d to 5cdf8c1 Compare May 3, 2026 12:09
@blowekamp blowekamp changed the title ENH: Add free-threaded Python (3.14t) packaging support ENH: Add free-threaded Python (3.14t) packaging support - for release May 3, 2026
- Package.yml: add cp314-cp314t to manylinux PYTHON_VERSIONS, add
  continue-on-error 'Package Python 3.14t' step, bump cmake to ~=3.31
- package_python/action.yml: bump setup-python v5->v6, fix
  continue-on-error string-to-bool expression
- cmd.sh: replace deprecated distutils.util.get_platform() with
  sysconfig.get_platform()
@blowekamp
blowekamp force-pushed the backport-free-threaded-python branch from 5cdf8c1 to 7caf723 Compare May 3, 2026 17:03
@blowekamp
blowekamp requested review from dave3d and zivy May 3, 2026 17:03
@blowekamp
blowekamp marked this pull request as ready for review May 4, 2026 14:12
@blowekamp
blowekamp merged commit ec78a4f into SimpleITK:release May 4, 2026
20 of 22 checks passed
@blowekamp
blowekamp deleted the backport-free-threaded-python branch September 9, 2026 12:55
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