From 634e6627f2608bd5a17c0710a9d4ee7df157e52a Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Fri, 13 Dec 2019 16:30:57 +0100 Subject: [PATCH] mypy: add missing type information --- mkosi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mkosi b/mkosi index 6325fe31f..f757b21cd 100755 --- a/mkosi +++ b/mkosi @@ -97,10 +97,10 @@ class CommandLineArguments(argparse.Namespace): esp_partno: Optional[int] = None xbootldr_partno: Optional[int] = None - def generated_root(self): + def generated_root(self) -> bool: """Returns whether this configuration means we need to generate a file system from a prepared tree, as needed for anything squashfs and when root minimization is required.""" - return self.minimize or self.output_format.is_squashfs() + return cast(bool, self.minimize) or self.output_format.is_squashfs() class SourceFileTransfer(enum.Enum): @@ -3285,14 +3285,18 @@ class BooleanAction(argparse.Action): class WithNetworkAction(BooleanAction): - def __call__(self, parser, namespace, values, option_strings=None): + def __call__(self, + parser: argparse.ArgumentParser, + namespace: argparse.Namespace, + values: Union[str, Sequence[Any], None, bool], + option_string: Optional[str] = None) -> None: if isinstance(values, str): if values == "strict": setattr(namespace, self.dest, "strict") return - super().__call__(parser, namespace, values, option_strings) + super().__call__(parser, namespace, values, option_string) class ArgumentParserMkosi(argparse.ArgumentParser): -- 2.47.2