diff --git a/cmake/rosidl_generator_mypy_generate_interfaces.cmake b/cmake/rosidl_generator_mypy_generate_interfaces.cmake index 221d32a..d48eb14 100644 --- a/cmake/rosidl_generator_mypy_generate_interfaces.cmake +++ b/cmake/rosidl_generator_mypy_generate_interfaces.cmake @@ -1,7 +1,5 @@ find_package(rmw REQUIRED) -find_package(PythonInterp 3.6 REQUIRED) - set(_output_path "${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_mypy/${PROJECT_NAME}") set(_generated_pyi_files "") diff --git a/package.xml b/package.xml index b1ee3ca..cc45686 100644 --- a/package.xml +++ b/package.xml @@ -13,11 +13,13 @@ ament_cmake rosidl_cmake rosidl_generator_py + rosidl_pycommon ament_cmake rmw + rosidl_pycommon rosidl_cmake rosidl_generator_py rosidl_parser diff --git a/resource/_action.pyi.em b/resource/_action.pyi.em index 2b64d4c..4def523 100644 --- a/resource/_action.pyi.em +++ b/resource/_action.pyi.em @@ -9,7 +9,7 @@ if generate_imports: }@ @#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @{ -from rosidl_cmake import convert_camel_case_to_lower_case_underscore +from rosidl_pycommon import convert_camel_case_to_lower_case_underscore action_name = '_' + convert_camel_case_to_lower_case_underscore(action.namespaced_type.name) module_name = '_' + convert_camel_case_to_lower_case_underscore(interface_path.stem) diff --git a/resource/_srv.pyi.em b/resource/_srv.pyi.em index 29172b4..eec4d0c 100644 --- a/resource/_srv.pyi.em +++ b/resource/_srv.pyi.em @@ -9,7 +9,7 @@ if generate_imports: }@ @#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @{ -from rosidl_cmake import convert_camel_case_to_lower_case_underscore +from rosidl_pycommon import convert_camel_case_to_lower_case_underscore service_name = '_' + convert_camel_case_to_lower_case_underscore(service.namespaced_type.name) module_name = '_' + convert_camel_case_to_lower_case_underscore(interface_path.stem) diff --git a/rosidl_generator_mypy/__init__.py b/rosidl_generator_mypy/__init__.py index 82acb2c..480b2aa 100644 --- a/rosidl_generator_mypy/__init__.py +++ b/rosidl_generator_mypy/__init__.py @@ -2,11 +2,6 @@ import pathlib from typing import Dict, List, NamedTuple, Optional, Set, Tuple -from rosidl_cmake import ( - convert_camel_case_to_lower_case_underscore, - generate_files, - read_generator_arguments, -) from rosidl_generator_py import generate_py_impl from rosidl_parser.definition import ( AbstractNestedType, @@ -21,6 +16,11 @@ Service, ) from rosidl_parser.parser import parse_idl_file +from rosidl_pycommon import ( + convert_camel_case_to_lower_case_underscore, + generate_files, + read_generator_arguments, +) SPECIAL_NESTED_BASIC_TYPES = ["int", "float"]