diff --git a/pyproject.toml b/pyproject.toml index a255e99..a5dd40e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,8 @@ backends = [ "maturin", "meson-python @ git+https://github.com/mgorny/meson-python@freethreading-limited-api", "scikit-build-core", - "setuptools", + "setuptools @ git+https://github.com/ngoldbaum/setuptools@abi3.abi3t", + "packaging @ git+https://github.com/ngoldbaum/packaging@abi3.abi3t", ] build-tools = [ "cython @ git+https://github.com/cython/cython@freethreading-limited-api-preview", diff --git a/setuptools/c/pyproject.toml b/setuptools/c/pyproject.toml index 483b008..56a97ec 100644 --- a/setuptools/c/pyproject.toml +++ b/setuptools/c/pyproject.toml @@ -1,6 +1,9 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools"] +requires = [ + "setuptools@git+https://github.com/ngoldbaum/setuptools@abi3.abi3t", + "packaging@git+https://github.com/ngoldbaum/packaging@abi3.abi3t", +] [project] name = "limited-api" diff --git a/setuptools/c/setup.cfg b/setuptools/c/setup.cfg new file mode 100644 index 0000000..121002e --- /dev/null +++ b/setuptools/c/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +py_limited_api = cp315 diff --git a/setuptools/cython/pyproject.toml b/setuptools/cython/pyproject.toml index b146ea9..8233faf 100644 --- a/setuptools/cython/pyproject.toml +++ b/setuptools/cython/pyproject.toml @@ -1,7 +1,8 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools", + "setuptools@git+https://github.com/ngoldbaum/setuptools@abi3.abi3t", + "packaging@git+https://github.com/ngoldbaum/packaging@abi3.abi3t", "cython@git+https://github.com/cython/cython@freethreading-limited-api-preview", ] diff --git a/setuptools/cython/setup.cfg b/setuptools/cython/setup.cfg new file mode 100644 index 0000000..121002e --- /dev/null +++ b/setuptools/cython/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +py_limited_api = cp315 diff --git a/tests/test_wheel.py b/tests/test_wheel.py index 0c8a3e1..3f2e6d4 100644 --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -74,13 +74,21 @@ def test_install(test_case: str, tmp_path: Path, subtests) -> None: reason="pyo3 does not support 3.15 (or PEP 803) yet", ): dist_path = builder.build("wheel", tmp_path) + path_name = Path(dist_path).name - with subtests.test(msg="wheel has 'abi3.abi3t' tag"): - with subxfail( - build_system != "meson-python", - reason="Only meson-python fork builds abi3.abi3t", - ): - assert "abi3.abi3t" in Path(dist_path).name + + with subtests.test(msg="wheel has correct ABI tag"): + if build_system == "setuptools": + # The setuptools fork doesn't yet have support for forcing a GIL-enabled build + # to produce an abi3.abi3t wheel + if IS_FREETHREADING: + assert "abi3.abi3t" in path_name + else: + assert "abi3" in path_name and "abi3t" not in path_name + else: + with subxfail(build_system != "meson-python", + reason="Only meson-python and setuptools forks build abi3.abi3t"): + assert "abi3.abi3t" in path_name subprocess.run([sys.executable, "-m", "venv", tmp_path / "venv"], check=True) python_exe = "python.exe" if os.name == "nt" else "python" @@ -108,7 +116,7 @@ def test_install(test_case: str, tmp_path: Path, subtests) -> None: ): subprocess.run([venv_python, "-c", TEST_ABI3], check=True) - if "abi3t" not in Path(dist_path).name: + if "abi3t" not in path_name: return # if we're testing with non-freethreading pythonX.Y, try pythonX.Yt # otherwise, try pythonX.Y (presumably non-freethreading)