mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
tests: always disable on the nogil build (#5701)
* docs: fix docs on visibilty preset hidden Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: always disable on the nogil build Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * style: pre-commit fixes * docs: mention skip reason in comment Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import multiprocessing
|
||||
import sys
|
||||
import sysconfig
|
||||
import threading
|
||||
import time
|
||||
|
||||
@@ -10,8 +11,11 @@ import pytest
|
||||
import env
|
||||
from pybind11_tests import gil_scoped as m
|
||||
|
||||
# Test collection seems to hold the gil
|
||||
# These tests have rare flakes in nogil; since they
|
||||
# are testing the gil, they are skipped at the moment.
|
||||
skipif_not_free_threaded = pytest.mark.skipif(
|
||||
not getattr(sys, "_is_gil_enabled", lambda: True)(),
|
||||
sysconfig.get_config_var("Py_GIL_DISABLED"),
|
||||
reason="Flaky without the GIL",
|
||||
)
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ you can either use the basic targets, or use the FindPython tools:
|
||||
target_link_libraries(MyModule2 PUBLIC pybind11::headers)
|
||||
set_target_properties(MyModule2 PROPERTIES
|
||||
INTERPROCEDURAL_OPTIMIZATION ON
|
||||
CXX_VISIBILITY_PRESET ON
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
VISIBILITY_INLINES_HIDDEN ON)
|
||||
|
||||
If you build targets yourself, you may be interested in stripping the output
|
||||
|
||||
Reference in New Issue
Block a user