From c94c2cf4e9dc7a0d3b10f71e490110887eb822e1 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Fri, 18 Oct 2024 15:10:29 -0600 Subject: [PATCH] skip abi3 tests on free-threaded build --- noxfile.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 17ffb9aba85..f29bb45c109 100644 --- a/noxfile.py +++ b/noxfile.py @@ -5,6 +5,7 @@ import shutil import subprocess import sys +import sysconfig import tempfile from functools import lru_cache from glob import glob @@ -32,6 +33,7 @@ PYO3_DOCS_TARGET = PYO3_TARGET / "doc" PY_VERSIONS = ("3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13") PYPY_VERSIONS = ("3.9", "3.10") +FREE_THREADED_BUILD = bool(sysconfig.get_config_var("Py_GIL_DISABLED")) @nox.session(venv_backend="none") @@ -48,10 +50,14 @@ def test_rust(session: nox.Session): _run_cargo_test(session, package="pyo3-ffi") _run_cargo_test(session) - _run_cargo_test(session, features="abi3") + # the free-threaded build ignores abi3, so we skip abi3 + # tests to avoid unnecessarily running the tests twice + if not FREE_THREADED_BUILD: + _run_cargo_test(session, features="abi3") if "skip-full" not in session.posargs: _run_cargo_test(session, features="full") - _run_cargo_test(session, features="abi3 full") + if not FREE_THREADED_BUILD: + _run_cargo_test(session, features="abi3 full") @nox.session(name="test-py", venv_backend="none")