Skip to content

Support for free-threading CPython #234

@rgommers

Description

@rgommers

Hi @ilanschnell 👋🏼. We working on support for free-threaded CPython (see, e.g., PEP 703 and https://py-free-threading.github.io/) and found bitarray in one of the dependency trees we're looking at.

Here is what adding support for free-threading typically takes:

  • Add a regular test job that runs the free-threaded interpreter in CI. Use pytest-run-parallel to find potential issues (global state and other potential thread safety issues), and fix them. Note: bitarray currently only has tests running in wheel build jobs, so perhaps adding this in CI is not desirable - it can be done locally as well.
  • Audit Python bindings and declare them free-threading compatible (xref https://py-free-threading.github.io/porting-extensions/).
  • Run the test suite under ThreadSanitizer (locally, once, not in CI - just scan for issues).
  • Update the CI job that builds wheels to include free-threading wheels (cp313t ABI tag).

It'd be great for bitarray to gain support, and @HaoZeke should have bandwidth soon to contribute this, if that sounds good to you. If so, any pointers would be very welcome e.g., (things you know may be problematic and would need testing/changing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions