From 3534a7e7a140180e8578b1ccc0a5127419a404f7 Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Mon, 14 Aug 2023 19:05:36 +1000 Subject: [PATCH] fix: rosidl_cmake python calls is deprecated --- package.xml | 2 ++ resource/_action.pyi.em | 2 +- resource/_srv.pyi.em | 2 +- rosidl_generator_mypy/__init__.py | 10 +++++----- 4 files changed, 9 insertions(+), 7 deletions(-) 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 9da0df8..8d8c15c 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"]