diff --git a/robotpy_build/autowrap/render_pybind11.py b/robotpy_build/autowrap/render_pybind11.py index bdc5df04..483bb74d 100644 --- a/robotpy_build/autowrap/render_pybind11.py +++ b/robotpy_build/autowrap/render_pybind11.py @@ -338,6 +338,8 @@ def cls_decl(r: RenderBuffer, cls: ClassContext): class_params.append( f"std::unique_ptr" ) + else: + class_params.append("py::smart_holder") if cls.trampoline: class_params.append(cls.trampoline.var) diff --git a/robotpy_build/command/build_ext.py b/robotpy_build/command/build_ext.py index de8e6709..135e3e21 100644 --- a/robotpy_build/command/build_ext.py +++ b/robotpy_build/command/build_ext.py @@ -134,7 +134,6 @@ def _spawn(cmd): self.compiler._rpy_spawn = self.compiler.spawn self.compiler.spawn = _spawn for ext in self.extensions: - ext.define_macros.append(("PYBIND11_USE_SMART_HOLDER_AS_DEFAULT", "1")) if debug: ext.define_macros.append( ("PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF", "1") diff --git a/robotpy_build/pybind11 b/robotpy_build/pybind11 index d8b15411..dfe7e65b 160000 --- a/robotpy_build/pybind11 +++ b/robotpy_build/pybind11 @@ -1 +1 @@ -Subproject commit d8b1541168e58444597f25e85e78356de9b67d34 +Subproject commit dfe7e65b4527eeb11036402aac3a394130960bb2 diff --git a/tests/test_ft_docs.py b/tests/test_ft_docs.py index 73d44ba5..90a8ca52 100644 --- a/tests/test_ft_docs.py +++ b/tests/test_ft_docs.py @@ -39,7 +39,7 @@ def test_docstrings_meth(): def test_docstrings_meth_kwd(): assert inspect.getdoc(ft.DocClass.fn2) == inspect.cleandoc( """ - fn2(self: rpytest.ft._rpytest_ft.DocClass, from_: int) -> None + fn2(self: rpytest.ft._rpytest_ft.DocClass, from_: typing.SupportsInt) -> None Function with parameter that's a python keyword @@ -51,7 +51,7 @@ def test_docstrings_meth_kwd(): def test_docstrings_meth_rename(): assert inspect.getdoc(ft.DocClass.fn3) == inspect.cleandoc( """ - fn3(self: rpytest.ft._rpytest_ft.DocClass, ohai: int) -> None + fn3(self: rpytest.ft._rpytest_ft.DocClass, ohai: typing.SupportsInt) -> None Function with renamed parameter