Skip to content

Commit a18b1bc

Browse files
tests: always disable on the nogil build (#5701)
* docs: fix docs on visibilty preset hidden Signed-off-by: Henry Schreiner <[email protected]> * tests: always disable on the nogil build Signed-off-by: Henry Schreiner <[email protected]> * style: pre-commit fixes * docs: mention skip reason in comment Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 57e27c1 commit a18b1bc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/test_gil_scoped.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import multiprocessing
44
import sys
5+
import sysconfig
56
import threading
67
import time
78

@@ -10,8 +11,11 @@
1011
import env
1112
from pybind11_tests import gil_scoped as m
1213

14+
# Test collection seems to hold the gil
15+
# These tests have rare flakes in nogil; since they
16+
# are testing the gil, they are skipped at the moment.
1317
skipif_not_free_threaded = pytest.mark.skipif(
14-
not getattr(sys, "_is_gil_enabled", lambda: True)(),
18+
sysconfig.get_config_var("Py_GIL_DISABLED"),
1519
reason="Flaky without the GIL",
1620
)
1721

tools/pybind11Config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ you can either use the basic targets, or use the FindPython tools:
9494
target_link_libraries(MyModule2 PUBLIC pybind11::headers)
9595
set_target_properties(MyModule2 PROPERTIES
9696
INTERPROCEDURAL_OPTIMIZATION ON
97-
CXX_VISIBILITY_PRESET ON
97+
CXX_VISIBILITY_PRESET hidden
9898
VISIBILITY_INLINES_HIDDEN ON)
9999
100100
If you build targets yourself, you may be interested in stripping the output

0 commit comments

Comments
 (0)