Test 3.13 free-threaded build on CI#8200
Conversation
lysnikolaou
left a comment
There was a problem hiding this comment.
I left one comment regarding NumPy versioning.
The build actually runs with the GIL enabled, we'll need to explicitly indicate in the extensions that they should run with it disabled.
I would recomment adding the PYTHON_GIL=0 environment variable to keep the GIL disabled and test against that. It's still going to be some time before we can run without the GIL without the environment variable, since extension modules in dependencies (NumPy for example) can enable it as well.
|
Thanks for the review, how does this look? |
lysnikolaou
left a comment
There was a problem hiding this comment.
LGTM! Just one nit in case you find it useful as well.
.github/workflows/test.yml
Outdated
| - { os: "macos-14", python-version: "3.9" } | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| name: ${{ matrix.os }} Python ${{ matrix.python-version }} |
There was a problem hiding this comment.
Maybe include free-threading in the name for the free-threaded run?

For #8199.
Currently GitHub's
actions/setup-pythondoes not yet support free-threading but it has been requested: actions/setup-python#771 (give it a 👍)However, it is available via
deadsnakes/action:This PR adds an Ubuntu
3.13-devjob to the matrix, to run tests with a free-threaded build.The build actually runs with the GIL enabled, we'll need to explicitly indicate in the extensions that they should run with it disabled. This will be changed in a follow-up PR.
We can check if Python is built with free-threaded mode by looking for "experimental free-threading build" in
python --version --version. On the CI we can see it under "Build system information":https://github.com/python-pillow/Pillow/actions/runs/9794942077/job/27045976814#step:5:10
Compared to the regular build:
https://github.com/python-pillow/Pillow/actions/runs/9794942077/job/27045975199#step:5:16