From 916778df48dc1c05b359ac74303ed18e5104799b Mon Sep 17 00:00:00 2001 From: fred-sch <73998525+fred-sch@users.noreply.github.com> Date: Fri, 2 Aug 2024 21:17:15 +0200 Subject: [PATCH 1/4] fix: typo in documentation (#5284) --- docs/compiling.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/compiling.rst b/docs/compiling.rst index 234f53fb3..0c788335d 100644 --- a/docs/compiling.rst +++ b/docs/compiling.rst @@ -25,7 +25,7 @@ A Python extension module can be created with just a few lines of code: find_package(pybind11 CONFIG REQUIRED) pybind11_add_module(example example.cpp) - install(TARGET example DESTINATION .) + install(TARGETS example DESTINATION .) (You use the ``add_subdirectory`` instead, see the example in :ref:`cmake`.) In this example, the code is located in a file named :file:`example.cpp`. Either From 7c6fe491063d4a7efdfd84c36b3b045cbcd253a0 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 4 Aug 2024 23:16:44 +0700 Subject: [PATCH 2/4] find . -name '*.h' -o -name '*.cpp' -o -name '*.py' | xargs -n 1 -- sed -i 's/PYBIND11_HAVE_/PYBIND11_HAS_/g' (#5286) --- include/pybind11/attr.h | 2 +- include/pybind11/cast.h | 10 +++++----- include/pybind11/detail/init.h | 4 ++-- include/pybind11/detail/internals.h | 4 ++-- include/pybind11/detail/type_caster_base.h | 6 +++--- include/pybind11/detail/using_smart_holder.h | 6 +++--- include/pybind11/pybind11.h | 16 ++++++++-------- include/pybind11/trampoline_self_life_support.h | 4 ++-- tests/class_sh_module_local_0.cpp | 6 +++--- tests/class_sh_module_local_1.cpp | 6 +++--- tests/class_sh_module_local_2.cpp | 6 +++--- tests/test_class.cpp | 2 +- tests/test_class_sh_basic.cpp | 6 +++--- tests/test_class_sh_basic.py | 2 +- tests/test_class_sh_disowning.cpp | 6 +++--- tests/test_class_sh_disowning.py | 2 +- tests/test_class_sh_disowning_mi.cpp | 6 +++--- tests/test_class_sh_disowning_mi.py | 2 +- tests/test_class_sh_factory_constructors.cpp | 6 +++--- tests/test_class_sh_factory_constructors.py | 2 +- tests/test_class_sh_inheritance.cpp | 6 +++--- tests/test_class_sh_inheritance.py | 2 +- tests/test_class_sh_mi_thunks.cpp | 6 +++--- tests/test_class_sh_mi_thunks.py | 2 +- tests/test_class_sh_module_local.py | 2 +- tests/test_class_sh_property.cpp | 6 +++--- tests/test_class_sh_property.py | 2 +- tests/test_class_sh_property_non_owning.cpp | 6 +++--- tests/test_class_sh_property_non_owning.py | 2 +- tests/test_class_sh_shared_ptr_copy_move.cpp | 6 +++--- tests/test_class_sh_shared_ptr_copy_move.py | 2 +- tests/test_class_sh_trampoline_basic.cpp | 12 ++++++------ tests/test_class_sh_trampoline_basic.py | 2 +- ...est_class_sh_trampoline_self_life_support.cpp | 8 ++++---- ...test_class_sh_trampoline_self_life_support.py | 2 +- ...test_class_sh_trampoline_shared_from_this.cpp | 8 ++++---- .../test_class_sh_trampoline_shared_from_this.py | 2 +- ...st_class_sh_trampoline_shared_ptr_cpp_arg.cpp | 6 +++--- ...est_class_sh_trampoline_shared_ptr_cpp_arg.py | 2 +- tests/test_class_sh_trampoline_unique_ptr.cpp | 8 ++++---- tests/test_class_sh_trampoline_unique_ptr.py | 2 +- .../test_class_sh_unique_ptr_custom_deleter.cpp | 6 +++--- tests/test_class_sh_unique_ptr_custom_deleter.py | 2 +- tests/test_class_sh_unique_ptr_member.cpp | 6 +++--- tests/test_class_sh_unique_ptr_member.py | 2 +- tests/test_class_sh_virtual_py_cpp_mix.cpp | 8 ++++---- tests/test_class_sh_virtual_py_cpp_mix.py | 2 +- tests/test_classh_mock.cpp | 2 +- ubench/holder_comparison.cpp | 6 +++--- 49 files changed, 116 insertions(+), 116 deletions(-) diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index 74dc361e3..d7a608666 100644 --- a/include/pybind11/attr.h +++ b/include/pybind11/attr.h @@ -331,7 +331,7 @@ struct type_record { /// Is the class inheritable from python classes? bool is_final : 1; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT holder_enum_t holder_enum_v = holder_enum_t::undefined; #endif diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 656b7666d..d3b3fe072 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -836,7 +836,7 @@ protected: holder_type holder; }; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template struct copyable_holder_caster_shared_ptr_with_smart_holder_support_enabled : std::true_type {}; @@ -963,7 +963,7 @@ protected: smart_holder_type_caster_support::load_helper> sh_load_helper; // Const2Mutbl }; -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT /// Specialize for the common std::shared_ptr, so users don't need to template @@ -985,7 +985,7 @@ struct move_only_holder_caster { static constexpr auto name = type_caster_base::name; }; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template struct move_only_holder_caster_unique_ptr_with_smart_holder_support_enabled : std::true_type {}; @@ -1089,7 +1089,7 @@ public: smart_holder_type_caster_support::load_helper> sh_load_helper; // Const2Mutbl }; -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template class type_caster> @@ -1127,7 +1127,7 @@ struct is_holder_type template struct is_holder_type> : std::true_type {}; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template struct is_holder_type : std::true_type {}; #endif diff --git a/include/pybind11/detail/init.h b/include/pybind11/detail/init.h index af8ec6dd4..ae2e146b8 100644 --- a/include/pybind11/detail/init.h +++ b/include/pybind11/detail/init.h @@ -198,7 +198,7 @@ void construct(value_and_holder &v_h, Alias &&result, bool) { v_h.value_ptr() = new Alias(std::move(result)); } -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template smart_holder init_smart_holder_from_unique_ptr(std::unique_ptr &&unq_ptr, @@ -268,7 +268,7 @@ void construct(value_and_holder &v_h, v_h.type->init_instance(v_h.inst, &smhldr); } -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT // Implementing class for py::init<...>() template diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index d8b5c6b30..f27b0a66d 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -240,7 +240,7 @@ struct internals { #if PYBIND11_INTERNALS_VERSION >= 6 -# define PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +# define PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT enum class holder_enum_t : uint8_t { undefined, @@ -280,7 +280,7 @@ struct type_info { bool default_holder : 1; /* true if this is a type registered with py::module_local */ bool module_local : 1; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT holder_enum_t holder_enum_v = holder_enum_t::undefined; #endif }; diff --git a/include/pybind11/detail/type_caster_base.h b/include/pybind11/detail/type_caster_base.h index c27068785..92415718f 100644 --- a/include/pybind11/detail/type_caster_base.h +++ b/include/pybind11/detail/type_caster_base.h @@ -472,7 +472,7 @@ inline PyThreadState *get_thread_state_unchecked() { void keep_alive_impl(handle nurse, handle patient); inline PyObject *make_new_instance(PyTypeObject *type); -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT // SMART_HOLDER_WIP: Needs refactoring of existing pybind11 code. inline bool deregister_instance(instance *self, void *valptr, const type_info *tinfo); @@ -823,7 +823,7 @@ struct load_helper : value_and_holder_helper { PYBIND11_NAMESPACE_END(smart_holder_type_caster_support) -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT class type_caster_generic { public: @@ -929,7 +929,7 @@ public: // Base methods for generic caster; there are overridden in copyable_holder_caster void load_value(value_and_holder &&v_h) { -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT if (typeinfo->holder_enum_v == detail::holder_enum_t::smart_holder) { smart_holder_type_caster_support::value_and_holder_helper v_h_helper; v_h_helper.loaded_v_h = v_h; diff --git a/include/pybind11/detail/using_smart_holder.h b/include/pybind11/detail/using_smart_holder.h index c47b691d4..3d0463209 100644 --- a/include/pybind11/detail/using_smart_holder.h +++ b/include/pybind11/detail/using_smart_holder.h @@ -9,19 +9,19 @@ #include -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT # include "smart_holder_poc.h" #endif PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT using pybindit::memory::smart_holder; #endif PYBIND11_NAMESPACE_BEGIN(detail) -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template using is_smart_holder = std::is_same; #else diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 0f2b72cff..2a88a94ac 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1424,7 +1424,7 @@ protected: tinfo->simple_ancestors = true; tinfo->default_holder = rec.default_holder; tinfo->module_local = rec.module_local; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT tinfo->holder_enum_v = rec.holder_enum_v; #endif @@ -1631,7 +1631,7 @@ PYBIND11_NAMESPACE_END(detail) template struct property_cpp_function : detail::property_cpp_function_classic {}; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT PYBIND11_NAMESPACE_BEGIN(detail) @@ -1810,10 +1810,10 @@ struct property_cpp_function< detail::both_t_and_d_use_type_caster_base>::value>> : detail::property_cpp_function_sh_unique_ptr_member {}; -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT #if defined(PYBIND11_USE_SMART_HOLDER_AS_DEFAULT) \ - && defined(PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT) + && defined(PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT) // NOTE: THIS IS MEANT FOR STRESS-TESTING ONLY! // As of PR #5257, for production use, there is no longer a strong reason to make // smart_holder the default holder: @@ -1881,7 +1881,7 @@ public: // A more fitting name would be uses_unique_ptr_holder. record.default_holder = detail::is_instantiation::value; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT if (detail::is_instantiation::value) { record.holder_enum_v = detail::holder_enum_t::std_unique_ptr; } else if (detail::is_instantiation::value) { @@ -2226,7 +2226,7 @@ private: init_holder(inst, v_h, (const holder_type *) holder_ptr, v_h.value_ptr()); } -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template static bool try_initialization_using_shared_from_this(holder_type *, WrappedType *, ...) { @@ -2288,7 +2288,7 @@ private: v_h.set_holder_constructed(); } -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT /// Deallocates an instance; via holder, if constructed; otherwise via operator delete. static void dealloc(detail::value_and_holder &v_h) { @@ -2330,7 +2330,7 @@ private: } }; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT // Supports easier switching between py::class_ and py::class_: // users can simply replace the `_` in `class_` with `h` or vice versa. diff --git a/include/pybind11/trampoline_self_life_support.h b/include/pybind11/trampoline_self_life_support.h index 068835726..cef69632a 100644 --- a/include/pybind11/trampoline_self_life_support.h +++ b/include/pybind11/trampoline_self_life_support.h @@ -6,7 +6,7 @@ #include "detail/internals.h" -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT # include "detail/common.h" # include "detail/using_smart_holder.h" @@ -64,4 +64,4 @@ struct trampoline_self_life_support { PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT diff --git a/tests/class_sh_module_local_0.cpp b/tests/class_sh_module_local_0.cpp index 8a0ac0f63..4b570624a 100644 --- a/tests/class_sh_module_local_0.cpp +++ b/tests/class_sh_module_local_0.cpp @@ -19,8 +19,8 @@ atyp rtrn_valu_atyp() { return atyp(); } PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp) PYBIND11_MODULE(class_sh_module_local_0, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -30,5 +30,5 @@ PYBIND11_MODULE(class_sh_module_local_0, m) { m.def("get_mtxt", get_mtxt); m.def("rtrn_valu_atyp", rtrn_valu_atyp); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/class_sh_module_local_1.cpp b/tests/class_sh_module_local_1.cpp index e5a458445..5197d25f9 100644 --- a/tests/class_sh_module_local_1.cpp +++ b/tests/class_sh_module_local_1.cpp @@ -18,8 +18,8 @@ std::string get_mtxt(const atyp &obj) { return obj.mtxt; } PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp) PYBIND11_MODULE(class_sh_module_local_1, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -36,5 +36,5 @@ PYBIND11_MODULE(class_sh_module_local_1, m) { .def("tag", [](const atyp &) { return 1; }); m.def("get_mtxt", get_mtxt); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/class_sh_module_local_2.cpp b/tests/class_sh_module_local_2.cpp index 5dd4104a6..0e3a39ba3 100644 --- a/tests/class_sh_module_local_2.cpp +++ b/tests/class_sh_module_local_2.cpp @@ -18,8 +18,8 @@ std::string get_mtxt(const atyp &obj) { return obj.mtxt; } PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp) PYBIND11_MODULE(class_sh_module_local_2, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -36,5 +36,5 @@ PYBIND11_MODULE(class_sh_module_local_2, m) { .def("tag", [](const atyp &) { return 2; }); m.def("get_mtxt", get_mtxt); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class.cpp b/tests/test_class.cpp index 73ab60907..d15dc3914 100644 --- a/tests/test_class.cpp +++ b/tests/test_class.cpp @@ -93,7 +93,7 @@ TEST_SUBMODULE(class_, m) { struct ToBeHeldByUniquePtr {}; py::class_>(m, "ToBeHeldByUniquePtr") .def(py::init<>()); -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT m.def("pass_unique_ptr", [](std::unique_ptr &&) {}); #else m.attr("pass_unique_ptr") = py::none(); diff --git a/tests/test_class_sh_basic.cpp b/tests/test_class_sh_basic.cpp index 460dd1bd0..9602387b3 100644 --- a/tests/test_class_sh_basic.cpp +++ b/tests/test_class_sh_basic.cpp @@ -145,8 +145,8 @@ namespace pybind11_tests { namespace class_sh_basic { TEST_SUBMODULE(class_sh_basic, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -246,7 +246,7 @@ TEST_SUBMODULE(class_sh_basic, m) { []() { return CastUnusualOpRefConstRef(LocalUnusualOpRef()); }); m.def("CallCastUnusualOpRefMovable", []() { return CastUnusualOpRefMovable(LocalUnusualOpRef()); }); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } } // namespace class_sh_basic diff --git a/tests/test_class_sh_basic.py b/tests/test_class_sh_basic.py index b3d9b98c6..87f1f8f09 100644 --- a/tests/test_class_sh_basic.py +++ b/tests/test_class_sh_basic.py @@ -7,7 +7,7 @@ import pytest from pybind11_tests import class_sh_basic as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_disowning.cpp b/tests/test_class_sh_disowning.cpp index aba3dc819..0474ca1d5 100644 --- a/tests/test_class_sh_disowning.cpp +++ b/tests/test_class_sh_disowning.cpp @@ -32,8 +32,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_disowning::Atype<1>) PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_disowning::Atype<2>) TEST_SUBMODULE(class_sh_disowning, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -49,5 +49,5 @@ TEST_SUBMODULE(class_sh_disowning, m) { m.def("overloaded", (int (*)(std::unique_ptr>, int)) & overloaded); m.def("overloaded", (int (*)(std::unique_ptr>, int)) & overloaded); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_disowning.py b/tests/test_class_sh_disowning.py index 36e461012..5e2918e0e 100644 --- a/tests/test_class_sh_disowning.py +++ b/tests/test_class_sh_disowning.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_disowning as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_disowning_mi.cpp b/tests/test_class_sh_disowning_mi.cpp index 1bba40154..c18529b22 100644 --- a/tests/test_class_sh_disowning_mi.cpp +++ b/tests/test_class_sh_disowning_mi.cpp @@ -57,8 +57,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_disowning_mi::Base1) PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_disowning_mi::Base2) TEST_SUBMODULE(class_sh_disowning_mi, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -98,5 +98,5 @@ TEST_SUBMODULE(class_sh_disowning_mi, m) { py::classh(m, "Base2").def(py::init()).def("bar", &Base2::bar); m.def("disown_base1", disown_base1); m.def("disown_base2", disown_base2); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_disowning_mi.py b/tests/test_class_sh_disowning_mi.py index 781db8c0e..238a76f2a 100644 --- a/tests/test_class_sh_disowning_mi.py +++ b/tests/test_class_sh_disowning_mi.py @@ -5,7 +5,7 @@ import pytest import env # noqa: F401 from pybind11_tests import class_sh_disowning_mi as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_factory_constructors.cpp b/tests/test_class_sh_factory_constructors.cpp index 7ee56a8b4..1e40ed96f 100644 --- a/tests/test_class_sh_factory_constructors.cpp +++ b/tests/test_class_sh_factory_constructors.cpp @@ -87,8 +87,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_factory_constructors PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_factory_constructors::with_alias) TEST_SUBMODULE(class_sh_factory_constructors, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -183,5 +183,5 @@ TEST_SUBMODULE(class_sh_factory_constructors, m) { [](int, int, int, int, int) { return std::make_shared(); // Invalid alias factory. })); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_factory_constructors.py b/tests/test_class_sh_factory_constructors.py index 38e529e55..0ea930120 100644 --- a/tests/test_class_sh_factory_constructors.py +++ b/tests/test_class_sh_factory_constructors.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_factory_constructors as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_inheritance.cpp b/tests/test_class_sh_inheritance.cpp index af57f03bd..ebcca2c08 100644 --- a/tests/test_class_sh_inheritance.cpp +++ b/tests/test_class_sh_inheritance.cpp @@ -73,8 +73,8 @@ namespace pybind11_tests { namespace class_sh_inheritance { TEST_SUBMODULE(class_sh_inheritance, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -105,7 +105,7 @@ TEST_SUBMODULE(class_sh_inheritance, m) { m.def("pass_cptr_base1", pass_cptr_base1); m.def("pass_cptr_base2", pass_cptr_base2); m.def("pass_cptr_drvd2", pass_cptr_drvd2); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } } // namespace class_sh_inheritance diff --git a/tests/test_class_sh_inheritance.py b/tests/test_class_sh_inheritance.py index f03cee36b..2b681aa84 100644 --- a/tests/test_class_sh_inheritance.py +++ b/tests/test_class_sh_inheritance.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_inheritance as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_mi_thunks.cpp b/tests/test_class_sh_mi_thunks.cpp index 0990c34fc..edf847269 100644 --- a/tests/test_class_sh_mi_thunks.cpp +++ b/tests/test_class_sh_mi_thunks.cpp @@ -40,8 +40,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(test_class_sh_mi_thunks::Base1) PYBIND11_SMART_HOLDER_TYPE_CASTERS(test_class_sh_mi_thunks::Derived) TEST_SUBMODULE(class_sh_mi_thunks, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -103,5 +103,5 @@ TEST_SUBMODULE(class_sh_mi_thunks, m) { } return obj_der->vec.size(); }); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_mi_thunks.py b/tests/test_class_sh_mi_thunks.py index 12b6e9d96..65983b764 100644 --- a/tests/test_class_sh_mi_thunks.py +++ b/tests/test_class_sh_mi_thunks.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_mi_thunks as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_module_local.py b/tests/test_class_sh_module_local.py index 79ccb8b42..9f4230052 100644 --- a/tests/test_class_sh_module_local.py +++ b/tests/test_class_sh_module_local.py @@ -5,7 +5,7 @@ import class_sh_module_local_1 as m1 import class_sh_module_local_2 as m2 import pytest -if not m0.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m0.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_property.cpp b/tests/test_class_sh_property.cpp index db744fae4..cb8cd21ab 100644 --- a/tests/test_class_sh_property.cpp +++ b/tests/test_class_sh_property.cpp @@ -58,8 +58,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(test_class_sh_property::WithCharArrayMember) PYBIND11_SMART_HOLDER_TYPE_CASTERS(test_class_sh_property::WithConstCharPtrMember) TEST_SUBMODULE(class_sh_property, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -109,5 +109,5 @@ TEST_SUBMODULE(class_sh_property, m) { py::classh(m, "WithConstCharPtrMember") .def(py::init<>()) .def_readonly("const_char_ptr_member", &WithConstCharPtrMember::const_char_ptr_member); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_property.py b/tests/test_class_sh_property.py index dda786a21..b9d402135 100644 --- a/tests/test_class_sh_property.py +++ b/tests/test_class_sh_property.py @@ -7,7 +7,7 @@ import pytest import env # noqa: F401 from pybind11_tests import class_sh_property as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_property_non_owning.cpp b/tests/test_class_sh_property_non_owning.cpp index 65103148f..e5f24bd78 100644 --- a/tests/test_class_sh_property_non_owning.cpp +++ b/tests/test_class_sh_property_non_owning.cpp @@ -51,8 +51,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(DataField) PYBIND11_SMART_HOLDER_TYPE_CASTERS(DataFieldsHolder) TEST_SUBMODULE(class_sh_property_non_owning, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -71,5 +71,5 @@ TEST_SUBMODULE(class_sh_property_non_owning, m) { py::classh(m, "DataFieldsHolder") .def(py::init()) .def("vec_at", &DataFieldsHolder::vec_at, py::return_value_policy::reference_internal); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_property_non_owning.py b/tests/test_class_sh_property_non_owning.py index 89c7c0cd5..163681fa9 100644 --- a/tests/test_class_sh_property_non_owning.py +++ b/tests/test_class_sh_property_non_owning.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_property_non_owning as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_shared_ptr_copy_move.cpp b/tests/test_class_sh_shared_ptr_copy_move.cpp index 3e9eb9ac9..fd79d3d1b 100644 --- a/tests/test_class_sh_shared_ptr_copy_move.cpp +++ b/tests/test_class_sh_shared_ptr_copy_move.cpp @@ -50,8 +50,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::FooSmHld) namespace pybind11_tests { TEST_SUBMODULE(class_sh_shared_ptr_copy_move, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -113,7 +113,7 @@ TEST_SUBMODULE(class_sh_shared_ptr_copy_move, m) { l.append(std::move(o)); return l; }); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } } // namespace pybind11_tests diff --git a/tests/test_class_sh_shared_ptr_copy_move.py b/tests/test_class_sh_shared_ptr_copy_move.py index 092aa1f3f..445a657ff 100644 --- a/tests/test_class_sh_shared_ptr_copy_move.py +++ b/tests/test_class_sh_shared_ptr_copy_move.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_shared_ptr_copy_move as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_trampoline_basic.cpp b/tests/test_class_sh_trampoline_basic.cpp index faadb4024..bfff9520e 100644 --- a/tests/test_class_sh_trampoline_basic.cpp +++ b/tests/test_class_sh_trampoline_basic.cpp @@ -34,7 +34,7 @@ struct AbaseAlias : Abase { } }; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template <> struct AbaseAlias<1> : Abase<1>, py::trampoline_self_life_support { using Abase<1>::Abase; @@ -46,7 +46,7 @@ struct AbaseAlias<1> : Abase<1>, py::trampoline_self_life_support { other_val); } }; -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template int AddInCppRawPtr(const Abase *obj, int other_val) { @@ -65,7 +65,7 @@ int AddInCppUniquePtr(std::unique_ptr> obj, int other_val) { template void wrap(py::module_ m, const char *py_class_name) { -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT py::classh, AbaseAlias>(m, py_class_name) .def(py::init(), py::arg("val")) .def("Get", &Abase::Get) @@ -86,13 +86,13 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(Abase<0>) PYBIND11_SMART_HOLDER_TYPE_CASTERS(Abase<1>) TEST_SUBMODULE(class_sh_trampoline_basic, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; wrap<0>(m, "Abase0"); wrap<1>(m, "Abase1"); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_trampoline_basic.py b/tests/test_class_sh_trampoline_basic.py index 7b6e1a0fc..ba3f94d67 100644 --- a/tests/test_class_sh_trampoline_basic.py +++ b/tests/test_class_sh_trampoline_basic.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_trampoline_basic as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_trampoline_self_life_support.cpp b/tests/test_class_sh_trampoline_self_life_support.cpp index 859b9f8fb..68e91aa3a 100644 --- a/tests/test_class_sh_trampoline_self_life_support.cpp +++ b/tests/test_class_sh_trampoline_self_life_support.cpp @@ -38,7 +38,7 @@ protected: Big5() : history{"DefaultConstructor"} {} }; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT struct Big5Trampoline : Big5, py::trampoline_self_life_support { using Big5::Big5; }; @@ -52,8 +52,8 @@ using namespace pybind11_tests::class_sh_trampoline_self_life_support; PYBIND11_SMART_HOLDER_TYPE_CASTERS(Big5) TEST_SUBMODULE(class_sh_trampoline_self_life_support, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -94,5 +94,5 @@ TEST_SUBMODULE(class_sh_trampoline_self_life_support, m) { py::object o1 = py::cast(std::move(obj)); return py::make_tuple(o1, o2); }); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_trampoline_self_life_support.py b/tests/test_class_sh_trampoline_self_life_support.py index d366b48c6..8aab5d9d5 100644 --- a/tests/test_class_sh_trampoline_self_life_support.py +++ b/tests/test_class_sh_trampoline_self_life_support.py @@ -4,7 +4,7 @@ import pytest import pybind11_tests.class_sh_trampoline_self_life_support as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_trampoline_shared_from_this.cpp b/tests/test_class_sh_trampoline_shared_from_this.cpp index aaf5a8750..e5d688af6 100644 --- a/tests/test_class_sh_trampoline_shared_from_this.cpp +++ b/tests/test_class_sh_trampoline_shared_from_this.cpp @@ -71,7 +71,7 @@ struct SftSharedPtrStash { } }; -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT struct SftTrampoline : Sft, py::trampoline_self_life_support { using Sft::Sft; }; @@ -110,8 +110,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(Sft) PYBIND11_SMART_HOLDER_TYPE_CASTERS(SftSharedPtrStash) TEST_SUBMODULE(class_sh_trampoline_shared_from_this, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -140,5 +140,5 @@ TEST_SUBMODULE(class_sh_trampoline_shared_from_this, m) { m.def("make_pure_cpp_sft_unq_ptr", make_pure_cpp_sft_unq_ptr); m.def("make_pure_cpp_sft_shd_ptr", make_pure_cpp_sft_shd_ptr); m.def("pass_through_shd_ptr", pass_through_shd_ptr); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_trampoline_shared_from_this.py b/tests/test_class_sh_trampoline_shared_from_this.py index 755584214..a074b20a1 100644 --- a/tests/test_class_sh_trampoline_shared_from_this.py +++ b/tests/test_class_sh_trampoline_shared_from_this.py @@ -8,7 +8,7 @@ import pytest import env import pybind11_tests.class_sh_trampoline_shared_from_this as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.cpp b/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.cpp index 2b94310b5..d9605c8c0 100644 --- a/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.cpp +++ b/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.cpp @@ -63,8 +63,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(SpGoAway) PYBIND11_SMART_HOLDER_TYPE_CASTERS(SpGoAwayTester) TEST_SUBMODULE(class_sh_trampoline_shared_ptr_cpp_arg, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -101,5 +101,5 @@ TEST_SUBMODULE(class_sh_trampoline_shared_ptr_cpp_arg, m) { py::classh(m, "SpGoAwayTester") .def(py::init<>()) .def_readwrite("obj", &SpGoAwayTester::m_obj); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.py b/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.py index 54575ddcc..13daeee23 100644 --- a/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.py +++ b/tests/test_class_sh_trampoline_shared_ptr_cpp_arg.py @@ -4,7 +4,7 @@ import pytest import pybind11_tests.class_sh_trampoline_shared_ptr_cpp_arg as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_trampoline_unique_ptr.cpp b/tests/test_class_sh_trampoline_unique_ptr.cpp index 13dc27b04..d5406c9e8 100644 --- a/tests/test_class_sh_trampoline_unique_ptr.cpp +++ b/tests/test_class_sh_trampoline_unique_ptr.cpp @@ -39,7 +39,7 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_trampoline_unique_pt namespace pybind11_tests { namespace class_sh_trampoline_unique_ptr { -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT class PyClass : public Class, public py::trampoline_self_life_support { public: std::unique_ptr clone() const override { @@ -54,8 +54,8 @@ public: } // namespace pybind11_tests TEST_SUBMODULE(class_sh_trampoline_unique_ptr, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -71,5 +71,5 @@ TEST_SUBMODULE(class_sh_trampoline_unique_ptr, m) { m.def("clone", [](const Class &obj) { return obj.clone(); }); m.def("clone_and_foo", [](const Class &obj) { return obj.clone()->foo(); }); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_trampoline_unique_ptr.py b/tests/test_class_sh_trampoline_unique_ptr.py index 22505dc6e..893f3ae66 100644 --- a/tests/test_class_sh_trampoline_unique_ptr.py +++ b/tests/test_class_sh_trampoline_unique_ptr.py @@ -4,7 +4,7 @@ import pytest import pybind11_tests.class_sh_trampoline_unique_ptr as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_unique_ptr_custom_deleter.cpp b/tests/test_class_sh_unique_ptr_custom_deleter.cpp index 973bf4908..e71d34dcf 100644 --- a/tests/test_class_sh_unique_ptr_custom_deleter.cpp +++ b/tests/test_class_sh_unique_ptr_custom_deleter.cpp @@ -31,8 +31,8 @@ namespace pybind11_tests { namespace class_sh_unique_ptr_custom_deleter { TEST_SUBMODULE(class_sh_unique_ptr_custom_deleter, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -40,7 +40,7 @@ TEST_SUBMODULE(class_sh_unique_ptr_custom_deleter, m) { py::classh(m, "Pet").def_readwrite("name", &Pet::name); m.def("create", &Pet::New); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } } // namespace class_sh_unique_ptr_custom_deleter diff --git a/tests/test_class_sh_unique_ptr_custom_deleter.py b/tests/test_class_sh_unique_ptr_custom_deleter.py index f246e2d7e..fbe7e5992 100644 --- a/tests/test_class_sh_unique_ptr_custom_deleter.py +++ b/tests/test_class_sh_unique_ptr_custom_deleter.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_unique_ptr_custom_deleter as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_unique_ptr_member.cpp b/tests/test_class_sh_unique_ptr_member.cpp index 1341f140e..410c65ab2 100644 --- a/tests/test_class_sh_unique_ptr_member.cpp +++ b/tests/test_class_sh_unique_ptr_member.cpp @@ -45,8 +45,8 @@ namespace pybind11_tests { namespace class_sh_unique_ptr_member { TEST_SUBMODULE(class_sh_unique_ptr_member, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -60,7 +60,7 @@ TEST_SUBMODULE(class_sh_unique_ptr_member, m) { .def("is_owner", &ptr_owner::is_owner) .def("give_up_ownership_via_unique_ptr", &ptr_owner::give_up_ownership_via_unique_ptr) .def("give_up_ownership_via_shared_ptr", &ptr_owner::give_up_ownership_via_shared_ptr); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } } // namespace class_sh_unique_ptr_member diff --git a/tests/test_class_sh_unique_ptr_member.py b/tests/test_class_sh_unique_ptr_member.py index dc1d5482f..56ca8d067 100644 --- a/tests/test_class_sh_unique_ptr_member.py +++ b/tests/test_class_sh_unique_ptr_member.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_unique_ptr_member as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_class_sh_virtual_py_cpp_mix.cpp b/tests/test_class_sh_virtual_py_cpp_mix.cpp index a68cb76aa..7184322ab 100644 --- a/tests/test_class_sh_virtual_py_cpp_mix.cpp +++ b/tests/test_class_sh_virtual_py_cpp_mix.cpp @@ -31,7 +31,7 @@ int get_from_cpp_plainc_ptr(const Base *b) { return b->get() + 4000; } int get_from_cpp_unique_ptr(std::unique_ptr b) { return b->get() + 5000; } -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT struct BaseVirtualOverrider : Base, py::trampoline_self_life_support { using Base::Base; @@ -57,8 +57,8 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(CppDerivedPlain) PYBIND11_SMART_HOLDER_TYPE_CASTERS(CppDerived) TEST_SUBMODULE(class_sh_virtual_py_cpp_mix, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT + m.attr("defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = +#ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT false; #else true; @@ -71,5 +71,5 @@ TEST_SUBMODULE(class_sh_virtual_py_cpp_mix, m) { m.def("get_from_cpp_plainc_ptr", get_from_cpp_plainc_ptr, py::arg("b")); m.def("get_from_cpp_unique_ptr", get_from_cpp_unique_ptr, py::arg("b")); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#endif // PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT } diff --git a/tests/test_class_sh_virtual_py_cpp_mix.py b/tests/test_class_sh_virtual_py_cpp_mix.py index 3361713c7..76bb09a49 100644 --- a/tests/test_class_sh_virtual_py_cpp_mix.py +++ b/tests/test_class_sh_virtual_py_cpp_mix.py @@ -4,7 +4,7 @@ import pytest from pybind11_tests import class_sh_virtual_py_cpp_mix as m -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: +if not m.defined_PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT: pytest.skip("smart_holder not available.", allow_module_level=True) diff --git a/tests/test_classh_mock.cpp b/tests/test_classh_mock.cpp index 135320320..51be4ae08 100644 --- a/tests/test_classh_mock.cpp +++ b/tests/test_classh_mock.cpp @@ -11,7 +11,7 @@ #else # include PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) -# ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +# ifndef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template using classh = class_; # endif diff --git a/ubench/holder_comparison.cpp b/ubench/holder_comparison.cpp index f532bcfdc..f9673b573 100644 --- a/ubench/holder_comparison.cpp +++ b/ubench/holder_comparison.cpp @@ -22,7 +22,7 @@ void wrap_number_bucket(py::module m, const char *class_name) { .def("add", &WrappedType::add, py::arg("other")); } -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT template class padded_unique_ptr { @@ -41,7 +41,7 @@ static_assert(sizeof(padded_unique_ptr) == sizeof(py::smart_holder), } // namespace hc -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT PYBIND11_DECLARE_HOLDER_TYPE(T, hc::padded_unique_ptr); #endif @@ -49,7 +49,7 @@ PYBIND11_MODULE(pybind11_ubench_holder_comparison, m) { using namespace hc; wrap_number_bucket>(m, "number_bucket_up"); wrap_number_bucket>(m, "number_bucket_sp"); -#ifdef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT +#ifdef PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT m.def("sizeof_smart_holder", []() { return sizeof(py::smart_holder); }); wrap_number_bucket>(m, "number_bucket_pu"); wrap_number_bucket(m, "number_bucket_sh"); From 845105383f4a80666330cbf1c9fefa373cbb7425 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:07:55 -0400 Subject: [PATCH 3/4] chore(deps): bump the actions group with 2 updates (#5287) Bumps the actions group with 2 updates: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) and [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance). Updates `pypa/cibuildwheel` from 2.19 to 2.20 - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.19...v2.20) Updates `actions/attest-build-provenance` from 1.3.3 to 1.4.0 - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest-build-provenance/compare/5e9cb68e95676991667494a6a4e59b8a2f13e1d0...210c1913531870065f03ce1f9440dd87bc0938cd) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: actions/attest-build-provenance dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/emscripten.yaml | 2 +- .github/workflows/pip.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/emscripten.yaml b/.github/workflows/emscripten.yaml index 4f12e81c2..cbd7f5d54 100644 --- a/.github/workflows/emscripten.yaml +++ b/.github/workflows/emscripten.yaml @@ -20,7 +20,7 @@ jobs: submodules: true fetch-depth: 0 - - uses: pypa/cibuildwheel@v2.19 + - uses: pypa/cibuildwheel@v2.20 env: PYODIDE_BUILD_EXPORTS: whole_archive CFLAGS: -fexceptions diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index c1acb8bb4..75074ff7f 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -102,7 +102,7 @@ jobs: - uses: actions/download-artifact@v4 - name: Generate artifact attestation for sdist and wheel - uses: actions/attest-build-provenance@5e9cb68e95676991667494a6a4e59b8a2f13e1d0 # v1.3.3 + uses: actions/attest-build-provenance@210c1913531870065f03ce1f9440dd87bc0938cd # v1.4.0 with: subject-path: "*/pybind11*" From 20551ab3d8de4afd85738e3b31cd9378017da1c4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:19:10 -0700 Subject: [PATCH 4/4] chore(deps): update pre-commit hooks (#5288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.5.6) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.1) - [github.com/PyCQA/pylint: v3.2.4 → v3.2.6](https://github.com/PyCQA/pylint/compare/v3.2.4...v3.2.6) - [github.com/python-jsonschema/check-jsonschema: 0.28.6 → 0.29.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.28.6...0.29.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92469eb37..ecac1cbaf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: # Ruff, the Python auto-correcting linter/formatter written in Rust - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.5.6 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -40,7 +40,7 @@ repos: # Check static types with mypy - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.10.1" + rev: "v1.11.1" hooks: - id: mypy args: [] @@ -142,14 +142,14 @@ repos: # PyLint has native support - not always usable, but works for us - repo: https://github.com/PyCQA/pylint - rev: "v3.2.4" + rev: "v3.2.6" hooks: - id: pylint files: ^pybind11 # Check schemas on some of our YAML files - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.6 + rev: 0.29.1 hooks: - id: check-readthedocs - id: check-github-workflows