From b82090d777826b315733d6315722394d8e9550d9 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 29 Sep 2025 10:52:08 -0400 Subject: [PATCH] Add type annotations to _parser/_logical.py Do not autogenerate. monkeytype imports Range from a hidden module in justbytes and also makes return value of parse_range_or_current into a Union type. Signed-off-by: mulhern --- src/stratis_cli/_parser/_logical.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/stratis_cli/_parser/_logical.py b/src/stratis_cli/_parser/_logical.py index 60d0ad377..63b9f99de 100644 --- a/src/stratis_cli/_parser/_logical.py +++ b/src/stratis_cli/_parser/_logical.py @@ -16,14 +16,18 @@ """ # isort: STDLIB -from argparse import SUPPRESS +from argparse import SUPPRESS, ArgumentParser, Namespace +from typing import Optional, Tuple + +# isort: THIRDPARTY +from justbytes import Range from .._actions import LogicalActions from ._debug import FILESYSTEM_DEBUG_SUBCMDS from ._shared import UUID_OR_NAME, RejectAction, parse_range -def parse_range_or_current(values): +def parse_range_or_current(values: str) -> Tuple[Optional[Range], str]: """ Allow specifying a Range or the value "current". Include the original value specified by the user as well as the Range result if the user @@ -39,10 +43,10 @@ class FilesystemListOptions: # pylint: disable=too-few-public-methods Verifies filesystem list options. """ - def __init__(self, _namespace): + def __init__(self, _namespace: Namespace): pass - def verify(self, namespace, parser): + def verify(self, namespace: Namespace, parser: ArgumentParser): """ Do supplementary parsing of conditional arguments. """