Skip to content

Commit 9b6e105

Browse files
committed
fix(ci): set PYTHON_GIL=0 for pytest in free-threaded builds
1 parent 2e43e03 commit 9b6e105

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ before-all = ["./scripts/setup-vcpkg.sh"]
174174
select = "*linux_{aarch64,armv7l,ppc64le,s390x,riscv64}"
175175
environment = { VCPKG_FORCE_SYSTEM_BINARIES = "1" }
176176

177+
# While this doesn't actually support free-threading just yet, we build wheels for it nonetheless,
178+
# even if it results in the GIL being re-enabled on import, just so they're available.
179+
# This results in a RuntimeWarning, which makes tests fail, so explicitly disable the
180+
# GIL for tests to avoid the warning.
181+
[[tool.cibuildwheel.overrides]]
182+
select = "cp*t-"
183+
test-environment = { PYTHON_GIL = "0" }
184+
177185

178186
# Needed for full C++17 support on macOS
179187
[tool.cibuildwheel.macos.environment]

0 commit comments

Comments
 (0)