Conversation
…nfiguration limitations
This comment was marked as outdated.
This comment was marked as outdated.
tests/test_wheel.py
Outdated
| ): | ||
| assert "abi3.abi3t" in Path(dist_path).name | ||
| with subtests.test(msg="wheel has correct ABI tag"): | ||
| if IS_FREETHREADING or build_system == "meson_python": |
There was a problem hiding this comment.
Condition goes as first argument to subxfail, so just extend that.
setuptools/c/setup.cfg
Outdated
| @@ -0,0 +1,2 @@ | |||
| [bdist_wheel] | |||
| py_limited_api = cp315 No newline at end of file | |||
setuptools/cython/pyproject.toml
Outdated
| dependencies = [ | ||
| "setuptools@git+https://github.com/ngoldbaum/setuptools@abi3.abi3t" | ||
| ] |
There was a problem hiding this comment.
I'm confused here. Why does it need setuptools at runtime?
There was a problem hiding this comment.
Turns out this was unnecessary, I deleted it.
setuptools/cython/setup.cfg
Outdated
| @@ -0,0 +1,2 @@ | |||
| [bdist_wheel] | |||
| py_limited_api = cp315 No newline at end of file | |||
tests/test_wheel.py
Outdated
| ): | ||
| assert "abi3.abi3t" in Path(dist_path).name | ||
| with subtests.test(msg="wheel has correct ABI tag"): | ||
| with subxfail(((IS_FREETHREADING or build_system == "meson_python") and |
There was a problem hiding this comment.
(IS_FREETHREADING or build_system == "meson_python") is never true (it's meson-python).
Also, to be honest, I'm lost at what is happening here. Do I understand correctly that:
- meson-python always produces
abi3.abi3t - setuptools produce
abi3.abi3twhen building on freethreading, butabi3otherwise?
Is that really the expected behavior or bug of setuptools?
Right now you're treating the different output of setuptools as a valid condition, but different output from any other build backend as XFAIL (while randomly selecting abi3 branch to test them against). If anything, I'd dare say special-casing setuptools may be better than special-casing abi3.abi3t case.
There was a problem hiding this comment.
(IS_FREETHREADING or build_system == "meson_python")
Ouch, thanks for spotting.
meson-python always produces abi3.abi3t
setuptools produce abi3.abi3t when building on freethreading, but abi3 otherwise?
Is that really the expected behavior or bug of setuptools?
You could imagine adding a new setuptools bdist_wheel argument that forces an abi3t build to opt into setting Py_TARGET_ABI3T. However, Py_TARGET_ABI3T doesn't exist yet in CPython so it seemed pointless to me until PEP 803 is actually accepted and there is some support for it in CPython.
The abi.abi3t ABI implies that both Py_LIMITED_API and Py_GIL_DISABLED are set in python's headers, so IMO it's the correct default behavior for a free-threaded build using setuptools with py_limited_api = True to produce an abi3.abi3t wheel and a GIL-enabled build to produce an abi3 wheel.
There was a problem hiding this comment.
I made it so the tests special-case setuptools.
There was a problem hiding this comment.
Oh, I see that the PEP changed quite a bit since I've last looked.
|
I think I addressed all your comments. |
mgorny
left a comment
There was a problem hiding this comment.
Thanks, and sorry it took this many iterations.
Uses a patched setuptools and packaging. Also updates the tests to account for the behavior I've added to my setuptools fork: build
abi3on GIL-enabled cp315 but buildabi3.abi3ton free-threaded by default.Adding
setup.cfgfiles forces the wheel build to actually use the limited API. Currently the setuptools tests build version-specific wheels, which is why they don't need a patched setuptools.