App, lib: Add type annotations to untyped functions
Add missing type annotations to functions that are called from typed contexts, satisfying the new disallow_untyped_calls mypy rule. Fixes: - Local.py: __log() with typed parameters - lib/App.py: _add_arguments(), add_cmd_to_parser(), add_cmds_to_parser() - pm/rpm.py, dpkg.py: meta_map() return type - Exec.py: __init_askpass() return type - App.py: strip_module_from_spec(), __get_project_refs_cached(), ResultCache.__init__ and run(), _add_arguments() - Added Collection type for truthy-iterable compliance Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
75c9879f67
commit
410fd7ab5c
6 changed files with 26 additions and 15 deletions
|
|
@ -14,6 +14,8 @@ from ..ExecContext import ExecContext as Base
|
|||
from ..log import ERR, NOTICE, log
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
from ..Uri import Uri
|
||||
|
||||
class Local(Base):
|
||||
|
|
@ -37,7 +39,7 @@ class Local(Base):
|
|||
log_prefix: str,
|
||||
) -> Result:
|
||||
|
||||
def __log(prio, *args, verbose = verbose):
|
||||
def __log(prio: int, *args: Any, verbose: bool = verbose) -> None:
|
||||
if verbose:
|
||||
log(prio, log_prefix, *args)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Exec(Base):
|
|||
if self.__askpass is not None:
|
||||
os.remove(self.__askpass)
|
||||
|
||||
def __init_askpass(self):
|
||||
def __init_askpass(self) -> None:
|
||||
if self.__askpass is None and self.password is not None:
|
||||
import sys
|
||||
import tempfile
|
||||
|
|
|
|||
Loading…
Reference in a new issue