Skip to content

Commit 657c5d5

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5a6c100 + 7a455cb commit 657c5d5

117 files changed

Lines changed: 2188 additions & 2546 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[flake8]
22
count = True
3-
ignore = W191,W503
3+
ignore = W191,W503,E704,E203
44
max-complexity = 40
55
max-line-length = 160
66
show-source = True
77
statistics = True
8-
builtins = _
98
exclude = .git,__pycache__,build,docs,actions-runner

.github/workflows/python-publish.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ jobs:
1111
deploy:
1212

1313
runs-on: ubuntu-latest
14-
14+
permissions:
15+
# IMPORTANT: this permission is mandatory for Trusted Publishing
16+
id-token: write
17+
container:
18+
image: archlinux/archlinux:latest
19+
options: --privileged
1520
steps:
1621
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
17-
- name: Set up Python
18-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
19-
with:
20-
python-version: '3.x'
2122
- name: Prepare arch
2223
run: |
2324
pacman-key --init
2425
pacman --noconfirm -Sy archlinux-keyring
2526
pacman --noconfirm -Syyu
26-
pacman --noconfirm -Sy python-uv python-setuptools python-pip
27+
pacman --noconfirm -Sy python python-uv python-setuptools python-pip python-pyparted python-pydantic
2728
- name: Build archinstall
2829
run: |
2930
uv build --no-build-isolation --wheel

.github/workflows/ruff-format.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: [ push, pull_request ]
2+
name: ruff check formatting
3+
jobs:
4+
ruff_format_check:
5+
runs-on: ubuntu-latest
6+
container:
7+
image: archlinux/archlinux:latest
8+
steps:
9+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
10+
- uses: astral-sh/ruff-action@eaf0ecdd668ceea36159ff9d91882c9795d89b49 # v3.4.0
11+
- run: ruff check --select=COM812 --fix
12+
- run: ruff format --diff
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
on: [ push, pull_request ]
2-
name: ruff linting
2+
name: ruff check linting
33
jobs:
44
ruff:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
8-
- uses: astral-sh/ruff-action@84f83ecf9e1e15d26b7984c7ec9cf73d39ffc946 # v3.3.1
8+
- uses: astral-sh/ruff-action@eaf0ecdd668ceea36159ff9d91882c9795d89b49 # v3.4.0

.pre-commit-config.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
default_stages: ['pre-commit']
22
repos:
3-
- repo: https://github.com/pycqa/autoflake
4-
rev: v2.3.1
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.11.11
55
hooks:
6-
- id: autoflake
7-
args: [
8-
'--in-place',
9-
'--remove-all-unused-imports',
10-
'--ignore-init-module-imports'
11-
]
12-
files: \.py$
13-
require_serial: true
14-
fail_fast: true
6+
# fix unused imports and sort them
7+
- id: ruff
8+
args: ["--extend-select", "I", "--fix"]
9+
# format the code
10+
- id: ruff-format
11+
# run the linter
12+
- id: ruff
1513
- repo: https://github.com/pre-commit/pre-commit-hooks
1614
rev: v5.0.0
1715
hooks:
@@ -23,8 +21,6 @@ repos:
2321
- id: check-yaml # Attempts to load all yaml files to verify syntax
2422
- id: destroyed-symlinks # Detects symlinks which are changed to regular files
2523
- id: detect-private-key # Checks for the existence of private keys
26-
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline
27-
- id: trailing-whitespace # Trims trailing whitespace
2824
# Python specific hooks:
2925
- id: check-ast # Simply check whether files parse as valid python
3026
- id: check-docstring-first # Checks for a common error of placing code before the docstring
@@ -47,13 +43,6 @@ repos:
4743
- pydantic
4844
- pytest
4945
- cryptography
50-
- repo: https://github.com/astral-sh/ruff-pre-commit
51-
rev: v0.11.9
52-
hooks:
53-
- id: ruff
54-
args: ["check", "--select", "I", "--fix"]
55-
fail_fast: true
56-
- id: ruff
5746
- repo: local
5847
hooks:
5948
- id: pylint

PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Contributor: demostanis worlds <demostanis@protonmail.com>
55

