ENH: add support for PEP 803 abi3t with Python 3.15.0b2+#856
Conversation
|
I didn't touch the test matrix, since testing on 3.15 is already being addressed by #853. |
|
|
||
|
|
||
| @pytest.mark.skipif(NOGIL_BUILD and CYTHON_VERSION < (3, 1, 0), | ||
| @pytest.mark.skipif(mesonpy._is_free_threaded() and CYTHON_VERSION < (3, 1, 0), |
There was a problem hiding this comment.
I think the NOGIL_BUILD was more self explanatory. Reading the function call mesonpy._is_free_threaded() I would imagine that what has the property of being free threaded is mesonpy, which does not make much sense.
I would keep the old constant.
There was a problem hiding this comment.
Do you think it would be better to put it as a constant in mesonpy? I was torn between using a function and a constant, given this is fixed value.
There was a problem hiding this comment.
Constant seems fine to me. Slight preference for FREE_THREADED_BUILD over NOGIL_BUILD (the latter name will fade over time I think), but I don't care that much either way.
There was a problem hiding this comment.
@rgommers IIRC it was you that introduced the NOGIL_BUILD constant 🙂
There was a problem hiding this comment.
Guilty:) I guess that was early days, before the Steering Council pronounced that that was a negative name and they wanted everyone to use free-threading/free-threaded everywhere.
There was a problem hiding this comment.
For now, I've focused on the changes relevant to the PR. Do you want me to change the constant name, and possibly move it to mesonpy/__init__.py here, or separately?
There was a problem hiding this comment.
For now, I've focused on the changes relevant to the PR.
That sounds fine to me - small diffs are nice
|
Downstream testing, and releasing after rc1 in early August, is currently blocked on this, so I added a v0.21.0 tag - we should do that next month I think. |
rgommers
left a comment
There was a problem hiding this comment.
A couple of small issues in the test extension. The rest looks right; I refreshed my memory on Py_TARGET_ABI3T and that should be added automatically in Python.h for a free-threaded interpreter if Py_LIMITED_API is defined - so all good there.
|
This is looking pretty good now. Are you expecting it to be squash-merged, or do you want to rewrite history? (we usually do the latter, and rebase-merge) |
Add tag/extension support and initial tests for `abi3t` as specified in PEP 803 and implemented in Python 3.15.0b2. This is currently limited to building `abi3t` extensions from freethreading builds of Python, since Meson does not support forcing `abi3t` builds explicitly right now. See mesonbuild/meson#15637 for the relevant discussion. The additional test case utilizes the new API introduced in PEP 793 and PEP 820, and therefore requires Python 3.15.0b2. The relevant test tests wheel correctness both with GIL-enabled and free-threading builds of Python 3.15.0b2. The behavior for older versions of Python remains unchanged. Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
Rewrote it now. I've kept (and reworded) the commit changing |
rgommers
left a comment
There was a problem hiding this comment.
LGTM now, thanks @mgorny.
@dnicolodi WDYT about releasing this quickly as 0.21.0? Getting this supported would be nice, makes it more likely package authors will experiment with it before the ABI gets frozen in 5-6 weeks from now. I had a look through the rest of the PR queue, and nothing else is critical, although PR 838 is close and we could aim to get that in as well.
| @@ -0,0 +1,14 @@ | |||
| # SPDX-FileCopyrightText: 2023-2026 The meson-python developers | |||
There was a problem hiding this comment.
I would prefer if this test case would get a more descriptive name. I'm sure that before tomorrow I'm going to forget what ft stands for. If spelling it out as limited-api-free-threaded is too long, maybe limited-api-pep803 or limited-api-abi3t?
|
LGTM too, with the minor exception of the test package name: I am sure that I will promptly forget what ft stands for, thus a longer more descriptive name would help there.
I can try to get that in shape this evening. I would still like to get the RPATH handling in order sooner rather than later, but I didn't find the time to finish that work. I guess we can go another release without it. |
Add tag/extension support and initial tests for
abi3tas specified in PEP 803 and implemented in Python 3.15.0b2. This is currently limited to buildingabi3textensions from freethreading builds of Python, since Meson does not support forcingabi3tbuilds explicitly right now. See mesonbuild/meson#15637 for the relevant discussion.The additional test case utilizes the new API introduced in PEP 793 and PEP 820, and therefore requires Python 3.15.0b2. The relevant test tests wheel correctness both with GIL-enabled and free-threading builds of Python 3.15.0b2.
The behavior for older versions of Python remains unchanged.