Description
openedon Nov 4, 2024
While we wait for GitHub to review the PRs to support free-threaded Python (actions/setup-python#973, actions/python-versions#319), Quansight Labs can host a fork of setup-python
that supports it. Here are the steps:
python-versions
-
Fork actions/python-versions into the
Quansight-Labs
org. Make sure GitHub actions are enabled in the fork. -
Merge the five commits from the
colesbury/python-versions
quansight branch into the main branch of the new fork. In addition to the changes from my upstream PR, this branch has a few modifications to make it work outside of theactions
organization, and to merge versions from upstreamactions/python-versions
(so that we don't have to rebuild every single Python version). -
Run the "Build Python Package" step at https://github.com/Quansight-Labs/python-versions/actions/workflows/build-python-packages.yml with the following options. This will take ~30 minutes:
Branch: main
Python version: 3.13.0
Whether to publish releases: Yes (IMPORTANT!)
CPython threading build modes: freethreaded
Platforms: ubuntu-20.04,ubuntu-22.04,ubuntu-24.04,macos-13_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86
(Only the "publish releases" needs to be changed -- the other options should be the same as the defaults)
This will take about 30 minutes and automatically publish a 3.13.0 release on the fork.
- Merge the automatically opened PR once the build process completes. This will update the
versions-manifest.json
file.
setup-python
- Fork actions/setup-python into the
Quansight-Labs
org. Make sure GitHub actions are enabled in the fork. - Merge the two commits from the
colesbury/setup-python
quansight branch into the main branch of the new fork. In addition to the changes from my upstream PR, this branch changes the organization (forversions-manifest.json
) toQuansight-Labs
. - Create a release (from https://github.com/Quansight-Labs/setup-python/releases). Name it something like v5.3.1, so that the major version (v5) stays the same as in upstream. This will automatically set the
v5
tag as long.
Usage
Projects should be able to swap actions/setup-python
with Quansight-Labs/setup-python
and hopefully everything will "just work". Free threaded Pythons will be pulled from Quansight-Labs/python-versions
while non-free threaded versions should continue working without any extra changes.
cc @rgommers