setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

Add support for requesting free-threaded builds of cpython.

Open AraHaan opened this issue 9 months ago • 1 comments

Description: Since Python 3.13 requesting the free-threaded GIL free builds of cpython (Py_GIL_DISABLED defined in the C code) is a new feature that is not shipped by default in the normal builds of cpython and c extensions could optionally provide said support, as such it is necessary to also provide support for requesting such builds, but the feature throws error for when they request Python versions older than 3.13 as it did not exist prior to 3.13.

Justification: Using the github action to install 3.13+ of cpython just to build a multi-phase C extension that may include the new Py_mod_gil slot when Py_GIL_DISABLED is defined for the C extension).

Are you willing to submit a PR?

It depends on how hard it is to implement. I don't know typescript.

AraHaan avatar Mar 19 '25 14:03 AraHaan

Hello @AraHaan, Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

gowridurgad avatar Mar 20 '25 06:03 gowridurgad

Hello @AraHaan, Thank you for raising this feature request! The functionality you've described has already been implemented as part of PR #973. This PR includes:

Support for installing GIL-free (free-threaded) builds of Python 3.13+ (--disable-gil / x64-freethreaded architecture).

Validation logic that ensures an error is thrown when attempting to use the x64-freethreaded variant with Python versions earlier than 3.13.

This implementation directly addresses the goals outlined in your request and aligns with PEP 703.

Please let us know if you're encountering any issues or have further suggestions :)

aparnajyothi-y avatar Apr 24 '25 14:04 aparnajyothi-y

Hello @AraHaan, Please let us know if any concerns / clarifications are needed on the above :)

aparnajyothi-y avatar May 15 '25 03:05 aparnajyothi-y

I think everything should be fine now, thanks.

AraHaan avatar May 16 '25 06:05 AraHaan