-
Notifications
You must be signed in to change notification settings - Fork 1.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
uv
should exclude abi3
wheels in free-threaded Python 3.13+
#2429
Comments
Awesome, thank you. |
@konstin - Interested in this one? |
No-gil/gil-disabled/free-threaded python reintroduces abiflags since it is incompatible with regular native modules and abi3. Tests: None yet! We're lacking cpython 3.13 no-gil builds we can use in ci. My test setup: ``` PYTHON_CONFIGURE_OPTS="--enable-shared --disable-gil" pyenv install 3.13.0a5 cargo run -q -- venv -q -p python3.13 .venv3.13 --no-cache-dir && cargo run -q -- pip install -v psutil --no-cache-dir && .venv3.13/bin/python -c "import psutil" ``` Fixes #2429
@colesbury What is the canonical name for this feature, "no-gil python", "gil disabled" or "free-threaded python"? As a more technical question, is psutil expected to still error when built from source with python 3.13.0a5? (I can built from main too if that's better) uv
pip
If yes, here's a PR implementing the |
Not Sam, but as per the Steering Council decision, the canonical name is "free-threaded Python": python/steering-council#221 (comment). |
Oof... yeah I think that's something we need to fix either in CPython or in psutil |
No-gil/gil-disabled/free-threaded python reintroduces abiflags since it is incompatible with regular native modules and abi3. Tests: None yet! We're lacking cpython 3.13 no-gil builds we can use in ci. My test setup: ``` PYTHON_CONFIGURE_OPTS="--enable-shared --disable-gil" pyenv install 3.13.0a5 cargo run -q -- venv -q -p python3.13 .venv3.13 --no-cache-dir && cargo run -q -- pip install -v psutil --no-cache-dir && .venv3.13/bin/python -c "import psutil" ``` Fixes #2429
freethreaded python reintroduces abiflags since it is incompatible with regular native modules and abi3. Tests: None yet! We're lacking cpython 3.13 no-gil builds we can use in ci. My test setup: ``` PYTHON_CONFIGURE_OPTS="--enable-shared --disable-gil" pyenv install 3.13.0a5 cargo run -q -- venv -q -p python3.13 .venv3.13 --no-cache-dir && cargo run -q -- pip install -v psutil --no-cache-dir && .venv3.13/bin/python -c "import psutil" ``` Fixes #2429
Starting with the version 3.13 alpha releases, CPython can optionally be configured to run without the global interpreter lock. This build configuration ("free-threaded") is not compatible with
abi3
wheels.Additionally, the version specific wheels require the "t" suffix in the ABI tag. For example,
cp313-cp313t-manylinux_2_35_x86_64
(free-threaded build) instead ofcp313-cp313-manylinux_2_35_x86_64
(default 3.13 build).Steps to reproduce issue
--disable-gil
uv venv
,source .venv/bin/activate
uv pip install psutil
python -c "import psutil"
Segmentation fault (core dumped)Identifying
--disable-gil
CPython buildsI think the best way is to check if
sysconfig.get_config_var("Py_GIL_DISABLED")
returnsTrue
.packaging.tags
instead checks for a "t" insys.abiflags
, but this is because of constraints on the public API exposed by the package. I think usingsysconfig
is likely a better option foruv
.See also:
The text was updated successfully, but these errors were encountered: