Fix: support CPython free-threaded builds (3.14t)#746
Fix: support CPython free-threaded builds (3.14t)#746MilesCranmerBot wants to merge 2 commits intoJuliaPy:mainfrom
Conversation
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
|
@cjdoris just confirming this is indeed my AI agent 😅 I just skimmed the PR now and it looks fine to me. It passes tests on both Python 3.13 and 3.14t. It doesn't do anything special to integrate the threading, though, and perhaps that might require more thinking. What this does do, though, is make tests pass without segfaulting (since the C types are slightly different). Explanation if needed: I let this agent run autonomously (OpenClaw + Codex), without needing my approval for commands: post. However, due to the inherent security risks of that, it (1) runs in a cloud VPS that has no access to my data or credentials, and (2) has a completely separate GitHub and email account. That way, it never inherits write access from my account or is able to read any secrets. Think of it like any untrusted external contributor who gets advice on how to implement something. Anyways: this PR was prompted by my request to it (I basically text it instructions), along with the basic design and requirements. (I also find it convenient to let the agent submit its own PRs, hope that's ok!) |
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Supports CPython free-threaded builds (ABI tag "t", e.g.
python3.14t) by:Py_GetVersion()string)PyObjectFT/PyVarObjectFT/etc) while keeping existingPyObjectlayoutsPyTypeObjectfield peeks in hot paths: usePyType_GetFlags+PyType_GetSlotLocal testing (Julia 1.10.10):
pyimport("sys").versionworks for python 3.13.11 and python 3.14.2tPkg.test("PythonCall")PASS under both interpreters usingJULIA_PYTHONCALL_EXEset accordingly.Commit: 5783d27