Skip to content

Commit

Permalink
Upgrade pybind11
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Feb 16, 2025
1 parent 86149d8 commit 6f6f490
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion core/python/pybind11
Submodule pybind11 updated 266 files
21 changes: 5 additions & 16 deletions core/python/test/rostest_trampoline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@ def setUpModule():
roscpp_init("test_mtc")


def pybind11_versions():
try:
keys = __builtins__.keys() # for use with pytest
except AttributeError:
keys = __builtins__.__dict__.keys() # use from cmdline
return [k for k in keys if k.startswith("__pybind11_internals_v")]


incompatible_pybind11_msg = "MoveIt and MTC use incompatible pybind11 versions: " + "\n- ".join(
pybind11_versions()
)


class PyGenerator(core.Generator):
"""Implements a custom 'Generator' stage."""

Expand Down Expand Up @@ -109,18 +96,20 @@ def create(self, *stages):
return task

def plan(self, task, expected_solutions=None, wait=False):
task.plan()
try:
task.plan()
except TypeError as e:
self.fail(f"{e}\nDo MoveIt and MTC use ABI-compatible pybind11 versions?")

if expected_solutions is not None:
self.assertEqual(len(task.solutions), expected_solutions)
if wait:
input("Waiting for any key (allows inspection in rviz)")

@unittest.skipIf(len(pybind11_versions()) > 1, incompatible_pybind11_msg)
def test_generator(self):
task = self.create(PyGenerator())
self.plan(task, expected_solutions=PyGenerator.max_calls)

@unittest.skipIf(len(pybind11_versions()) > 1, incompatible_pybind11_msg)
def test_monitoring_generator(self):
task = self.create(
stages.CurrentState("current"),
Expand Down

0 comments on commit 6f6f490

Please sign in to comment.