Skip to content

Commit d70e03f

Browse files
authored
Update mypy to 1.20.0 (#4352)
* Update mypy to 1.20.0 This commit also removes a cast that is no longer needed after python/mypy#20602 * Ignore os.system deprecation warnings from mypy to fix CI
1 parent 29b7330 commit d70e03f

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
args: [--config=.flake8]
3232
fail_fast: true
3333
- repo: https://github.com/pre-commit/mirrors-mypy
34-
rev: v1.19.1
34+
rev: v1.20.0
3535
hooks:
3636
- id: mypy
3737
args: [

archinstall/lib/installer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ def set_keyboard_language(self, language: str) -> bool:
20092009
# In accordance with https://github.com/archlinux/archinstall/issues/107#issuecomment-841701968
20102010
# Setting an empty keymap first, allows the subsequent call to set layout for both console and x11.
20112011
with Boot(self.target) as session:
2012-
os.system('systemd-run --machine=archinstall --pty localectl set-keymap ""')
2012+
os.system('systemd-run --machine=archinstall --pty localectl set-keymap ""') # type: ignore[deprecated, unused-ignore]
20132013

20142014
try:
20152015
session.SysCommand(['localectl', 'set-keymap', language])
@@ -2075,7 +2075,7 @@ def _service_state(self, service_name: str) -> str:
20752075

20762076

20772077
def accessibility_tools_in_use() -> bool:
2078-
return os.system('systemctl is-active --quiet espeakup.service') == 0
2078+
return os.system('systemctl is-active --quiet espeakup.service') == 0 # type: ignore[deprecated, unused-ignore]
20792079

20802080

20812081
def run_custom_user_commands(commands: list[str], installation: Installer) -> None:

archinstall/lib/menu/list_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ async def _run(self) -> list[ValueT] | None:
8080
raise ValueError('Unhandled return type')
8181

8282
if value in self._base_actions:
83-
value = cast(str, value)
8483
self._data = await self.handle_action(value, None, self._data)
8584
elif value in self._terminate_actions:
8685
break

archinstall/scripts/guided.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def perform_installation(
188188
case PostInstallationAction.EXIT:
189189
pass
190190
case PostInstallationAction.REBOOT:
191-
_ = os.system('reboot')
191+
_ = os.system('reboot') # type: ignore[deprecated, unused-ignore]
192192
case PostInstallationAction.CHROOT:
193193
try:
194194
installation.drop_to_shell()

archinstall/tui/curses_menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ def print(
13121312
clear_screen: bool = False,
13131313
) -> None:
13141314
if clear_screen:
1315-
os.system('clear')
1315+
os.system('clear') # type: ignore[deprecated, unused-ignore]
13161316

13171317
if Tui._t is None:
13181318
print(text, end=endl)
@@ -1357,7 +1357,7 @@ def _main_loop[ValueT](self, component: AbstractCurses[ValueT]) -> Result[ValueT
13571357
return component.kickoff(self._screen)
13581358

13591359
def _reset_terminal(self) -> None:
1360-
os.system('reset')
1360+
os.system('reset') # type: ignore[deprecated, unused-ignore]
13611361

13621362
def _set_up_colors(self) -> None:
13631363
curses.init_pair(STYLE.NORMAL.value, curses.COLOR_WHITE, curses.COLOR_BLACK)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Source = "https://github.com/archlinux/archinstall"
3333
[project.optional-dependencies]
3434
log = ["systemd_python==235"]
3535
dev = [
36-
"mypy==1.19.1",
36+
"mypy==1.20.0",
3737
"flake8==7.3.0",
3838
"pre-commit==4.5.1",
3939
"ruff==0.15.8",

0 commit comments

Comments
 (0)