66
pkgname=archinstall
7-
pkgver=3.0.4
7+
pkgver=3.0.6
88
pkgrel=1
99
pkgdesc="Just another guided/automated Arch Linux installer with a twist"
1010
arch=(any)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ This can be done by installing `pacman -S arch-install-scripts util-linux` local
226226
# losetup --partscan --show --find ./testimage.img
227227
# pip install --upgrade archinstall
228228
# python -m archinstall --script guided
229-
# qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd
229+
# qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF.4m.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF.4m.fd
230230
231231
This will create a *20 GB* `testimage.img` and create a loop device which we can use to format and install to.<br>
232232
`archinstall` is installed and executed in [guided mode](#docs-todo). Once the installation is complete, ~~you can use qemu/kvm to boot the test media.~~<br>

archinstall/__init__.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import sys
66
import time
77
import traceback
8-
from typing import TYPE_CHECKING
98

109
from archinstall.lib.args import arch_config_handler
1110
from archinstall.lib.disk.utils import disk_layouts
@@ -14,14 +13,9 @@
1413
from .lib.output import FormattedOutput, debug, error, info, log, warn
1514
from .lib.pacman import Pacman
1615
from .lib.plugins import load_plugin, plugins
17-
from .lib.translationhandler import DeferredTranslation, Language, translation_handler
16+
from .lib.translationhandler import Language, tr, translation_handler
1817
from .tui.curses_menu import Tui
1918

20-
if TYPE_CHECKING:
21-
from collections.abc import Callable
22-
23-
_: Callable[[str], DeferredTranslation]
24-
2519

2620
# @archinstall.plugin decorator hook to programmatically add
2721
# plugins in runtime. Useful in profiles_bck and other things.
@@ -31,31 +25,36 @@ def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def]
3125

3226
def _log_sys_info() -> None:
3327
# Log various information about hardware before starting the installation. This might assist in troubleshooting
34-
debug(f"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}")
35-
debug(f"Processor model detected: {SysInfo.cpu_model()}")
36-
debug(f"Memory statistics: {SysInfo.mem_available()} available out of {SysInfo.mem_total()} total installed")
37-
debug(f"Virtualization detected: {SysInfo.virtualization()}; is VM: {SysInfo.is_vm()}")
38-
debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}")
28+
debug(f'Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}')
29+
debug(f'Processor model detected: {SysInfo.cpu_model()}')
30+
debug(f'Memory statistics: {SysInfo.mem_available()} available out of {SysInfo.mem_total()} total installed')
31+
debug(f'Virtualization detected: {SysInfo.virtualization()}; is VM: {SysInfo.is_vm()}')
32+
debug(f'Graphics devices detected: {SysInfo._graphics_devices().keys()}')
3933

4034
# For support reasons, we'll log the disk layout pre installation to match against post-installation layout
41-
debug(f"Disk states before installing:\n{disk_layouts()}")
35+
debug(f'Disk states before installing:\n{disk_layouts()}')
4236

4337

4438
def _fetch_arch_db() -> None:
45-
info("Fetching Arch Linux package database...")
39+
info('Fetching Arch Linux package database...')
4640
try:
47-
Pacman.run("-Sy")
41+
Pacman.run('-Sy')
4842
except Exception as e:
43+
error('Failed to sync Arch Linux package database.')
44+
if 'could not resolve host' in str(e).lower():
45+
error('Most likely due to a missing network connection or DNS issue.')
46+
error('Run archinstall --debug and check /var/log/archinstall/install.log for details.')
47+
4948
debug(f'Failed to sync Arch Linux package database: {e}')
5049
exit(1)
5150

5251

5352
def _check_new_version() -> None:
54-
info("Checking version...")
53+
info('Checking version...')
5554
upgrade = None
5655

5756
try:
58-
upgrade = Pacman.run("-Qu archinstall").decode()
57+
upgrade = Pacman.run('-Qu archinstall').decode()
5958
except Exception as e:
6059
debug(f'Failed determine pacman version: {e}')
6160

@@ -76,7 +75,7 @@ def main() -> int:
7675
return 0
7776

7877
if os.getuid() != 0:
79-
print(_("Archinstall requires root privileges to run. See --help for more."))
78+
print(tr('Archinstall requires root privileges to run. See --help for more.'))
8079
return 1
8180

