diff --git a/rclpy/rclpy/impl/_rclpy_pybind11.pyi b/rclpy/rclpy/impl/_rclpy_pybind11.pyi new file mode 100644 index 000000000..df259e477 --- /dev/null +++ b/rclpy/rclpy/impl/_rclpy_pybind11.pyi @@ -0,0 +1,22 @@ +# Copyright 2024 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Sequence + + +def rclpy_remove_ros_args(pycli_args: Sequence[str]) -> list[str]: ... +"""Remove ROS-specific arguments from argument vector.""" + +def rclpy_get_rmw_implementation_identifier() -> str: ... +"""Retrieve the identifier for the active RMW implementation.""" diff --git a/rclpy/rclpy/impl/implementation_singleton.py b/rclpy/rclpy/impl/implementation_singleton.py index cdbfc0b00..ba7f55fe8 100644 --- a/rclpy/rclpy/impl/implementation_singleton.py +++ b/rclpy/rclpy/impl/implementation_singleton.py @@ -26,19 +26,7 @@ # ... """ - -from typing import List, Protocol, Sequence - from rpyutils import import_c_library package = 'rclpy' -rclpy_implementation: 'rclpyHandle' = import_c_library('._rclpy_pybind11', package) - - -class rclpyHandle(Protocol): - - def rclpy_remove_ros_args(self, pycli_args: Sequence[str]) -> List[str]: - ... - - def rclpy_get_rmw_implementation_identifier(self) -> str: - ... +rclpy_implementation = import_c_library('._rclpy_pybind11', package) diff --git a/rclpy/rclpy/impl/implementation_singleton.pyi b/rclpy/rclpy/impl/implementation_singleton.pyi new file mode 100644 index 000000000..a1e16bdf9 --- /dev/null +++ b/rclpy/rclpy/impl/implementation_singleton.pyi @@ -0,0 +1,18 @@ +# Copyright 2024 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from rclpy.impl import _rclpy_pybind11 + +rclpy_implementation = _rclpy_pybind11