Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archinstall/default_profiles/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class ServerProfile(Profile):
def __init__(self, current_value: list[Self] | None = None):
def __init__(self, current_value: list[Self] | None = None) -> None:
super().__init__(
'Server',
ProfileType.Server,
Expand Down
2 changes: 1 addition & 1 deletion archinstall/default_profiles/xorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(
self,
name: str = 'Xorg',
profile_type: ProfileType = ProfileType.Xorg,
):
) -> None:
super().__init__(
name,
profile_type,
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/applications/application_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ApplicationMenu(AbstractSubMenu[ApplicationConfiguration]):
def __init__(
self,
preset: ApplicationConfiguration | None = None,
):
) -> None:
if preset:
self._app_config = preset
else:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/authentication/authentication_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


class AuthenticationMenu(AbstractSubMenu[AuthenticationConfiguration]):
def __init__(self, preset: AuthenticationConfiguration | None = None):
def __init__(self, preset: AuthenticationConfiguration | None = None) -> None:
if preset:
self._auth_config = preset
else:
Expand Down
8 changes: 4 additions & 4 deletions archinstall/lib/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from collections.abc import Iterator
from pathlib import Path
from types import TracebackType
from typing import ClassVar, Self
from typing import Any, ClassVar, Self

from archinstall.lib.command import SysCommand, SysCommandWorker
from archinstall.lib.exceptions import SysCallError
Expand All @@ -12,7 +12,7 @@
class Boot:
_active_boot: ClassVar[Self | None] = None

def __init__(self, path: Path | str):
def __init__(self, path: Path | str) -> None:
if isinstance(path, Path):
path = str(path)

Expand Down Expand Up @@ -104,8 +104,8 @@ def is_alive(self) -> bool:

return self.session.is_alive()

def SysCommand(self, cmd: list[str], *args, **kwargs) -> SysCommand: # type: ignore[no-untyped-def]
def SysCommand(self, cmd: list[str], *args: Any, **kwargs: Any) -> SysCommand:
return SysCommand(['systemd-run', f'--machine={self.container_name}', '--pty', *cmd], *args, **kwargs)

def SysCommandWorker(self, cmd: list[str], *args, **kwargs) -> SysCommandWorker: # type: ignore[no-untyped-def]
def SysCommandWorker(self, cmd: list[str], *args: Any, **kwargs: Any) -> SysCommandWorker:
return SysCommandWorker(['systemd-run', f'--machine={self.container_name}', '--pty', *cmd], *args, **kwargs)
2 changes: 1 addition & 1 deletion archinstall/lib/bootloader/bootloader_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(
bootloader_conf: BootloaderConfiguration,
uefi: bool,
skip_boot: bool = False,
):
) -> None:
self._bootloader_conf = bootloader_conf
self._skip_boot = skip_boot
self._uefi = uefi
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
environment_vars: dict[str, str] | None = None,
working_directory: str = './',
remove_vt100_escape_codes_from_lines: bool = True,
):
) -> None:
if isinstance(cmd, str):
cmd = shlex.split(cmd)

Expand Down Expand Up @@ -232,7 +232,7 @@ def __init__(
environment_vars: dict[str, str] | None = None,
working_directory: str = './',
remove_vt100_escape_codes_from_lines: bool = True,
):
) -> None:
self.cmd = cmd
self.peek_output = peek_output
self.environment_vars = environment_vars
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/disk_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DiskMenuConfig:


class DiskLayoutConfigurationMenu(AbstractSubMenu[DiskMenuConfig]):
def __init__(self, disk_layout_config: DiskLayoutConfiguration | None):
def __init__(self, disk_layout_config: DiskLayoutConfiguration | None) -> None:
if not disk_layout_config:
self._disk_menu_config = DiskMenuConfig(
disk_config=None,
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/encryption_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
device_modifications: list[DeviceModification],
lvm_config: LvmConfiguration | None = None,
preset: DiskEncryption | None = None,
):
) -> None:
if preset:
self._enc_config = preset
else:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


class FilesystemHandler:
def __init__(self, disk_config: DiskLayoutConfiguration):
def __init__(self, disk_config: DiskLayoutConfiguration) -> None:
self._disk_config = disk_config
self._enc_config = disk_config.disk_encryption

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/subvolume_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(
self,
btrfs_subvols: list[SubvolumeModification],
prompt: str | None = None,
):
) -> None:
self._actions = [
tr('Add subvolume'),
tr('Edit subvolume'),
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(
base_packages: list[str] | None = None,
kernels: list[str] | None = None,
silent: bool = False,
):
) -> None:
"""
`Installer()` is the wrapper for most basic installation steps.
It also wraps :py:func:`~archinstall.Installer.pacstrap` among other things.
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/locale/locale_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LocaleMenu(AbstractSubMenu[LocaleConfiguration]):
def __init__(
self,
locale_conf: LocaleConfiguration,
):
) -> None:
self._locale_conf = locale_conf
menu_options = self._define_menu_options()

Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/menu/abstract_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
auto_cursor: bool = True,
allow_reset: bool = False,
reset_warning: str | None = None,
):
) -> None:
self._menu_item_group = item_group
self._config = config
self.auto_cursor = auto_cursor
Expand Down Expand Up @@ -152,7 +152,7 @@ def __init__(
config: Any,
auto_cursor: bool = True,
allow_reset: bool = False,
):
) -> None:
back_text = '← ' + tr('Back')
item_group.add_item(MenuItem(text=back_text))

Expand Down
12 changes: 6 additions & 6 deletions archinstall/lib/menu/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(
multi: bool = False,
enable_filter: bool = False,
wrap_preview: bool = False,
):
) -> None:
self._header = header
self._title = title
self._group: MenuItemGroup = group
Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(
preset: bool = False,
preview_location: Literal['bottom'] | None = None,
preview_header: str | None = None,
):
) -> None:
self._header = header
self._allow_skip = allow_skip
self._allow_reset = allow_reset
Expand Down Expand Up @@ -108,7 +108,7 @@ async def show(self) -> Result[bool]:


class Notify:
def __init__(self, header: str):
def __init__(self, header: str) -> None:
self._header = header

async def show(self) -> Result[bool]:
Expand Down Expand Up @@ -143,7 +143,7 @@ def __init__(
allow_reset: bool = False,
validator_callback: Callable[[str], str | None] | None = None,
info_callback: Callable[[str], InputInfo | None] | None = None,
):
) -> None:
self._header = header
self._placeholder = placeholder
self._password = password
Expand Down Expand Up @@ -182,7 +182,7 @@ def __init__(
header: str | None = None,
timer: int = 3,
data_callback: Callable[[], Any] | None = None,
):
) -> None:
self._header = header
self._timer = timer
self._data_callback = data_callback
Expand Down Expand Up @@ -215,7 +215,7 @@ def __init__(
multi: bool = False,
preview_location: Literal['bottom'] | None = None,
preview_header: str | None = None,
):
) -> None:
self._header = header
self._group = group
self._data_callback = group_callback
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/menu/list_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(
base_actions: list[str],
sub_menu_actions: list[str],
prompt: str | None = None,
):
) -> None:
"""
:param prompt: Text which will appear at the header
type param: string
Expand Down
6 changes: 3 additions & 3 deletions archinstall/lib/mirror/mirror_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


