1
0
mirror of https://github.com/pybind/pybind11.git synced 2025-02-28 00:23:20 +00:00
pybind11/tests
Sam Gross baa540ec34
fix: support free-threaded CPython with GIL disabled ()
* Support free-threaded CPython (PEP 703)

Some additional locking is added in the free-threaded build when
`Py_GIL_DISABLED` is defined:

- Most accesses to internals are protected by a single mutex
- The registered_instances uses a striped lock to improve concurrency

Pybind11 modules can indicate support for running with the GIL disabled
by calling `set_gil_not_used()`.

* refactor: use PYBIND11_MODULE ()

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Address code review

* Suppress MSVC warning

* Changes from review

* style: pre-commit fixes

* `py::mod_gil_not_used()` suggestion.

* Update include/pybind11/pybind11.h

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2024-06-18 13:54:38 -07:00
..
extra_python_package fix(cmake): improved cross-compilation support () 2024-06-06 17:17:54 -04:00
extra_setuptools
test_cmake_build fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
test_embed fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
CMakeLists.txt fix(cmake): old cmake boost bug () 2024-05-29 20:33:25 -04:00
conftest.py feat: make numpy.h compatible with both NumPy 1.x and 2.x () 2024-03-26 18:20:11 -04:00
constructor_stats.h
cross_module_gil_utils.cpp fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
cross_module_interleaved_error_already_set.cpp fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
eigen_tensor_avoid_stl_array.cpp fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
env.py fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
local_bindings.h
object.h
pybind11_cross_module_tests.cpp fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
pybind11_tests.cpp fix: support free-threaded CPython with GIL disabled () 2024-06-18 13:54:38 -07:00
pybind11_tests.h
pytest.ini chore: some cleanup () 2024-05-24 12:26:40 -04:00
requirements.txt fix: Use PyObject_VisitManagedDict() of Python 3.13 () 2023-12-14 18:42:55 -08:00
test_async.cpp
test_async.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_buffers.cpp Add format_descriptor<> & npy_format_descriptor<> PyObject * specializations. () 2023-05-23 10:49:32 -07:00
test_buffers.py Update render for buffer sequence and handle () 2023-09-12 12:47:39 -07:00
test_builtin_casters.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_builtin_casters.py fix: Use lowercase builtin collection names () 2023-09-12 12:46:58 -07:00
test_call_policies.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_call_policies.py
test_callbacks.cpp
test_callbacks.py fix: Render py::function as Callable () 2023-08-30 22:43:01 -07:00
test_chrono.cpp
test_chrono.py chore: update to black 23 () 2023-02-01 14:23:37 -05:00
test_class.cpp chore(deps): update pre-commit hooks () 2024-05-10 17:03:51 -04:00
test_class.py fix: Python 3.13t with GIL () 2024-05-28 09:07:59 -04:00
test_const_name.cpp
test_const_name.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_constants_and_functions.cpp tests: hide warning on clang () 2024-03-26 13:57:05 -04:00
test_constants_and_functions.py bugfix: allow noexcept lambdas in C++17. Fix () 2023-03-27 20:21:06 -04:00
test_copy_move.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_copy_move.py
test_custom_type_casters.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_custom_type_casters.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_custom_type_setup.cpp
test_custom_type_setup.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_docstring_options.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_docstring_options.py Add option for enable/disable enum members in docstring. () 2022-12-08 23:10:10 -08:00
test_eigen_matrix.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_eigen_matrix.py feat: make numpy.h compatible with both NumPy 1.x and 2.x () 2024-03-26 18:20:11 -04:00
test_eigen_tensor.cpp Fix ODR violations in our Eigen Tensor tests () 2022-12-20 05:34:00 -08:00
test_eigen_tensor.inl chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_eigen_tensor.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_enum.cpp
test_enum.py chore: move to ruff-format () 2023-11-07 23:42:54 -08:00
test_eval_call.py
test_eval.cpp
test_eval.py
test_exceptions.cpp Bug fixes: Add missing handle_type_name specializations. () 2024-03-27 12:39:05 -07:00
test_exceptions.h Add py::set_error(), use in updated py::exception<> documentation () 2023-08-07 20:48:20 -07:00
test_exceptions.py Bug fixes: Add missing handle_type_name specializations. () 2024-03-27 12:39:05 -07:00
test_factory_constructors.cpp
test_factory_constructors.py Update render for buffer sequence and handle () 2023-09-12 12:47:39 -07:00
test_gil_scoped.cpp
test_gil_scoped.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_iostream.cpp
test_iostream.py chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_kwargs_and_defaults.cpp fix: Python 3.13t with GIL () 2024-05-28 09:07:59 -04:00
test_kwargs_and_defaults.py tests: avoid immortal objects in tests () 2024-05-30 01:40:55 -04:00
test_local_bindings.cpp
test_local_bindings.py chore: update to black 23 () 2023-02-01 14:23:37 -05:00
test_methods_and_attributes.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_methods_and_attributes.py chore: move to ruff-format () 2023-11-07 23:42:54 -08:00
test_modules.cpp
test_modules.py Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): () 2023-03-09 13:02:34 -08:00
test_multiple_inheritance.cpp
test_multiple_inheritance.py
test_numpy_array.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_numpy_array.py feat: make numpy.h compatible with both NumPy 1.x and 2.x () 2024-03-26 18:20:11 -04:00
test_numpy_dtypes.cpp chore(deps): update pre-commit hooks () 2024-05-10 17:03:51 -04:00
test_numpy_dtypes.py chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_numpy_vectorize.cpp
test_numpy_vectorize.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
test_opaque_types.cpp
test_opaque_types.py
test_operator_overloading.cpp
test_operator_overloading.py chore: update to black 23 () 2023-02-01 14:23:37 -05:00
test_pickling.cpp
test_pickling.py
test_python_multiple_inheritance.cpp Fix a long-standing bug in the handling of Python multiple inheritance () 2023-11-08 12:44:04 -08:00
test_python_multiple_inheritance.py Fix a long-standing bug in the handling of Python multiple inheritance () 2023-11-08 12:44:04 -08:00
test_pytypes.cpp Add type[T] support to typing.h () 2024-06-15 06:25:43 -07:00
test_pytypes.py Add type[T] support to typing.h () 2024-06-15 06:25:43 -07:00
test_sequences_and_iterators.cpp feature: Support move-only iterators in py::make_*iterator () 2023-09-07 05:57:39 -07:00
test_sequences_and_iterators.py feature: Use typed iterators in make_*iterator () 2023-10-17 12:04:46 -07:00
test_smart_ptr.cpp Fix Clazy warnings () 2023-12-29 21:59:47 -08:00
test_smart_ptr.py
test_stl_binders.cpp chore(deps): update pre-commit hooks () 2024-04-02 11:14:08 -04:00
test_stl_binders.py bugfix: removing typing and duplicate `class_` for KeysView/ValuesView/ItemsView. Fix () 2024-01-13 11:07:36 -08:00
test_stl.cpp chore(deps): update pre-commit hooks () 2024-05-10 17:03:51 -04:00
test_stl.py fix: Use lowercase builtin collection names () 2023-09-12 12:46:58 -07:00
test_tagbased_polymorphic.cpp
test_tagbased_polymorphic.py
test_thread.cpp chore(deps): update pre-commit hooks () 2024-05-10 17:03:51 -04:00
test_thread.py
test_type_caster_pyobject_ptr.cpp Fix refcount bug involving trampoline functions with PyObject * return type. () 2024-06-11 14:00:52 -07:00
test_type_caster_pyobject_ptr.py Fix refcount bug involving trampoline functions with PyObject * return type. () 2024-06-11 14:00:52 -07:00
test_union.cpp
test_union.py
test_unnamed_namespace_a.cpp Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** () 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_a.py Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** () 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_b.cpp Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** () 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_b.py Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** () 2023-04-25 14:03:24 -07:00
test_vector_unique_ptr_member.cpp Remove stray comment. (Oversight in PR . Noticed by chance.) () 2023-04-27 07:24:48 -07:00
test_vector_unique_ptr_member.py Introduce pybind11::detail::is_move_constructible () 2023-04-24 00:19:21 -07:00
test_virtual_functions.cpp chore(deps): update pre-commit hooks () 2022-12-06 10:10:48 -08:00
test_virtual_functions.py chore: move to Ruff and add rules () 2023-02-22 06:18:55 -08:00
valgrind-numpy-scipy.supp
valgrind-python.supp