-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test 3.13 free-threaded build on CI #8200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one nit in case you find it useful as well.
.github/workflows/test.yml
Outdated
exclude: | ||
- os: "macos-14" | ||
python-version: "3.9" | ||
- { 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe include free-threading
in the name for the free-threaded run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG!
For #8199.
Currently GitHub's
actions/setup-python
does 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-dev
job 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