Browse Source

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>
pull/5678/merge
Henry Schreiner 1 month ago committed by GitHub
parent
commit
a18b1bc4dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      tests/test_gil_scoped.py
  2. 2
      tools/pybind11Config.cmake.in

6
tests/test_gil_scoped.py

@ -2,6 +2,7 @@ from __future__ import annotations
import multiprocessing import multiprocessing
import sys import sys
import sysconfig
import threading import threading
import time import time
@ -10,8 +11,11 @@ import pytest
import env import env
from pybind11_tests import gil_scoped as m 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( 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", reason="Flaky without the GIL",
) )

2
tools/pybind11Config.cmake.in

@ -94,7 +94,7 @@ you can either use the basic targets, or use the FindPython tools:
target_link_libraries(MyModule2 PUBLIC pybind11::headers) target_link_libraries(MyModule2 PUBLIC pybind11::headers)
set_target_properties(MyModule2 PROPERTIES set_target_properties(MyModule2 PROPERTIES
INTERPROCEDURAL_OPTIMIZATION ON INTERPROCEDURAL_OPTIMIZATION ON
CXX_VISIBILITY_PRESET ON CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON) VISIBILITY_INLINES_HIDDEN ON)
If you build targets yourself, you may be interested in stripping the output If you build targets yourself, you may be interested in stripping the output

Loading…
Cancel
Save