From 0ba6513dadff3f8aa667f6e029a13cef49876b6b Mon Sep 17 00:00:00 2001 From: Oscar Gren Date: Thu, 4 Jul 2024 17:11:06 +0200 Subject: [PATCH] fix: address pylint warnings --- python/restbus/restbus.py | 9 +++++---- python/subscribe-to-scripted-signal/subscribe_demo.py | 1 + .../subscribe-to-scripted-signal/subscribe_standalone.py | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python/restbus/restbus.py b/python/restbus/restbus.py index 257a4ee..af627ac 100644 --- a/python/restbus/restbus.py +++ b/python/restbus/restbus.py @@ -4,11 +4,12 @@ import math import re import time -from typing import Any, Generator, Iterable, Optional, Tuple, TypeAlias +from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple import google.protobuf.internal.containers # type: ignore import remotivelabs.broker.sync as br from grpc import Channel +from typing_extensions import TypeAlias class SignalValue: # pylint: disable=R0903 @@ -23,9 +24,9 @@ def next(self) -> br.network_api_pb2.Signal: return ret -SchedulingTuple: TypeAlias = Tuple[float, str, list[SignalValue]] -E2eCounterStates: TypeAlias = dict[str, int] -OverrideValues: TypeAlias = dict[str, list[float]] +SchedulingTuple: TypeAlias = Tuple[float, str, List[SignalValue]] +E2eCounterStates: TypeAlias = Dict[str, int] +OverrideValues: TypeAlias = Dict[str, List[float]] def gen_default_publish_values( diff --git a/python/subscribe-to-scripted-signal/subscribe_demo.py b/python/subscribe-to-scripted-signal/subscribe_demo.py index 8ccbebe..a8c474d 100644 --- a/python/subscribe-to-scripted-signal/subscribe_demo.py +++ b/python/subscribe-to-scripted-signal/subscribe_demo.py @@ -101,6 +101,7 @@ def run( class ScriptPathArgument(argparse.Action): + # pylint: disable=R0913 # pylint: disable=W0222 def __call__(self, _parser: Any, namespace: Any, value: Any, _option: Any) -> None: # type: ignore print("Script path in use:", value) diff --git a/python/subscribe-to-scripted-signal/subscribe_standalone.py b/python/subscribe-to-scripted-signal/subscribe_standalone.py index 1300c5e..08bc169 100644 --- a/python/subscribe-to-scripted-signal/subscribe_standalone.py +++ b/python/subscribe-to-scripted-signal/subscribe_standalone.py @@ -152,6 +152,7 @@ def run( class ScriptPathArgument(argparse.Action): + # pylint: disable=R0903 # pylint: disable=W0222 def __call__(self, _parser: Any, namespace: argparse.Namespace, value: Any, _option: Any) -> None: # type: ignore print("Script path in use:", value)