pybind11/tests
Ralf W. Grosse-Kunstleve 48f25275c4
[smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257)
* Put bakein branch @ 18b72c0ffa on top of smart_holder branch:

Commands used:

```
git checkout bakein
git diff smart_holder > ~/zd
git checkout smart_holder
git checkout -b bakein_sh
patch -p 1 < ~/zd
git checkout smart_holder \
MANIFEST.in \
README.rst \
README_smart_holder.rst \
docs/advanced/smart_ptrs.rst \
ubench/holder_comparison.cpp \
ubench/holder_comparison.py \
ubench/holder_comparison_extract_sheet_data.py \
ubench/number_bucket.h \
ubench/python/number_bucket.clif
git add -A
```

* Add back README_smart_holder.rst in tests/extra_python_package/test_files.py

* Restore smart_holder_poc.h as-is on smart_holder branch (i.e. undo `PYBIND11_SMART_HOLDER_PADDING`, which was meant for stress-testing only).

* Insert `std::move()` as suggested by @laramiel

* `property_cpp_function_sh_*` named specializations, as suggested by @laramiel (https://github.com/pybind/pybind11/pull/5257#discussion_r1688346807)

* Call `property_cpp_function_classic` member functions, rather than inlining the implementations.

* Use `PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT` in holder_comparison.cpp (holder_comparison.py is NOT changed accordingly in this commit, i.e. can still only be run if the smart_holder functionality is available).

* Systematically rename `loaded_as` to `load_as` (`shared_ptr`, `unique_ptr`) as suggested by @laramiel

* Make change as suggested by @laramiel. This makes it much more obvious that the latest implementation of `smart_holder_from_unique_ptr()` accepts all existing `return_value_policy` enum values except `copy`.

* Resolve `BAKEIN_WIP: Rewrite comment.` for `property_cpp_function_*` specializations.

* Resolve `BAKEIN_WIP: Add comment to explain: This is meant for stress-testing only.`

* Resolve all remaining BAKEIN_WIP (in pybind11/cast.h).

Leave only two pairs of SMART_HOLDER_BAKEIN_FOLLOW_ON comments: refactoring of copyable_holder_caster, move_only_holder_caster. This is best left until after the smart_holder branch is merged into the master branch.

* Remove obsolete `using holder_type = smart_holder;` in `load_helper`

* Add SMART_HOLDER_BAKEIN_FOLLOW_ON comment for `internals::default_holder`

* README_smart_holder.rst update (line count reduced from 356 to 123).
2024-07-31 06:17:31 -07:00
..
extra_python_package [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
extra_setuptools feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
pure_cpp Add NOLINTNEXTLINE(bugprone-unused-return-value) in smart_holder_poc_test.cpp 2024-07-29 19:31:30 -07:00
test_cmake_build feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_embed [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
class_sh_module_local_0.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
class_sh_module_local_1.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
class_sh_module_local_2.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
CMakeLists.txt Remove type_caster_odr_guard feature. (The feature will continue to live in the pybind11k repo.) (#5255) 2024-07-19 23:55:22 -07:00
conftest.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
constructor_stats.h clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
cross_module_gil_utils.cpp fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
cross_module_interleaved_error_already_set.cpp fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
eigen_tensor_avoid_stl_array.cpp fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
env.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
local_bindings.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
object.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
pybind11_cross_module_tests.cpp fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
pybind11_tests.cpp fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
pybind11_tests.h fix: use std::addressof in type_caster_base.h (#5189) 2024-06-24 08:59:55 -07:00
pyproject.toml tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
pytest.ini chore: some cleanup (#5137) 2024-05-24 12:26:40 -04:00
requirements.txt feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
test_async.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_async.py tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
test_buffers.cpp Add format_descriptor<> & npy_format_descriptor<> PyObject * specializations. (#4674) 2023-05-23 10:49:32 -07:00
test_buffers.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_builtin_casters.cpp Revert "[smart_holder] Add a new return value policy return_as_bytes (#3838)" 2024-06-11 14:12:14 -07:00
test_builtin_casters.py feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
test_call_policies.cpp feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_call_policies.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_callbacks.cpp Fix functional.h bug + introduce test to verify that it is fixed (#4254) 2022-11-18 10:08:11 -08:00
test_callbacks.py tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
test_chrono.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_chrono.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_class_sh_basic.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_basic.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_disowning_mi.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_disowning_mi.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_disowning.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_disowning.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_factory_constructors.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_factory_constructors.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_inheritance.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_inheritance.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_mi_thunks.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_mi_thunks.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_module_local.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_property_non_owning.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_property_non_owning.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_property.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_property.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_shared_ptr_copy_move.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_shared_ptr_copy_move.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_basic.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_basic.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_self_life_support.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_self_life_support.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_shared_from_this.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_shared_from_this.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_shared_ptr_cpp_arg.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_shared_ptr_cpp_arg.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_unique_ptr.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_trampoline_unique_ptr.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_unique_ptr_custom_deleter.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_unique_ptr_custom_deleter.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_unique_ptr_member.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_unique_ptr_member.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_virtual_py_cpp_mix.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class_sh_virtual_py_cpp_mix.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_class.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_classh_mock.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_classh_mock.py ruff automatic fixes: from __future__ import annotations 2024-06-21 23:00:13 -07:00
test_const_name.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_const_name.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_constants_and_functions.cpp tests: hide warning on clang (#5069) 2024-03-26 13:57:05 -04:00
test_constants_and_functions.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_copy_move.cpp fix: use std::addressof in type_caster_base.h (#5189) 2024-06-24 08:59:55 -07:00
test_copy_move.py fix: use std::addressof in type_caster_base.h (#5189) 2024-06-24 08:59:55 -07:00
test_custom_type_casters.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_custom_type_casters.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_custom_type_setup.cpp Add custom_type_setup attribute (#3287) 2021-09-24 12:08:22 -07:00
test_custom_type_setup.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_docstring_options.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_docstring_options.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_eigen_matrix.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_eigen_matrix.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_eigen_tensor.cpp Fix ODR violations in our Eigen Tensor tests (#4412) 2022-12-20 05:34:00 -08:00
test_eigen_tensor.inl clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
test_eigen_tensor.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_enum.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_enum.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_eval_call.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_eval.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_eval.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_exceptions.cpp Bug fixes: Add missing handle_type_name specializations. (#5073) 2024-03-27 12:39:05 -07:00
test_exceptions.h Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
test_exceptions.py feat: remove Python 3.7 support (#5191) 2024-07-30 09:18:35 -07:00
test_factory_constructors.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_factory_constructors.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_gil_scoped.cpp Add PYBIND11_SIMPLE_GIL_MANAGEMENT option (cmake, C++ define) (#4216) 2022-10-30 08:57:23 -07:00
test_gil_scoped.py tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
test_iostream.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_iostream.py tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
test_kwargs_and_defaults.cpp fix: Python 3.13t with GIL (#5139) 2024-05-28 09:07:59 -04:00
test_kwargs_and_defaults.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_local_bindings.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_local_bindings.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_methods_and_attributes.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_methods_and_attributes.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_modules.cpp clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
test_modules.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_multiple_inheritance.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_multiple_inheritance.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_numpy_array.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_numpy_array.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_numpy_dtypes.cpp clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
test_numpy_dtypes.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_numpy_vectorize.cpp fix: avoid catch (...) for expected import numpy failures (#3974) 2022-05-26 11:07:40 -04:00
test_numpy_vectorize.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_opaque_types.cpp clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
test_opaque_types.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_operator_overloading.cpp Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_operator_overloading.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_pickling.cpp Test pickling a simple callable (does not work). (#3906) 2022-05-02 12:39:36 -07:00
test_pickling.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_python_multiple_inheritance.cpp Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2023-11-08 12:44:04 -08:00
test_python_multiple_inheritance.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_pytypes.cpp fix: add guard for GCC <10.3 on C++20 (#5205) 2024-06-27 22:20:28 -07:00
test_pytypes.py fix: add guard for GCC <10.3 on C++20 (#5205) 2024-06-27 22:20:28 -07:00
test_sequences_and_iterators.cpp feature: Support move-only iterators in py::make_*iterator (#4834) 2023-09-07 05:57:39 -07:00
test_sequences_and_iterators.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_smart_ptr.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_smart_ptr.py [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_stl_binders.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_stl_binders.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_stl.cpp Revert "[smart_holder] Add a new return value policy return_as_bytes (#3838)" 2024-06-11 14:12:14 -07:00
test_stl.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_tagbased_polymorphic.cpp clang-tidy upgrade (to version 18) (#5272) 2024-07-29 11:10:03 -07:00
test_tagbased_polymorphic.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_thread.cpp chore(deps): update pre-commit hooks (#5123) 2024-05-10 17:03:51 -04:00
test_thread.py tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
test_type_caster_pyobject_ptr.cpp Fix refcount bug involving trampoline functions with PyObject * return type. (#5156) 2024-06-11 14:00:52 -07:00
test_type_caster_pyobject_ptr.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_union.cpp Fix assertion failure for unions (#1685) (#1709) 2019-06-11 23:28:58 +02:00
test_union.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_unnamed_namespace_a.cpp Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** (#4319) 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_a.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04: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** (#4319) 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_b.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_vector_unique_ptr_member.cpp Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 2023-04-27 07:24:48 -07:00
test_vector_unique_ptr_member.py feat: remove Python 3.6 support (#5177) 2024-06-22 00:55:00 -04:00
test_virtual_functions.cpp [smart_holder] Bake smart_holder functionality into class_ and type_caster_base (#5257) 2024-07-31 06:17:31 -07:00
test_virtual_functions.py tests: run on pyodide (#4745) 2024-07-18 14:50:38 -04:00
valgrind-numpy-scipy.supp docs: fix various typos (#3075) 2021-07-04 19:58:35 -04:00
valgrind-python.supp chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 2021-01-31 17:29:09 -05:00