From f7d0f0413bdff845295de49275d455a3a9211d2c Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Fri, 16 Jan 2026 19:13:59 -0500 Subject: [PATCH] Remove quotes from Installer type annotations --- archinstall/applications/audio.py | 6 ++++-- archinstall/applications/bluetooth.py | 4 +++- archinstall/applications/firewall.py | 4 +++- archinstall/applications/power_management.py | 4 +++- archinstall/applications/print_service.py | 4 +++- archinstall/default_profiles/custom.py | 6 ++++-- archinstall/default_profiles/desktop.py | 6 ++++-- archinstall/default_profiles/desktops/awesome.py | 4 +++- archinstall/default_profiles/profile.py | 4 ++-- archinstall/default_profiles/server.py | 6 ++++-- archinstall/default_profiles/servers/docker.py | 4 +++- archinstall/default_profiles/servers/mariadb.py | 4 +++- archinstall/default_profiles/servers/postgresql.py | 4 +++- archinstall/lib/applications/application_handler.py | 4 +++- .../lib/authentication/authentication_handler.py | 10 ++++++---- archinstall/lib/profile/profiles_handler.py | 8 +++++--- 16 files changed, 56 insertions(+), 26 deletions(-) diff --git a/archinstall/applications/audio.py b/archinstall/applications/audio.py index 82f7af72a7..bf965be521 100644 --- a/archinstall/applications/audio.py +++ b/archinstall/applications/audio.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING from archinstall.lib.hardware import SysInfo @@ -30,7 +32,7 @@ def pipewire_packages(self) -> list[str]: def _enable_pipewire( self, - install_session: 'Installer', + install_session: Installer, users: list['User'] | None = None, ) -> None: if users is None: @@ -56,7 +58,7 @@ def _enable_pipewire( def install( self, - install_session: 'Installer', + install_session: Installer, audio_config: AudioConfiguration, users: list[User] | None = None, ) -> None: diff --git a/archinstall/applications/bluetooth.py b/archinstall/applications/bluetooth.py index bf05611cf5..6b096c5145 100644 --- a/archinstall/applications/bluetooth.py +++ b/archinstall/applications/bluetooth.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING from archinstall.lib.output import debug @@ -20,7 +22,7 @@ def services(self) -> list[str]: 'bluetooth.service', ] - def install(self, install_session: 'Installer') -> None: + def install(self, install_session: Installer) -> None: debug('Installing Bluetooth') install_session.add_additional_packages(self.packages) install_session.enable_service(self.services) diff --git a/archinstall/applications/firewall.py b/archinstall/applications/firewall.py index 02d4ed9e24..a94be7c5d7 100644 --- a/archinstall/applications/firewall.py +++ b/archinstall/applications/firewall.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING from archinstall.lib.models.application import Firewall, FirewallConfiguration @@ -34,7 +36,7 @@ def fwd_services(self) -> list[str]: def install( self, - install_session: 'Installer', + install_session: Installer, firewall_config: FirewallConfiguration, ) -> None: debug(f'Installing firewall: {firewall_config.firewall.value}') diff --git a/archinstall/applications/power_management.py b/archinstall/applications/power_management.py index ec89381df4..57e88b8a53 100644 --- a/archinstall/applications/power_management.py +++ b/archinstall/applications/power_management.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING from archinstall.lib.models.application import PowerManagement, PowerManagementConfiguration @@ -23,7 +25,7 @@ def tuned_packages(self) -> list[str]: def install( self, - install_session: 'Installer', + install_session: Installer, power_management_config: PowerManagementConfiguration, ) -> None: debug(f'Installing power management daemon: {power_management_config.power_management.value}') diff --git a/archinstall/applications/print_service.py b/archinstall/applications/print_service.py index 7660bad496..e3bcb06c84 100644 --- a/archinstall/applications/print_service.py +++ b/archinstall/applications/print_service.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING from archinstall.lib.output import debug @@ -17,7 +19,7 @@ def services(self) -> list[str]: 'cups.service', ] - def install(self, install_session: 'Installer') -> None: + def install(self, install_session: Installer) -> None: debug('Installing print service') install_session.add_additional_packages(self.packages) install_session.enable_service(self.services) diff --git a/archinstall/default_profiles/custom.py b/archinstall/default_profiles/custom.py index 1f21254c7b..a58cf91eb4 100644 --- a/archinstall/default_profiles/custom.py +++ b/archinstall/default_profiles/custom.py @@ -1,3 +1,5 @@ +# from __future__ import annotations +# # from typing import List, Dict, Optional, TYPE_CHECKING, Any # # from ..lib import menu @@ -157,11 +159,11 @@ # # return SelectResult.NewSelection # -# def post_install(self, install_session: 'Installer'): +# def post_install(self, install_session: Installer): # for profile in self._current_selection: # profile.post_install(install_session) # -# def install(self, install_session: 'Installer'): +# def install(self, install_session: Installer): # driver_packages = self.gfx_driver_packages() # install_session.add_additional_packages(driver_packages) # diff --git a/archinstall/default_profiles/desktop.py b/archinstall/default_profiles/desktop.py index cc49395ed1..4973c4f41d 100644 --- a/archinstall/default_profiles/desktop.py +++ b/archinstall/default_profiles/desktop.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING, Self, override from archinstall.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult @@ -89,12 +91,12 @@ def do_on_select(self) -> SelectResult: return SelectResult.ResetCurrent @override - def post_install(self, install_session: 'Installer') -> None: + def post_install(self, install_session: Installer) -> None: for profile in self.current_selection: profile.post_install(install_session) @override - def install(self, install_session: 'Installer') -> None: + def install(self, install_session: Installer) -> None: # Install common packages for all desktop environments install_session.add_additional_packages(self.packages) diff --git a/archinstall/default_profiles/desktops/awesome.py b/archinstall/default_profiles/desktops/awesome.py index 727b18ac7e..05a4d09778 100644 --- a/archinstall/default_profiles/desktops/awesome.py +++ b/archinstall/default_profiles/desktops/awesome.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING, override from archinstall.default_profiles.profile import ProfileType @@ -29,7 +31,7 @@ def packages(self) -> list[str]: ] @override - def install(self, install_session: 'Installer') -> None: + def install(self, install_session: Installer) -> None: super().install(install_session) # TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead. diff --git a/archinstall/default_profiles/profile.py b/archinstall/default_profiles/profile.py index b787766b2e..0a6ed26ff8 100644 --- a/archinstall/default_profiles/profile.py +++ b/archinstall/default_profiles/profile.py @@ -101,12 +101,12 @@ def _advanced_check(self) -> bool: return self.advanced is False or arch_config_handler.args.advanced is True - def install(self, install_session: 'Installer') -> None: + def install(self, install_session: Installer) -> None: """ Performs installation steps when this profile was selected """ - def post_install(self, install_session: 'Installer') -> None: + def post_install(self, install_session: Installer) -> None: """ Hook that will be called when the installation process is finished and custom installation steps for specific default_profiles diff --git a/archinstall/default_profiles/server.py b/archinstall/default_profiles/server.py index 3865462ecd..6fbc5c9ae3 100644 --- a/archinstall/default_profiles/server.py +++ b/archinstall/default_profiles/server.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING, Self, override from archinstall.default_profiles.profile import Profile, ProfileType, SelectResult @@ -55,12 +57,12 @@ def do_on_select(self) -> SelectResult: return SelectResult.ResetCurrent @override - def post_install(self, install_session: 'Installer') -> None: + def post_install(self, install_session: Installer) -> None: for profile in self.current_selection: profile.post_install(install_session) @override - def install(self, install_session: 'Installer') -> None: + def install(self, install_session: Installer) -> None: server_info = self.current_selection_names() details = ', '.join(server_info) info(f'Now installing the selected servers: {details}') diff --git a/archinstall/default_profiles/servers/docker.py b/archinstall/default_profiles/servers/docker.py index d95e172019..d02cf519ee 100644 --- a/archinstall/default_profiles/servers/docker.py +++ b/archinstall/default_profiles/servers/docker.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING, override from archinstall.default_profiles.profile import Profile, ProfileType @@ -24,7 +26,7 @@ def services(self) -> list[str]: return ['docker'] @override - def post_install(self, install_session: 'Installer') -> None: + def post_install(self, install_session: Installer) -> None: from archinstall.lib.args import arch_config_handler if auth_config := arch_config_handler.config.auth_config: diff --git a/archinstall/default_profiles/servers/mariadb.py b/archinstall/default_profiles/servers/mariadb.py index 2cdafaeb41..c5587ea1f6 100644 --- a/archinstall/default_profiles/servers/mariadb.py +++ b/archinstall/default_profiles/servers/mariadb.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING, override from archinstall.default_profiles.profile import Profile, ProfileType @@ -24,5 +26,5 @@ def services(self) -> list[str]: return ['mariadb'] @override - def post_install(self, install_session: 'Installer') -> None: + def post_install(self, install_session: Installer) -> None: install_session.arch_chroot('mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql') diff --git a/archinstall/default_profiles/servers/postgresql.py b/archinstall/default_profiles/servers/postgresql.py index c93c132871..013370616c 100644 --- a/archinstall/default_profiles/servers/postgresql.py +++ b/archinstall/default_profiles/servers/postgresql.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING, override from archinstall.default_profiles.profile import Profile, ProfileType @@ -24,5 +26,5 @@ def services(self) -> list[str]: return ['postgresql'] @override - def post_install(self, install_session: 'Installer') -> None: + def post_install(self, install_session: Installer) -> None: install_session.arch_chroot('initdb -D /var/lib/postgres/data', run_as='postgres') diff --git a/archinstall/lib/applications/application_handler.py b/archinstall/lib/applications/application_handler.py index e7d16058d5..592f2e26e8 100644 --- a/archinstall/lib/applications/application_handler.py +++ b/archinstall/lib/applications/application_handler.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import TYPE_CHECKING from archinstall.applications.audio import AudioApp @@ -17,7 +19,7 @@ class ApplicationHandler: def __init__(self) -> None: pass - def install_applications(self, install_session: 'Installer', app_config: ApplicationConfiguration, users: list['User'] | None = None) -> None: + def install_applications(self, install_session: Installer, app_config: ApplicationConfiguration, users: list['User'] | None = None) -> None: if app_config.bluetooth_config and app_config.bluetooth_config.enabled: BluetoothApp().install(install_session) diff --git a/archinstall/lib/authentication/authentication_handler.py b/archinstall/lib/authentication/authentication_handler.py index 918b968b78..e5a86c1e85 100644 --- a/archinstall/lib/authentication/authentication_handler.py +++ b/archinstall/lib/authentication/authentication_handler.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import getpass from pathlib import Path from typing import TYPE_CHECKING @@ -16,20 +18,20 @@ class AuthenticationHandler: def setup_auth( self, - install_session: 'Installer', + install_session: Installer, auth_config: AuthenticationConfiguration, hostname: str, ) -> None: if auth_config.u2f_config and auth_config.users is not None: self._setup_u2f_login(install_session, auth_config.u2f_config, auth_config.users, hostname) - def _setup_u2f_login(self, install_session: 'Installer', u2f_config: U2FLoginConfiguration, users: list[User], hostname: str) -> None: + def _setup_u2f_login(self, install_session: Installer, u2f_config: U2FLoginConfiguration, users: list[User], hostname: str) -> None: self._configure_u2f_mapping(install_session, u2f_config, users, hostname) self._update_pam_config(install_session, u2f_config) def _update_pam_config( self, - install_session: 'Installer', + install_session: Installer, u2f_config: U2FLoginConfiguration, ) -> None: match u2f_config.u2f_login_method: @@ -73,7 +75,7 @@ def _add_u2f_entry(self, file: Path, entry: str) -> None: def _configure_u2f_mapping( self, - install_session: 'Installer', + install_session: Installer, u2f_config: U2FLoginConfiguration, users: list[User], hostname: str, diff --git a/archinstall/lib/profile/profiles_handler.py b/archinstall/lib/profile/profiles_handler.py index 2874bc5eea..1ac208d451 100644 --- a/archinstall/lib/profile/profiles_handler.py +++ b/archinstall/lib/profile/profiles_handler.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import importlib.util import inspect import sys @@ -171,7 +173,7 @@ def get_desktop_profiles(self) -> list[Profile]: def get_custom_profiles(self) -> list[Profile]: return [p for p in self.profiles if p.is_custom_type_profile()] - def install_greeter(self, install_session: 'Installer', greeter: GreeterType) -> None: + def install_greeter(self, install_session: Installer, greeter: GreeterType) -> None: packages = [] service = None service_disable = None @@ -215,7 +217,7 @@ def install_greeter(self, install_session: 'Installer', greeter: GreeterType) -> with open(path, 'w') as file: file.write(filedata) - def install_gfx_driver(self, install_session: 'Installer', driver: GfxDriver) -> None: + def install_gfx_driver(self, install_session: Installer, driver: GfxDriver) -> None: debug(f'Installing GFX driver: {driver.value}') if driver in [GfxDriver.NvidiaOpenKernel, GfxDriver.NvidiaProprietary]: @@ -227,7 +229,7 @@ def install_gfx_driver(self, install_session: 'Installer', driver: GfxDriver) -> pkg_names = [p.value for p in driver_pkgs] install_session.add_additional_packages(pkg_names) - def install_profile_config(self, install_session: 'Installer', profile_config: ProfileConfiguration) -> None: + def install_profile_config(self, install_session: Installer, profile_config: ProfileConfiguration) -> None: profile = profile_config.profile if not profile: