From b62b243b10849971c39476264fdf7bb5eccf7359 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Wed, 1 Apr 2026 08:47:34 -0400 Subject: [PATCH 1/2] Update mypy to 1.20.0 This commit also removes a cast that is no longer needed after https://github.com/python/mypy/pull/20602 --- .pre-commit-config.yaml | 2 +- archinstall/lib/menu/list_manager.py | 1 - pyproject.toml | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3c386380b..9d6502cbc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: args: [--config=.flake8] fail_fast: true - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.1 + rev: v1.20.0 hooks: - id: mypy args: [ diff --git a/archinstall/lib/menu/list_manager.py b/archinstall/lib/menu/list_manager.py index 8061eeeec2..54683f5443 100644 --- a/archinstall/lib/menu/list_manager.py +++ b/archinstall/lib/menu/list_manager.py @@ -80,7 +80,6 @@ async def _run(self) -> list[ValueT] | None: raise ValueError('Unhandled return type') if value in self._base_actions: - value = cast(str, value) self._data = await self.handle_action(value, None, self._data) elif value in self._terminate_actions: break diff --git a/pyproject.toml b/pyproject.toml index eba0bd4824..14745ed88d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ Source = "https://github.com/archlinux/archinstall" [project.optional-dependencies] log = ["systemd_python==235"] dev = [ - "mypy==1.19.1", + "mypy==1.20.0", "flake8==7.3.0", "pre-commit==4.5.1", "ruff==0.15.7", From a6d45363272cd0f1ab845c3857d80c20eb56f8e1 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Wed, 1 Apr 2026 09:17:09 -0400 Subject: [PATCH 2/2] Ignore os.system deprecation warnings from mypy to fix CI --- archinstall/lib/installer.py | 4 ++-- archinstall/scripts/guided.py | 2 +- archinstall/tui/curses_menu.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 814eb48acc..234abbf367 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1997,7 +1997,7 @@ def set_keyboard_language(self, language: str) -> bool: # In accordance with https://github.com/archlinux/archinstall/issues/107#issuecomment-841701968 # Setting an empty keymap first, allows the subsequent call to set layout for both console and x11. with Boot(self.target) as session: - os.system('systemd-run --machine=archinstall --pty localectl set-keymap ""') + os.system('systemd-run --machine=archinstall --pty localectl set-keymap ""') # type: ignore[deprecated, unused-ignore] try: session.SysCommand(['localectl', 'set-keymap', language]) @@ -2063,7 +2063,7 @@ def _service_state(self, service_name: str) -> str: def accessibility_tools_in_use() -> bool: - return os.system('systemctl is-active --quiet espeakup.service') == 0 + return os.system('systemctl is-active --quiet espeakup.service') == 0 # type: ignore[deprecated, unused-ignore] def run_custom_user_commands(commands: list[str], installation: Installer) -> None: diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py index 0f3e0597c7..68e4b30946 100644 --- a/archinstall/scripts/guided.py +++ b/archinstall/scripts/guided.py @@ -188,7 +188,7 @@ def perform_installation( case PostInstallationAction.EXIT: pass case PostInstallationAction.REBOOT: - _ = os.system('reboot') + _ = os.system('reboot') # type: ignore[deprecated, unused-ignore] case PostInstallationAction.CHROOT: try: installation.drop_to_shell() diff --git a/archinstall/tui/curses_menu.py b/archinstall/tui/curses_menu.py index 843cf72052..2bb36fc2d5 100644 --- a/archinstall/tui/curses_menu.py +++ b/archinstall/tui/curses_menu.py @@ -1312,7 +1312,7 @@ def print( clear_screen: bool = False, ) -> None: if clear_screen: - os.system('clear') + os.system('clear') # type: ignore[deprecated, unused-ignore] if Tui._t is None: print(text, end=endl) @@ -1357,7 +1357,7 @@ def _main_loop[ValueT](self, component: AbstractCurses[ValueT]) -> Result[ValueT return component.kickoff(self._screen) def _reset_terminal(self) -> None: - os.system('reset') + os.system('reset') # type: ignore[deprecated, unused-ignore] def _set_up_colors(self) -> None: curses.init_pair(STYLE.NORMAL.value, curses.COLOR_WHITE, curses.COLOR_BLACK)