8281
_log_sys_info()
@@ -115,7 +114,7 @@ def run_as_a_module() -> None:
115114
text = (
116115
'Archinstall experienced the above error. If you think this is a bug, please report it to\n'
117116
'https://github.com/archlinux/archinstall and include the log file "/var/log/archinstall/install.log".\n\n'
118-
'Hint: To extract the log from a live ISO \ncurl -F\'file=@/var/log/archinstall/install.log\' https://0x0.st\n'
117+
"Hint: To extract the log from a live ISO \ncurl -F'file=@/var/log/archinstall/install.log' https://0x0.st\n"
119118
)
120119

121120
warn(text)
@@ -125,7 +124,6 @@ def run_as_a_module() -> None:
125124

126125

127126
__all__ = [
128-
'DeferredTranslation',
129127
'FormattedOutput',
130128
'Language',
131129
'Pacman',

archinstall/default_profiles/applications/pipewire.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ def packages(self) -> list[str]:
2121
'pipewire-pulse',
2222
'gst-plugin-pipewire',
2323
'libpulse',
24-
'wireplumber'
24+
'wireplumber',
2525
]
2626

2727
def _enable_pipewire_for_all(self, install_session: 'Installer') -> None:
2828
from archinstall.lib.args import arch_config_handler
29+
2930
users: list[User] | None = arch_config_handler.config.users
3031

3132
if users is None:
3233
return
3334

3435
for user in users:
3536
# Create the full path for enabling the pipewire systemd items
36-
service_dir = install_session.target / "home" / user.username / ".config" / "systemd" / "user" / "default.target.wants"
37+
service_dir = install_session.target / 'home' / user.username / '.config' / 'systemd' / 'user' / 'default.target.wants'
3738
service_dir.mkdir(parents=True, exist_ok=True)
3839

3940
# Set ownership of the entire user catalogue
@@ -42,11 +43,11 @@ def _enable_pipewire_for_all(self, install_session: 'Installer') -> None:
4243
# symlink in the correct pipewire systemd items
4344
install_session.arch_chroot(
4445
f'ln -sf /usr/lib/systemd/user/pipewire-pulse.service /home/{user.username}/.config/systemd/user/default.target.wants/pipewire-pulse.service',
45-
run_as=user.username
46+
run_as=user.username,
4647
)
4748
install_session.arch_chroot(
4849
f'ln -sf /usr/lib/systemd/user/pipewire-pulse.socket /home/{user.username}/.config/systemd/user/default.target.wants/pipewire-pulse.socket',
49-
run_as=user.username
50+
run_as=user.username,
5051
)
5152

5253
@override

archinstall/default_profiles/desktop.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, current_selection: list[Profile] = []) -> None:
1818
'Desktop',
1919
ProfileType.Desktop,
2020
current_selection=current_selection,
21-
support_greeter=True
21+
support_greeter=True,
2222
)
2323

2424
@property
@@ -34,7 +34,7 @@ def packages(self) -> list[str]:
3434
'wireless_tools',
3535
'wpa_supplicant',
3636
'smartmontools',
37-
'xdg-utils'
37+
'xdg-utils',
3838
]
3939

4040
@property
@@ -61,8 +61,9 @@ def do_on_select(self) -> SelectResult:
6161
MenuItem(
6262
p.name,
6363
value=p,
64-
preview_action=lambda x: x.value.preview_text()
65-
) for p in profile_handler.get_desktop_profiles()
64+
preview_action=lambda x: x.value.preview_text(),
65+
)
66+
for p in profile_handler.get_desktop_profiles()
6667
]
6768

6869
group = MenuItemGroup(items, sort_items=True, sort_case_sensitive=False)
@@ -75,7 +76,7 @@ def do_on_select(self) -> SelectResult:
7576
allow_skip=True,
7677
preview_style=PreviewStyle.RIGHT,
7778
preview_size='auto',
78-
preview_frame=FrameProperties.max('Info')
79+
preview_frame=FrameProperties.max('Info'),
7980
).run()
8081

8182
match result.type_:

0 commit comments

Comments
 (0)