class CustomMirrorRepositoriesList(ListManager[CustomRepository]):
def __init__(self, custom_repositories: list[CustomRepository]):
def __init__(self, custom_repositories: list[CustomRepository]) -> None:
self._actions = [
tr('Add a custom repository'),
tr('Change custom repository'),
Expand Down Expand Up @@ -141,7 +141,7 @@ async def _add_custom_repository(self, preset: CustomRepository | None = None) -


class CustomMirrorServersList(ListManager[CustomServer]):
def __init__(self, custom_servers: list[CustomServer]):
def __init__(self, custom_servers: list[CustomServer]) -> None:
self._actions = [
tr('Add a custom server'),
tr('Change custom server'),
Expand Down Expand Up @@ -206,7 +206,7 @@ def __init__(
self,
mirror_list_handler: MirrorListHandler,
preset: MirrorConfiguration | None = None,
):
) -> None:
if preset:
self._mirror_config = preset
else:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def table_data(self) -> _SubvolumeModificationSerialization:


class DeviceGeometry:
def __init__(self, geometry: Geometry, sector_size: SectorSize):
def __init__(self, geometry: Geometry, sector_size: SectorSize) -> None:
self._geometry = geometry
self._sector_size = sector_size

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/models/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(
self,
plaintext: str = '',
enc_password: str | None = None,
):
) -> None:
if plaintext:
enc_password = crypt_yescrypt(plaintext)

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/network/network_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class ManualNetworkConfig(ListManager[Nic]):
def __init__(self, prompt: str, preset: list[Nic]):
def __init__(self, prompt: str, preset: list[Nic]) -> None:
self._actions = [
tr('Add interface'),
tr('Edit interface'),
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DownloadTimer:
Context manager for timing downloads with timeouts.
"""

def __init__(self, timeout: int = 5):
def __init__(self, timeout: int = 5) -> None:
"""
Args:
timeout:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/pacman/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class PacmanConfig:
def __init__(self, target: Path | None):
def __init__(self, target: Path | None) -> None:
self._config_remote_path: Path | None = None

if target:
Expand Down
5 changes: 3 additions & 2 deletions archinstall/lib/pacman/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
from collections.abc import Callable
from pathlib import Path
from typing import Any

from archinstall.lib.command import SysCommand
from archinstall.lib.exceptions import RequirementError, SysCallError
Expand All @@ -12,7 +13,7 @@


class Pacman:
def __init__(self, target: Path, silent: bool = False):
def __init__(self, target: Path, silent: bool = False) -> None:
self.synced = False
self.silent = silent
self.target = target
Expand All @@ -39,7 +40,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[no-untyped-def, type-arg]
def ask(self, error_message: str, bail_message: str, func: Callable, *args: Any, **kwargs: Any) -> None: # type: ignore[type-arg]
while True:
try:
func(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/pacman/pacman_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(
self,
pacman_conf: PacmanConfiguration,
advanced: bool = False,
):
) -> None:
self._pacman_conf = pacman_conf
self._advanced = advanced
menu_options = self._define_menu_options()
Expand Down
3 changes: 2 additions & 1 deletion archinstall/lib/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
from importlib import metadata
from pathlib import Path
from typing import Any

from archinstall.lib.log import error, info, warn
from archinstall.lib.version import get_version
Expand All @@ -27,7 +28,7 @@

# @archinstall.plugin decorator hook to programmatically add
# plugins in runtime. Useful in profiles_bck and other things.
def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def]
def plugin(f: Any, *args: Any, **kwargs: Any) -> None:
plugins[f.__name__] = f


Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/profile/profile_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ProfileMenu(AbstractSubMenu[ProfileConfiguration]):
def __init__(
self,
preset: ProfileConfiguration | None = None,
):
) -> None:
if preset:
self._profile_config = preset
else:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/translationhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _provided_translations(self) -> list[str]:


class _DeferredTranslation:
def __init__(self, message: str):
def __init__(self, message: str) -> None:
self.message = message

@override
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/user/user_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class UserList(ListManager[User]):
def __init__(self, prompt: str, lusers: list[User]):
def __init__(self, prompt: str, lusers: list[User]) -> None:
self._actions = [
tr('Add a user'),
tr('Change password'),
Expand Down
Loading
Loading