Skip to content

Fix: support CPython free-threaded builds (3.14t) - #746

Merged
cjdoris merged 11 commits into
JuliaPy:mainfrom
MilesCranmerBot:bot/fix-pythoncall-py314t
Feb 16, 2026
Merged

cjdoris merged 11 commits into
JuliaPy:mainfrom
MilesCranmerBot:bot/fix-pythoncall-py314t

Conversation

@MilesCranmerBot

Copy link
Copy Markdown
Contributor

Supports CPython free-threaded builds (ABI tag "t", e.g. python3.14t) by:

  • recording whether the loaded libpython is free-threaded (via Py_GetVersion() string)
  • adding parallel FT header structs (PyObjectFT/PyVarObjectFT/etc) while keeping existing PyObject layouts
  • avoiding direct PyTypeObject field peeks in hot paths: use PyType_GetFlags + PyType_GetSlot
  • fixing Juliacall heap type layout/alloc/free to respect the FT header size

Local testing (Julia 1.10.10):

  • Smoke: pyimport("sys").version works for python 3.13.11 and python 3.14.2t
  • Pkg.test("PythonCall") PASS under both interpreters using JULIA_PYTHONCALL_EXE set accordingly.

Commit: 5783d27

Loading
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