Remove quotes from Installer type annotations (#4136)
This commit is contained in:
parent
7b45613996
commit
a150a8d9f7
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from archinstall.lib.hardware import SysInfo
|
||||
|
|
@ -30,7 +32,7 @@ class AudioApp:
|
|||
|
||||
def _enable_pipewire(
|
||||
self,
|
||||
install_session: 'Installer',
|
||||
install_session: Installer,
|
||||
users: list['User'] | None = None,
|
||||
) -> None:
|
||||
if users is None:
|
||||
|
|
@ -56,7 +58,7 @@ class AudioApp:
|
|||
|
||||
def install(
|
||||
self,
|
||||
install_session: 'Installer',
|
||||
install_session: Installer,
|
||||
audio_config: AudioConfiguration,
|
||||
users: list[User] | None = None,
|
||||
) -> None:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from archinstall.lib.output import debug
|
||||
|
|
@ -20,7 +22,7 @@ class BluetoothApp:
|
|||
'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)
|
||||
|
|
|
|||
|
|
@ -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 @@ class FirewallApp:
|
|||
|
||||
def install(
|
||||
self,
|
||||
install_session: 'Installer',
|
||||
install_session: Installer,
|
||||
firewall_config: FirewallConfiguration,
|
||||
) -> None:
|
||||
debug(f'Installing firewall: {firewall_config.firewall.value}')
|
||||
|
|
|
|||
|
|
@ -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 @@ class PowerManagementApp:
|
|||
|
||||
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}')
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from archinstall.lib.output import debug
|
||||
|
|
@ -17,7 +19,7 @@ class PrintServiceApp:
|
|||
'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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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 @@ class DesktopProfile(Profile):
|
|||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 @@ class AwesomeProfile(XorgProfile):
|
|||
]
|
||||
|
||||
@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.
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ class Profile:
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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 @@ class ServerProfile(Profile):
|
|||
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}')
|
||||
|
|
|
|||
|
|
@ -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 @@ class DockerProfile(Profile):
|
|||
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:
|
||||
|
|
|
|||
|
|
@ -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 @@ class MariadbProfile(Profile):
|
|||
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')
|
||||
|
|
|
|||
|
|
@ -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 @@ class PostgresqlProfile(Profile):
|
|||
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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import getpass
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
|
@ -16,20 +18,20 @@ if TYPE_CHECKING:
|
|||
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 @@ class AuthenticationHandler:
|
|||
|
||||
def _configure_u2f_mapping(
|
||||
self,
|
||||
install_session: 'Installer',
|
||||
install_session: Installer,
|
||||
u2f_config: U2FLoginConfiguration,
|
||||
users: list[User],
|
||||
hostname: str,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import inspect
|
||||
import sys
|
||||
|
|
@ -171,7 +173,7 @@ class ProfileHandler:
|
|||
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 @@ class ProfileHandler:
|
|||
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 @@ class ProfileHandler:
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue