diff --git a/rosidl_cli/package.xml b/rosidl_cli/package.xml
index e45804c7a..46f5c7ee5 100644
--- a/rosidl_cli/package.xml
+++ b/rosidl_cli/package.xml
@@ -22,7 +22,6 @@
ament_copyright
ament_flake8
- ament_mypy
ament_pep257
ament_xmllint
python3-pytest
diff --git a/rosidl_cli/py.typed b/rosidl_cli/py.typed
deleted file mode 100644
index e69de29bb..000000000
diff --git a/rosidl_cli/rosidl_cli/cli.py b/rosidl_cli/rosidl_cli/cli.py
index ce729a816..9c3f8ac28 100644
--- a/rosidl_cli/rosidl_cli/cli.py
+++ b/rosidl_cli/rosidl_cli/cli.py
@@ -14,18 +14,13 @@
import argparse
import signal
-from typing import Any, List, Union
from rosidl_cli.command.generate import GenerateCommand
from rosidl_cli.command.translate import TranslateCommand
from rosidl_cli.common import get_first_line_doc
-def add_subparsers(
- parser: argparse.ArgumentParser,
- cli_name: str,
- commands: List[Union[GenerateCommand, TranslateCommand]]
-) -> argparse._SubParsersAction[argparse.ArgumentParser]:
+def add_subparsers(parser, cli_name, commands):
"""
Create argparse subparser for each command.
@@ -68,7 +63,7 @@ def add_subparsers(
return subparser
-def main() -> Union[str, signal.Signals, Any]:
+def main():
script_name = 'rosidl'
description = f'{script_name} is an extensible command-line tool ' \
'for ROS interface generation.'
@@ -79,8 +74,7 @@ def main() -> Union[str, signal.Signals, Any]:
formatter_class=argparse.RawDescriptionHelpFormatter
)
- commands: List[Union[GenerateCommand, TranslateCommand]] = \
- [GenerateCommand(), TranslateCommand()]
+ commands = [GenerateCommand(), TranslateCommand()]
# add arguments for command extension(s)
add_subparsers(
diff --git a/rosidl_cli/rosidl_cli/command/__init__.py b/rosidl_cli/rosidl_cli/command/__init__.py
index 187a6c187..22d035bb5 100644
--- a/rosidl_cli/rosidl_cli/command/__init__.py
+++ b/rosidl_cli/rosidl_cli/command/__init__.py
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import argparse
-
class Command:
"""
@@ -24,8 +22,8 @@ class Command:
* `add_arguments`
"""
- def add_arguments(self, parser: argparse.ArgumentParser) -> None:
+ def add_arguments(self, parser):
pass
- def main(self, *, args: argparse.Namespace) -> None:
+ def main(self, *, parser, args):
raise NotImplementedError()
diff --git a/rosidl_cli/rosidl_cli/command/generate/__init__.py b/rosidl_cli/rosidl_cli/command/generate/__init__.py
index b12b946c1..ee46a937a 100644
--- a/rosidl_cli/rosidl_cli/command/generate/__init__.py
+++ b/rosidl_cli/rosidl_cli/command/generate/__init__.py
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import argparse
import pathlib
from rosidl_cli.command import Command
@@ -25,7 +24,7 @@ class GenerateCommand(Command):
name = 'generate'
- def add_arguments(self, parser: argparse.ArgumentParser) -> None:
+ def add_arguments(self, parser):
parser.add_argument(
'-o', '--output-path', metavar='PATH',
type=pathlib.Path, default=None,
@@ -51,7 +50,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
"If prefixed by another path followed by a colon ':', "
'path resolution is performed against such path.'))
- def main(self, *, args: argparse.Namespace) -> None:
+ def main(self, *, args):
generate(
package_name=args.package_name,
interface_files=args.interface_files,
diff --git a/rosidl_cli/rosidl_cli/command/generate/api.py b/rosidl_cli/rosidl_cli/command/generate/api.py
index ff7edbbcb..ebec89144 100644
--- a/rosidl_cli/rosidl_cli/command/generate/api.py
+++ b/rosidl_cli/rosidl_cli/command/generate/api.py
@@ -14,22 +14,20 @@
import os
import pathlib
-from typing import List, Optional
-from .extensions import GenerateCommandExtension
from .extensions import load_type_extensions
from .extensions import load_typesupport_extensions
def generate(
*,
- package_name: str,
- interface_files: List[str],
- include_paths: Optional[List[str]] = None,
- output_path: Optional[pathlib.Path] = None,
- types: Optional[List[str]] = None,
- typesupports: Optional[List[str]] = None
-) -> List[List[str]]:
+ package_name,
+ interface_files,
+ include_paths=None,
+ output_path=None,
+ types=None,
+ typesupports=None
+):
"""
Generate source code from interface definition files.
@@ -62,7 +60,7 @@ def generate(
:returns: list of lists of paths to generated source code files,
one group per type or type support extension invoked
"""
- extensions: List[GenerateCommandExtension] = []
+ extensions = []
unspecific_generation = not types and not typesupports
diff --git a/rosidl_cli/rosidl_cli/command/generate/extensions.py b/rosidl_cli/rosidl_cli/command/generate/extensions.py
index a89630d71..fde1fb6b0 100644
--- a/rosidl_cli/rosidl_cli/command/generate/extensions.py
+++ b/rosidl_cli/rosidl_cli/command/generate/extensions.py
@@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from pathlib import Path
-from typing import cast, List, Optional
-
from rosidl_cli.extensions import Extension
from rosidl_cli.extensions import load_extensions
@@ -29,11 +26,11 @@ class GenerateCommandExtension(Extension):
def generate(
self,
- package_name: str,
- interface_files: List[str],
- include_paths: List[str],
- output_path: Path
- ) -> List[str]:
+ package_name,
+ interface_files,
+ include_paths,
+ output_path
+ ):
"""
Generate source code.
@@ -51,17 +48,11 @@ def generate(
raise NotImplementedError()
-def load_type_extensions(*, specs: Optional[List[str]],
- strict: bool) -> List[GenerateCommandExtension]:
+def load_type_extensions(**kwargs):
"""Load extensions for type representation source code generation."""
- extensions = load_extensions('rosidl_cli.command.generate.type_extensions', specs=specs,
- strict=strict)
- return cast(List[GenerateCommandExtension], extensions)
+ return load_extensions('rosidl_cli.command.generate.type_extensions', **kwargs)
-def load_typesupport_extensions(*, specs: Optional[List[str]], strict: bool
- ) -> List[GenerateCommandExtension]:
+def load_typesupport_extensions(**kwargs):
"""Load extensions for type support source code generation."""
- extensions = load_extensions('rosidl_cli.command.generate.typesupport_extensions',
- specs=specs, strict=strict)
- return cast(List[GenerateCommandExtension], extensions)
+ return load_extensions('rosidl_cli.command.generate.typesupport_extensions', **kwargs)
diff --git a/rosidl_cli/rosidl_cli/command/helpers.py b/rosidl_cli/rosidl_cli/command/helpers.py
index d81b0cdc3..f23cc9a88 100644
--- a/rosidl_cli/rosidl_cli/command/helpers.py
+++ b/rosidl_cli/rosidl_cli/command/helpers.py
@@ -17,10 +17,9 @@
import os
import pathlib
import tempfile
-from typing import Generator, List, Tuple
-def package_name_from_interface_file_path(path: pathlib.Path) -> str:
+def package_name_from_interface_file_path(path):
"""
Derive ROS package name from a ROS interface definition file path.
@@ -30,7 +29,7 @@ def package_name_from_interface_file_path(path: pathlib.Path) -> str:
return pathlib.Path(os.path.abspath(path)).parents[1].name
-def dependencies_from_include_paths(include_paths: List[str]) -> List[str]:
+def dependencies_from_include_paths(include_paths):
"""
Collect dependencies' ROS interface definition files from include paths.
@@ -46,7 +45,7 @@ def dependencies_from_include_paths(include_paths: List[str]) -> List[str]:
})
-def interface_path_as_tuple(path: str) -> Tuple[pathlib.Path, pathlib.Path]:
+def interface_path_as_tuple(path):
"""
Express interface definition file path as an (absolute prefix, relative path) tuple.
@@ -62,20 +61,18 @@ def interface_path_as_tuple(path: str) -> Tuple[pathlib.Path, pathlib.Path]:
"""
path_as_string = str(path)
if ':' not in path_as_string:
- prefix_path = pathlib.Path.cwd()
+ prefix = pathlib.Path.cwd()
else:
prefix, _, path = path_as_string.rpartition(':')
- prefix_path = pathlib.Path(os.path.abspath(prefix))
- path_as_path = pathlib.Path(path)
- if path_as_path.is_absolute():
+ prefix = pathlib.Path(os.path.abspath(prefix))
+ path = pathlib.Path(path)
+ if path.is_absolute():
raise ValueError('Interface definition file path '
- f"'{path_as_path}' cannot be absolute")
- return prefix_path, path_as_path
+ f"'{path}' cannot be absolute")
+ return prefix, path
-def idl_tuples_from_interface_files(
- interface_files: List[str]
-) -> List[str]:
+def idl_tuples_from_interface_files(interface_files):
"""
Express ROS interface definition file paths as IDL tuples.
@@ -83,9 +80,9 @@ def idl_tuples_from_interface_files(
which to resolve it followed by a colon ':'. This function then applies
the same logic as `interface_path_as_tuple`.
"""
- idl_tuples: List[str] = []
- for interface_path in interface_files:
- prefix, path = interface_path_as_tuple(interface_path)
+ idl_tuples = []
+ for path in interface_files:
+ prefix, path = interface_path_as_tuple(path)
idl_tuples.append(f'{prefix}:{path.as_posix()}')
return idl_tuples
@@ -93,12 +90,12 @@ def idl_tuples_from_interface_files(
@contextlib.contextmanager
def legacy_generator_arguments_file(
*,
- package_name: str,
- interface_files: List[str],
- include_paths: List[str],
- templates_path: str,
- output_path: str
-) -> Generator[str, None, None]:
+ package_name,
+ interface_files,
+ include_paths,
+ templates_path,
+ output_path
+):
"""
Generate a temporary rosidl generator arguments file.
@@ -141,10 +138,10 @@ def legacy_generator_arguments_file(
def generate_visibility_control_file(
*,
- package_name: str,
- template_path: str,
- output_path: str
-) -> None:
+ package_name,
+ template_path,
+ output_path
+):
"""
Generate a visibility control file from a template.
diff --git a/rosidl_cli/rosidl_cli/command/translate/__init__.py b/rosidl_cli/rosidl_cli/command/translate/__init__.py
index f5b6368f0..03798db3e 100644
--- a/rosidl_cli/rosidl_cli/command/translate/__init__.py
+++ b/rosidl_cli/rosidl_cli/command/translate/__init__.py
@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import argparse
import pathlib
-
from rosidl_cli.command import Command
from .api import translate
@@ -26,7 +24,7 @@ class TranslateCommand(Command):
name = 'translate'
- def add_arguments(self, parser: argparse.ArgumentParser) -> None:
+ def add_arguments(self, parser):
parser.add_argument(
'-o', '--output-path', metavar='PATH',
type=pathlib.Path, default=None,
@@ -66,7 +64,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
'path resolution is performed against such path.')
)
- def main(self, *, args: argparse.Namespace) -> None:
+ def main(self, *, args):
translate(
package_name=args.package_name,
interface_files=args.interface_files,
diff --git a/rosidl_cli/rosidl_cli/command/translate/api.py b/rosidl_cli/rosidl_cli/command/translate/api.py
index a7d18bd45..b63db278e 100644
--- a/rosidl_cli/rosidl_cli/command/translate/api.py
+++ b/rosidl_cli/rosidl_cli/command/translate/api.py
@@ -15,21 +15,20 @@
import collections
import os
import pathlib
-from typing import DefaultDict, Dict, List, Optional, Union
from .extensions import load_translate_extensions
def translate(
*,
- package_name: str,
- interface_files: List[str],
- output_format: str,
- input_format: Optional[str] = None,
- include_paths: Optional[List[str]] = None,
- output_path: Optional[pathlib.Path] = None,
- translators: Optional[List[str]] = None
-) -> List[str]:
+ package_name,
+ interface_files,
+ output_format,
+ input_format=None,
+ include_paths=None,
+ output_path=None,
+ translators=None
+):
"""
Translate interface definition files from one format to another.
@@ -65,8 +64,7 @@ def translate(
raise RuntimeError('No translate extensions found')
if not input_format:
- interface_files_per_format: Union[DefaultDict[str, List[str]],
- Dict[str, List[str]]] = collections.defaultdict(list)
+ interface_files_per_format = collections.defaultdict(list)
for interface_file in interface_files:
input_format = os.path.splitext(interface_file)[-1][1:]
interface_files_per_format[input_format].append(interface_file)
diff --git a/rosidl_cli/rosidl_cli/command/translate/extensions.py b/rosidl_cli/rosidl_cli/command/translate/extensions.py
index 10c3ba194..f193a4804 100644
--- a/rosidl_cli/rosidl_cli/command/translate/extensions.py
+++ b/rosidl_cli/rosidl_cli/command/translate/extensions.py
@@ -11,8 +11,6 @@
# 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 pathlib import Path
-from typing import cast, ClassVar, List, Optional
from rosidl_cli.extensions import Extension
from rosidl_cli.extensions import load_extensions
@@ -30,16 +28,13 @@ class TranslateCommandExtension(Extension):
* `translate`
"""
- input_format: ClassVar[str]
- output_format: ClassVar[str]
-
def translate(
self,
- package_name: str,
- interface_files: List[str],
- include_paths: List[str],
- output_path: Path
- ) -> List[str]:
+ package_name,
+ interface_files,
+ include_paths,
+ output_path
+ ):
"""
Translate interface definition files.
@@ -62,10 +57,8 @@ def translate(
raise NotImplementedError()
-def load_translate_extensions(*, specs: Optional[List[str]], strict: bool
- ) -> List[TranslateCommandExtension]:
+def load_translate_extensions(**kwargs):
"""Load extensions for interface definition translation."""
- extensions = load_extensions(
- 'rosidl_cli.command.translate.extensions', specs=specs, strict=strict
+ return load_extensions(
+ 'rosidl_cli.command.translate.extensions', **kwargs
)
- return cast(List[TranslateCommandExtension], extensions)
diff --git a/rosidl_cli/rosidl_cli/common.py b/rosidl_cli/rosidl_cli/common.py
index c0e8c9d42..1f94c2c63 100644
--- a/rosidl_cli/rosidl_cli/common.py
+++ b/rosidl_cli/rosidl_cli/common.py
@@ -13,7 +13,7 @@
# limitations under the License.
-def get_first_line_doc(any_type: object) -> str:
+def get_first_line_doc(any_type):
if any_type.__doc__:
for line in any_type.__doc__.splitlines():
line = line.strip()
diff --git a/rosidl_cli/rosidl_cli/entry_points.py b/rosidl_cli/rosidl_cli/entry_points.py
index 6d09f46c9..edab63729 100644
--- a/rosidl_cli/rosidl_cli/entry_points.py
+++ b/rosidl_cli/rosidl_cli/entry_points.py
@@ -12,39 +12,38 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import importlib.metadata as importlib_metadata
import logging
-import sys
-from typing import Any, Dict, List, Optional, Tuple, Union
+
+try:
+ import importlib.metadata as importlib_metadata
+except ModuleNotFoundError:
+ import importlib_metadata
logger = logging.getLogger(__name__)
-def get_entry_points(group_name: str, *, specs: Optional[List[str]] = None, strict: bool = False
- ) -> Dict[str, importlib_metadata.EntryPoint]:
+def get_entry_points(group_name, *, specs=None, strict=False):
"""
Get entry points from a specific group.
- :param group_name: the name of the entry point group
- :param specs: an optional collection of entry point names to retrieve
- :param strict: whether to raise or warn on error
+ :param str group_name: the name of the entry point group
+ :param list specs: an optional collection of entry point names to retrieve
+ :param bool strict: whether to raise or warn on error
:returns: mapping from entry point names to ``EntryPoint`` instances
+ :rtype: dict
"""
if specs is not None:
- specs_set = set(specs)
+ specs = set(specs)
entry_points_impl = importlib_metadata.entry_points()
- # Select does not exist until python 3.10
- if sys.version_info >= (3, 10):
+ if hasattr(entry_points_impl, 'select'):
groups = entry_points_impl.select(group=group_name)
else:
- groups: Union[Tuple[importlib_metadata.EntryPoint, ...],
- List[importlib_metadata.EntryPoint]] = entry_points_impl.get(group_name, [])
-
- entry_points: Dict[str, importlib_metadata.EntryPoint] = {}
+ groups = entry_points_impl.get(group_name, [])
+ entry_points = {}
for entry_point in groups:
name = entry_point.name
- if specs_set and name not in specs_set:
+ if specs and name not in specs:
continue
if name in entry_points:
msg = (f"Found duplicate entry point '{name}': "
@@ -54,8 +53,8 @@ def get_entry_points(group_name: str, *, specs: Optional[List[str]] = None, stri
logger.warning(msg)
continue
entry_points[name] = entry_point
- if specs_set:
- pending = specs_set - set(entry_points)
+ if specs:
+ pending = specs - set(entry_points)
if pending:
msg = 'Some specs could not be met: '
msg += ', '.join(map(str, pending))
@@ -65,22 +64,21 @@ def get_entry_points(group_name: str, *, specs: Optional[List[str]] = None, stri
return entry_points
-def load_entry_points(group_name: str, *, specs: Optional[List[str]],
- strict: bool = False,
- ) -> Dict[str, Any]:
+def load_entry_points(group_name, *, strict=False, **kwargs):
"""
Load entry points for a specific group.
See :py:meth:`get_entry_points` for further reference on
additional keyword arguments.
- :param group_name: the name of the entry point group
- :param strict: whether to raise or warn on error
+ :param str group_name: the name of the entry point group
+ :param bool strict: whether to raise or warn on error
:returns: mapping from entry point name to loaded entry point
+ :rtype: dict
"""
- loaded_entry_points: Dict[str, Any] = {}
+ loaded_entry_points = {}
for name, entry_point in get_entry_points(
- group_name, strict=strict, specs=specs
+ group_name, strict=strict, **kwargs
).items():
try:
loaded_entry_points[name] = entry_point.load()
diff --git a/rosidl_cli/rosidl_cli/extensions.py b/rosidl_cli/rosidl_cli/extensions.py
index bbc28c9e7..7cc31afa2 100644
--- a/rosidl_cli/rosidl_cli/extensions.py
+++ b/rosidl_cli/rosidl_cli/extensions.py
@@ -14,19 +14,10 @@
import logging
import re
-from typing import Any, Dict, Final, List, Optional, Tuple, TYPE_CHECKING, Union
from rosidl_cli.entry_points import load_entry_points
-import yaml # type: ignore[import]
-
-if TYPE_CHECKING:
- from typing import TypedDict
- from typing_extensions import NotRequired
-
- class LoadExtensionsArg(TypedDict):
- specs: NotRequired[Optional[List[str]]]
- strict: NotRequired[bool]
+import yaml
logger = logging.getLogger(__name__)
@@ -35,18 +26,18 @@ class LoadExtensionsArg(TypedDict):
class Extension:
"""A generic extension point."""
- def __init__(self, name: str) -> None:
+ def __init__(self, name):
self.__name = name
@property
- def name(self) -> str:
+ def name(self):
return self.__name
-SPECS_PATTERN: Final = re.compile(r'^(\w+)(?:\[(.+)\])?$')
+SPECS_PATTERN = re.compile(r'^(\w+)(?:\[(.+)\])?$')
-def parse_extension_specification(spec: str) -> Tuple[Union[str, Any], Union[Dict[Any, Any], Any]]:
+def parse_extension_specification(spec):
"""
Parse extension specification.
@@ -73,18 +64,18 @@ def parse_extension_specification(spec: str) -> Tuple[Union[str, Any], Union[Dic
return name, kwargs
-def load_extensions(group_name: str, *, specs: Optional[List[str]] = None,
- strict: bool = False) -> List[Extension]:
+def load_extensions(group_name, *, specs=None, strict=False):
"""
Load extensions for a specific group.
- :param group_name: the name of the extension group
- :param specs: an optional collection of extension specs
+ :param str group_name: the name of the extension group
+ :param list specs: an optional collection of extension specs
(see :py:meth:`parse_extension_specification` for spec format)
- :param strict: whether to raise or warn on error
+ :param bool strict: whether to raise or warn on error
:returns: a list of :py:class:`Extension` instances
+ :rtype: list
"""
- extensions: List[Extension] = []
+ extensions = []
if specs is not None:
kwargs = dict(map(
diff --git a/rosidl_cli/test/rosidl_cli/test_common.py b/rosidl_cli/test/rosidl_cli/test_common.py
index ccc4a6cb7..166f8bf0f 100644
--- a/rosidl_cli/test/rosidl_cli/test_common.py
+++ b/rosidl_cli/test/rosidl_cli/test_common.py
@@ -15,20 +15,20 @@
from rosidl_cli.common import get_first_line_doc
-def test_getting_first_line_from_no_docstring() -> None:
+def test_getting_first_line_from_no_docstring():
func = test_getting_first_line_from_no_docstring
line = get_first_line_doc(func)
assert line == ''
-def test_getting_first_line_from_docstring() -> None:
+def test_getting_first_line_from_docstring():
"""Check it gets the first line."""
func = test_getting_first_line_from_docstring
line = get_first_line_doc(func)
assert line == 'Check it gets the first line'
-def test_getting_first_line_from_multiline_docstring() -> None:
+def test_getting_first_line_from_multiline_docstring():
"""
Check it really gets the first non-empty line.
diff --git a/rosidl_cli/test/rosidl_cli/test_extensions.py b/rosidl_cli/test/rosidl_cli/test_extensions.py
index 94af493af..7e3dd2158 100644
--- a/rosidl_cli/test/rosidl_cli/test_extensions.py
+++ b/rosidl_cli/test/rosidl_cli/test_extensions.py
@@ -17,7 +17,7 @@
from rosidl_cli.extensions import parse_extension_specification
-def test_extension_specification_parsing() -> None:
+def test_extension_specification_parsing():
with pytest.raises(ValueError):
parse_extension_specification('bad[')
diff --git a/rosidl_cli/test/rosidl_cli/test_helpers.py b/rosidl_cli/test/rosidl_cli/test_helpers.py
index bba66d4e9..5a16f684f 100644
--- a/rosidl_cli/test/rosidl_cli/test_helpers.py
+++ b/rosidl_cli/test/rosidl_cli/test_helpers.py
@@ -15,7 +15,6 @@
import json
import os
import pathlib
-from typing import Iterable
import pytest
@@ -23,7 +22,7 @@
from rosidl_cli.command.helpers import legacy_generator_arguments_file
-def test_interface_path_as_tuple() -> None:
+def test_interface_path_as_tuple():
prefix, path = interface_path_as_tuple('/tmp:msg/Empty.idl')
assert pathlib.Path('msg/Empty.idl') == path
assert pathlib.Path(os.path.abspath('/tmp')) == prefix
@@ -38,7 +37,7 @@ def test_interface_path_as_tuple() -> None:
@pytest.fixture
-def current_path(request: pytest.FixtureRequest) -> Iterable[pathlib.Path]:
+def current_path(request):
path = pathlib.Path(request.module.__file__)
path = path.resolve()
path = path.parent
@@ -50,7 +49,7 @@ def current_path(request: pytest.FixtureRequest) -> Iterable[pathlib.Path]:
os.chdir(str(cwd))
-def test_legacy_generator_arguments_file(current_path: pathlib.Path) -> None:
+def test_legacy_generator_arguments_file(current_path):
with legacy_generator_arguments_file(
package_name='foo',
interface_files=['msg/Foo.idl'],
diff --git a/rosidl_cli/test/test_copyright.py b/rosidl_cli/test/test_copyright.py
index 66a7d63eb..cf0fae31f 100644
--- a/rosidl_cli/test/test_copyright.py
+++ b/rosidl_cli/test/test_copyright.py
@@ -18,6 +18,6 @@
@pytest.mark.copyright
@pytest.mark.linter
-def test_copyright() -> None:
+def test_copyright():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found errors'
diff --git a/rosidl_cli/test/test_flake8.py b/rosidl_cli/test/test_flake8.py
index eac16eef9..27ee1078f 100644
--- a/rosidl_cli/test/test_flake8.py
+++ b/rosidl_cli/test/test_flake8.py
@@ -18,7 +18,7 @@
@pytest.mark.flake8
@pytest.mark.linter
-def test_flake8() -> None:
+def test_flake8():
rc, errors = main_with_errors(argv=[])
assert rc == 0, \
'Found %d code style errors / warnings:\n' % len(errors) + \
diff --git a/rosidl_cli/test/test_mypy.py b/rosidl_cli/test/test_mypy.py
deleted file mode 100644
index 97e4f502a..000000000
--- a/rosidl_cli/test/test_mypy.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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 ament_mypy.main import main
-import pytest
-
-
-@pytest.mark.mypy
-@pytest.mark.linter
-def test_mypy() -> None:
- rc = main(argv=[])
- assert rc == 0, 'Found type errors!'
diff --git a/rosidl_cli/test/test_pep257.py b/rosidl_cli/test/test_pep257.py
index 4ae521a5a..0e38a6c60 100644
--- a/rosidl_cli/test/test_pep257.py
+++ b/rosidl_cli/test/test_pep257.py
@@ -18,6 +18,6 @@
@pytest.mark.linter
@pytest.mark.pep257
-def test_pep257() -> None:
+def test_pep257():
rc = main(argv=[])
assert rc == 0, 'Found code style errors / warnings'
diff --git a/rosidl_cli/test/test_xmllint.py b/rosidl_cli/test/test_xmllint.py
index 08bf7fd78..f46285e71 100644
--- a/rosidl_cli/test/test_xmllint.py
+++ b/rosidl_cli/test/test_xmllint.py
@@ -18,6 +18,6 @@
@pytest.mark.linter
@pytest.mark.xmllint
-def test_xmllint() -> None:
+def test_xmllint():
rc = main(argv=[])
assert rc == 0, 'Found errors'