Skip to content

Commit 5ab6b05

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix-3412
2 parents 6ef3576 + 9a939d8 commit 5ab6b05

25 files changed

Lines changed: 168 additions & 246 deletions

.github/workflows/mypy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- run: python --version
2121
- run: mypy --version
2222
- name: run mypy
23-
run: mypy --config-file pyproject.toml
23+
run: mypy --show-traceback --config-file pyproject.toml

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
1+
# This workflow will upload a Python Package when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

44
name: Upload archinstall to PyPi

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ repos:
3939
hooks:
4040
- id: mypy
4141
args: [
42+
'--show-traceback',
4243
'--config-file=pyproject.toml'
4344
]
4445
fail_fast: true
@@ -48,7 +49,7 @@ repos:
4849
- pytest
4950
- cryptography
5051
- repo: https://github.com/astral-sh/ruff-pre-commit
51-
rev: v0.11.7
52+
rev: v0.11.8
5253
hooks:
5354
- id: ruff
5455
args: ["check", "--select", "I", "--fix"]

archinstall/lib/disk/encryption_menu.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,21 +262,21 @@ def select_encrypted_password() -> Password | None:
262262

263263

264264
def select_hsm(preset: Fido2Device | None = None) -> Fido2Device | None:
265-
header = str(_('Select a FIDO2 device to use for HSM'))
265+
header = str(_('Select a FIDO2 device to use for HSM')) + '\n'
266266

267267
try:
268268
fido_devices = Fido2.get_fido2_devices()
269269
except ValueError:
270270
return None
271271

272272
if fido_devices:
273-
group, table_header = MenuHelper.create_table(data=fido_devices)
274-
header = f'{header}\n\n{table_header}'
273+
group = MenuHelper(data=fido_devices).create_menu_group()
275274

276275
result = SelectMenu[Fido2Device](
277276
group,
278277
header=header,
279278
alignment=Alignment.CENTER,
279+
allow_skip=True
280280
).run()
281281

282282
match result.type_:
@@ -307,13 +307,14 @@ def select_partitions_to_encrypt(
307307
avail_partitions = [p for p in partitions if not p.exists()]
308308

309309
if avail_partitions:
310-
group, header = MenuHelper.create_table(data=avail_partitions)
310+
group = MenuHelper(data=avail_partitions).create_menu_group()
311+
group.set_selected_by_value(preset)
311312

312313
result = SelectMenu[PartitionModification](
313314
group,
314-
header=header,
315315
alignment=Alignment.CENTER,
316-
multi=True
316+
multi=True,
317+
allow_skip=True
317318
).run()
318319

319320
match result.type_:
@@ -335,11 +336,10 @@ def select_lvm_vols_to_encrypt(
335336
volumes: list[LvmVolume] = lvm_config.get_all_volumes()
336337

337338
if volumes:
338-
group, header = MenuHelper.create_table(data=volumes)
339+
group = MenuHelper(data=volumes).create_menu_group()
339340

340341
result = SelectMenu[LvmVolume](
341342
group,
342-
header=header,
343343
alignment=Alignment.CENTER,
344344
multi=True
345345
).run()

archinstall/lib/disk/partitioning_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def validate(value: str) -> str | None:
509509

510510
title = str(_('Size (default: {}): ')).format(max_size.format_highest())
511511

512-
result = EditMenu[str](
512+
result = EditMenu(
513513
title,
514514
header=f'{prompt}\b',
515515
allow_skip=True,

archinstall/lib/disk/subvolume_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def selected_action_display(self, selection: SubvolumeModification) -> str:
4141
return str(selection.name)
4242

4343
def _add_subvolume(self, preset: SubvolumeModification | None = None) -> SubvolumeModification | None:
44-
result = EditMenu[str](
44+
result = EditMenu(
4545
str(_('Subvolume name')),
4646
alignment=Alignment.CENTER,
4747
allow_skip=True,

archinstall/lib/interactions/disk_conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ def _preview_device_selection(item: MenuItem) -> str | None:
6060
options = [d.device_info for d in devices]
6161
presets = [p.device_info for p in preset]
6262

63-
group, header = MenuHelper.create_table(data=options)
63+
group = MenuHelper(options).create_menu_group()
6464
group.set_selected_by_value(presets)
6565
group.set_preview_for_all(_preview_device_selection)
6666

6767
result = SelectMenu[_DeviceInfo](
6868
group,
69-
header=header,
7069
alignment=Alignment.CENTER,
7170
search_enabled=False,
7271
multi=True,

archinstall/lib/interactions/general_conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def ask_ntp(preset: bool = True) -> bool:
6161

6262

6363
def ask_hostname(preset: str | None = None) -> str | None:
64-
result = EditMenu[str](
64+
result = EditMenu(
6565
str(_('Hostname')),
6666
alignment=Alignment.CENTER,
6767
allow_skip=True,
@@ -260,7 +260,7 @@ def validator(s: str) -> str | None:
260260

261261
return str(_('Invalid download number'))
262262

263-
result = EditMenu[str](
263+
result = EditMenu(
264264
str(_('Number downloads')),
265265
header=header,
266266
allow_skip=True,

archinstall/lib/interactions/manage_users_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _check_for_correct_username(self, username: str) -> str | None:
7070
return str(_("The username you entered is invalid"))
7171

7272
def _add_user(self) -> User | None:
73-
editResult = EditMenu[str](
73+
editResult = EditMenu(
7474
str(_('Username')),
7575
allow_skip=True,
7676
validator=self._check_for_correct_username

archinstall/lib/interactions/network_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def validator(ip: str) -> str | None:
106106
except ValueError:
107107
return str(_('You need to enter a valid IP in IP-config mode'))
108108

109-
result = EditMenu[str](
109+
result = EditMenu(
110110
title,
111111
header=header,
112112
validator=validator,

0 commit comments

Comments
 (0)