Skip to content

Support Python 3.14 and the free-threaded build #1418

@ngoldbaum

Description

@ngoldbaum

As of Python 3.14, the free-threaded build is no longer considered experimental. See the what's new. CFFI 2.0, which came out this week and I helped getting out the door, added support for the free-threaded build. That release unblocked building pygit2 on the free-threaded build and fixed #1367.

It looks like pygit2 is not thread-safe: #1004.

That's fine IMO - it just needs to be clearly documented as such. You should still ship free-threaded builds of pygit2 for the same reason you ship builds on the GIL-enabled build. The GIL doesn't do anything to protect you from misuses of libgit2, as the above issue illustrates.

If you're interested in improving the thread safety of the library I can offer some suggestions.

See https://py-free-threading.github.io/ for more about free-threaded Python, including a guide for porting extensions.

If you're open to it, an easy first step would be to add free-threaded 3.14t to the testing matrix. I could do that along with updating the tests to use 3.14 instead of 3.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions