Handle free-threaded builds in build_ext.get_libraries #389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates build_ext.get_libraries to handle free-threaded builds of Python when using non-MSVC compilers.
Previously, the non-free-threaded library would be used for free-threaded builds of Python. For instance, when attempting to build an extension for python314t, the extension would be linked against python314.
This fixes pypa/setuptools#5126.
I've manually tested this by using a similarly patched setuptools to successfully build jq.py wheels using mingw32 on Windows for python314t. While there are some automated tests for build_ext, my impression from a quick look was that those tests rely on being run in the relevant environment, rather than (for instance) mocking the environment, and therefore updating the tests to check this case isn't straightforward.