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 typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.lib.hardware import SysInfo
|
from archinstall.lib.hardware import SysInfo
|
||||||
|
|
@ -30,7 +32,7 @@ class AudioApp:
|
||||||
|
|
||||||
def _enable_pipewire(
|
def _enable_pipewire(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
users: list['User'] | None = None,
|
users: list['User'] | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
if users is None:
|
if users is None:
|
||||||
|
|
@ -56,7 +58,7 @@ class AudioApp:
|
||||||
|
|
||||||
def install(
|
def install(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
audio_config: AudioConfiguration,
|
audio_config: AudioConfiguration,
|
||||||
users: list[User] | None = None,
|
users: list[User] | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.lib.output import debug
|
from archinstall.lib.output import debug
|
||||||
|
|
@ -20,7 +22,7 @@ class BluetoothApp:
|
||||||
'bluetooth.service',
|
'bluetooth.service',
|
||||||
]
|
]
|
||||||
|
|
||||||
def install(self, install_session: 'Installer') -> None:
|
def install(self, install_session: Installer) -> None:
|
||||||
debug('Installing Bluetooth')
|
debug('Installing Bluetooth')
|
||||||
install_session.add_additional_packages(self.packages)
|
install_session.add_additional_packages(self.packages)
|
||||||
install_session.enable_service(self.services)
|
install_session.enable_service(self.services)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.lib.models.application import Firewall, FirewallConfiguration
|
from archinstall.lib.models.application import Firewall, FirewallConfiguration
|
||||||
|
|
@ -34,7 +36,7 @@ class FirewallApp:
|
||||||
|
|
||||||
def install(
|
def install(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
firewall_config: FirewallConfiguration,
|
firewall_config: FirewallConfiguration,
|
||||||
) -> None:
|
) -> None:
|
||||||
debug(f'Installing firewall: {firewall_config.firewall.value}')
|
debug(f'Installing firewall: {firewall_config.firewall.value}')
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.lib.models.application import PowerManagement, PowerManagementConfiguration
|
from archinstall.lib.models.application import PowerManagement, PowerManagementConfiguration
|
||||||
|
|
@ -23,7 +25,7 @@ class PowerManagementApp:
|
||||||
|
|
||||||
def install(
|
def install(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
power_management_config: PowerManagementConfiguration,
|
power_management_config: PowerManagementConfiguration,
|
||||||
) -> None:
|
) -> None:
|
||||||
debug(f'Installing power management daemon: {power_management_config.power_management.value}')
|
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 typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.lib.output import debug
|
from archinstall.lib.output import debug
|
||||||
|
|
@ -17,7 +19,7 @@ class PrintServiceApp:
|
||||||
'cups.service',
|
'cups.service',
|
||||||
]
|
]
|
||||||
|
|
||||||
def install(self, install_session: 'Installer') -> None:
|
def install(self, install_session: Installer) -> None:
|
||||||
debug('Installing print service')
|
debug('Installing print service')
|
||||||
install_session.add_additional_packages(self.packages)
|
install_session.add_additional_packages(self.packages)
|
||||||
install_session.enable_service(self.services)
|
install_session.enable_service(self.services)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
# from __future__ import annotations
|
||||||
|
#
|
||||||
# from typing import List, Dict, Optional, TYPE_CHECKING, Any
|
# from typing import List, Dict, Optional, TYPE_CHECKING, Any
|
||||||
#
|
#
|
||||||
# from ..lib import menu
|
# from ..lib import menu
|
||||||
|
|
@ -157,11 +159,11 @@
|
||||||
#
|
#
|
||||||
# return SelectResult.NewSelection
|
# return SelectResult.NewSelection
|
||||||
#
|
#
|
||||||
# def post_install(self, install_session: 'Installer'):
|
# def post_install(self, install_session: Installer):
|
||||||
# for profile in self._current_selection:
|
# for profile in self._current_selection:
|
||||||
# profile.post_install(install_session)
|
# profile.post_install(install_session)
|
||||||
#
|
#
|
||||||
# def install(self, install_session: 'Installer'):
|
# def install(self, install_session: Installer):
|
||||||
# driver_packages = self.gfx_driver_packages()
|
# driver_packages = self.gfx_driver_packages()
|
||||||
# install_session.add_additional_packages(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 typing import TYPE_CHECKING, Self, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult
|
from archinstall.default_profiles.profile import GreeterType, Profile, ProfileType, SelectResult
|
||||||
|
|
@ -89,12 +91,12 @@ class DesktopProfile(Profile):
|
||||||
return SelectResult.ResetCurrent
|
return SelectResult.ResetCurrent
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def post_install(self, install_session: 'Installer') -> None:
|
def post_install(self, install_session: Installer) -> None:
|
||||||
for profile in self.current_selection:
|
for profile in self.current_selection:
|
||||||
profile.post_install(install_session)
|
profile.post_install(install_session)
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def install(self, install_session: 'Installer') -> None:
|
def install(self, install_session: Installer) -> None:
|
||||||
# Install common packages for all desktop environments
|
# Install common packages for all desktop environments
|
||||||
install_session.add_additional_packages(self.packages)
|
install_session.add_additional_packages(self.packages)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import ProfileType
|
from archinstall.default_profiles.profile import ProfileType
|
||||||
|
|
@ -29,7 +31,7 @@ class AwesomeProfile(XorgProfile):
|
||||||
]
|
]
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def install(self, install_session: 'Installer') -> None:
|
def install(self, install_session: Installer) -> None:
|
||||||
super().install(install_session)
|
super().install(install_session)
|
||||||
|
|
||||||
# TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead.
|
# 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
|
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
|
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
|
Hook that will be called when the installation process is
|
||||||
finished and custom installation steps for specific default_profiles
|
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 typing import TYPE_CHECKING, Self, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import Profile, ProfileType, SelectResult
|
from archinstall.default_profiles.profile import Profile, ProfileType, SelectResult
|
||||||
|
|
@ -55,12 +57,12 @@ class ServerProfile(Profile):
|
||||||
return SelectResult.ResetCurrent
|
return SelectResult.ResetCurrent
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def post_install(self, install_session: 'Installer') -> None:
|
def post_install(self, install_session: Installer) -> None:
|
||||||
for profile in self.current_selection:
|
for profile in self.current_selection:
|
||||||
profile.post_install(install_session)
|
profile.post_install(install_session)
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def install(self, install_session: 'Installer') -> None:
|
def install(self, install_session: Installer) -> None:
|
||||||
server_info = self.current_selection_names()
|
server_info = self.current_selection_names()
|
||||||
details = ', '.join(server_info)
|
details = ', '.join(server_info)
|
||||||
info(f'Now installing the selected servers: {details}')
|
info(f'Now installing the selected servers: {details}')
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import Profile, ProfileType
|
from archinstall.default_profiles.profile import Profile, ProfileType
|
||||||
|
|
@ -24,7 +26,7 @@ class DockerProfile(Profile):
|
||||||
return ['docker']
|
return ['docker']
|
||||||
|
|
||||||
@override
|
@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
|
from archinstall.lib.args import arch_config_handler
|
||||||
|
|
||||||
if auth_config := arch_config_handler.config.auth_config:
|
if auth_config := arch_config_handler.config.auth_config:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import Profile, ProfileType
|
from archinstall.default_profiles.profile import Profile, ProfileType
|
||||||
|
|
@ -24,5 +26,5 @@ class MariadbProfile(Profile):
|
||||||
return ['mariadb']
|
return ['mariadb']
|
||||||
|
|
||||||
@override
|
@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')
|
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 typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from archinstall.default_profiles.profile import Profile, ProfileType
|
from archinstall.default_profiles.profile import Profile, ProfileType
|
||||||
|
|
@ -24,5 +26,5 @@ class PostgresqlProfile(Profile):
|
||||||
return ['postgresql']
|
return ['postgresql']
|
||||||
|
|
||||||
@override
|
@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')
|
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 typing import TYPE_CHECKING
|
||||||
|
|
||||||
from archinstall.applications.audio import AudioApp
|
from archinstall.applications.audio import AudioApp
|
||||||
|
|
@ -17,7 +19,7 @@ class ApplicationHandler:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
pass
|
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:
|
if app_config.bluetooth_config and app_config.bluetooth_config.enabled:
|
||||||
BluetoothApp().install(install_session)
|
BluetoothApp().install(install_session)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import getpass
|
import getpass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
@ -16,20 +18,20 @@ if TYPE_CHECKING:
|
||||||
class AuthenticationHandler:
|
class AuthenticationHandler:
|
||||||
def setup_auth(
|
def setup_auth(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
auth_config: AuthenticationConfiguration,
|
auth_config: AuthenticationConfiguration,
|
||||||
hostname: str,
|
hostname: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
if auth_config.u2f_config and auth_config.users is not 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)
|
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._configure_u2f_mapping(install_session, u2f_config, users, hostname)
|
||||||
self._update_pam_config(install_session, u2f_config)
|
self._update_pam_config(install_session, u2f_config)
|
||||||
|
|
||||||
def _update_pam_config(
|
def _update_pam_config(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
u2f_config: U2FLoginConfiguration,
|
u2f_config: U2FLoginConfiguration,
|
||||||
) -> None:
|
) -> None:
|
||||||
match u2f_config.u2f_login_method:
|
match u2f_config.u2f_login_method:
|
||||||
|
|
@ -73,7 +75,7 @@ class AuthenticationHandler:
|
||||||
|
|
||||||
def _configure_u2f_mapping(
|
def _configure_u2f_mapping(
|
||||||
self,
|
self,
|
||||||
install_session: 'Installer',
|
install_session: Installer,
|
||||||
u2f_config: U2FLoginConfiguration,
|
u2f_config: U2FLoginConfiguration,
|
||||||
users: list[User],
|
users: list[User],
|
||||||
hostname: str,
|
hostname: str,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import inspect
|
import inspect
|
||||||
import sys
|
import sys
|
||||||
|
|
@ -171,7 +173,7 @@ class ProfileHandler:
|
||||||
def get_custom_profiles(self) -> list[Profile]:
|
def get_custom_profiles(self) -> list[Profile]:
|
||||||
return [p for p in self.profiles if p.is_custom_type_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 = []
|
packages = []
|
||||||
service = None
|
service = None
|
||||||
service_disable = None
|
service_disable = None
|
||||||
|
|
@ -215,7 +217,7 @@ class ProfileHandler:
|
||||||
with open(path, 'w') as file:
|
with open(path, 'w') as file:
|
||||||
file.write(filedata)
|
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}')
|
debug(f'Installing GFX driver: {driver.value}')
|
||||||
|
|
||||||
if driver in [GfxDriver.NvidiaOpenKernel, GfxDriver.NvidiaProprietary]:
|
if driver in [GfxDriver.NvidiaOpenKernel, GfxDriver.NvidiaProprietary]:
|
||||||
|
|
@ -227,7 +229,7 @@ class ProfileHandler:
|
||||||
pkg_names = [p.value for p in driver_pkgs]
|
pkg_names = [p.value for p in driver_pkgs]
|
||||||
install_session.add_additional_packages(pkg_names)
|
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
|
profile = profile_config.profile
|
||||||
|
|
||||||
if not profile:
|
if not profile:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue