diff --git a/archinstall/lib/boot.py b/archinstall/lib/boot.py index d72ff3b1c0..8faf355700 100644 --- a/archinstall/lib/boot.py +++ b/archinstall/lib/boot.py @@ -99,7 +99,7 @@ def is_alive(self) -> bool: return self.session.is_alive() - def SysCommand(self, cmd: list[str], *args, **kwargs) -> SysCommand: + def SysCommand(self, cmd: list[str], *args, **kwargs) -> SysCommand: # type: ignore[no-untyped-def] if cmd[0][0] != '/' and cmd[0][:2] != './': # This check is also done in SysCommand & SysCommandWorker. # However, that check is done for `machinectl` and not for our chroot command. @@ -109,7 +109,7 @@ def SysCommand(self, cmd: list[str], *args, **kwargs) -> SysCommand: return SysCommand(['systemd-run', f'--machine={self.container_name}', '--pty', *cmd], *args, **kwargs) - def SysCommandWorker(self, cmd: list[str], *args, **kwargs) -> SysCommandWorker: + def SysCommandWorker(self, cmd: list[str], *args, **kwargs) -> SysCommandWorker: # type: ignore[no-untyped-def] if cmd[0][0] != '/' and cmd[0][:2] != './': cmd[0] = locate_binary(cmd[0]) diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index 3aebeaae9c..fbc3e3109d 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -205,7 +205,7 @@ def _safe_config(self) -> None: save_config(self._arch_config) def _missing_configs(self) -> list[str]: - def check(s) -> bool: + def check(s: str) -> bool: item = self._item_group.find_by_key(s) return item.has_value() @@ -227,6 +227,7 @@ def has_superuser() -> bool: tr('Either root-password or at least 1 user with sudo privileges must be specified'), ) elif item.mandatory: + assert item.key is not None if not check(item.key): missing.add(item.text) @@ -486,7 +487,7 @@ def _select_bootloader(self, preset: Bootloader | None) -> Bootloader | None: return bootloader - def _select_profile(self, current_profile: ProfileConfiguration | None): + def _select_profile(self, current_profile: ProfileConfiguration | None) -> ProfileConfiguration | None: from .profile.profile_menu import ProfileMenu profile_config = ProfileMenu(preset=current_profile).run() diff --git a/archinstall/lib/models/mirrors.py b/archinstall/lib/models/mirrors.py index e8eeaaf18f..78ffd6d5da 100644 --- a/archinstall/lib/models/mirrors.py +++ b/archinstall/lib/models/mirrors.py @@ -88,6 +88,7 @@ def latency(self) -> float | None: """ if self._latency is None: debug(f'Checking latency for {self.url}') + assert self._hostname is not None self._latency = ping(self._hostname, timeout=2) debug(f' latency: {self._latency}') diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index 000794eff2..f7d4efac4f 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -163,7 +163,7 @@ def build_icmp(payload: bytes) -> bytes: return struct.pack('!BBHHH', 8, 0, checksum, 0, 1) + payload -def ping(hostname, timeout: int = 5) -> int: +def ping(hostname: str, timeout: int = 5) -> int: watchdog = select.epoll() started = time.time() random_identifier = f'archinstall-{random.randint(1000, 9999)}'.encode() diff --git a/archinstall/lib/pacman/__init__.py b/archinstall/lib/pacman/__init__.py index ca8c5e96ac..68a74e64e5 100644 --- a/archinstall/lib/pacman/__init__.py +++ b/archinstall/lib/pacman/__init__.py @@ -39,7 +39,7 @@ def run(args: str, default_cmd: str = 'pacman') -> SysCommand: return SysCommand(f'{default_cmd} {args}') - def ask(self, error_message: str, bail_message: str, func: Callable, *args, **kwargs) -> None: # type: ignore[type-arg] + def ask(self, error_message: str, bail_message: str, func: Callable, *args, **kwargs) -> None: # type: ignore[no-untyped-def, type-arg] while True: try: func(*args, **kwargs) diff --git a/pyproject.toml b/pyproject.toml index 1138fbb5b7..0b38f8d116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,8 +97,6 @@ disallow_any_explicit = true [[tool.mypy.overrides]] module = "archinstall.lib.*" -disallow_incomplete_defs = false -disallow_untyped_defs = false warn_return_any = false [[tool.mypy.overrides]] @@ -119,9 +117,6 @@ disallow_any_explicit = true module = "archinstall.lib.utils" disallow_any_explicit = true -[[tool.mypy.overrides]] -module = "archinstall.tui.*" - [[tool.mypy.overrides]] module = [ "parted",