Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archinstall/default_profiles/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def is_graphic_driver_supported(self) -> bool:
if not self.current_selection:
return self._support_gfx_driver
else:
if any([p._support_gfx_driver for p in self.current_selection]):
if any(p._support_gfx_driver for p in self.current_selection):
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/disk_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ async def suggest_lvm_layout(
raise ValueError('Unable to find boot partition in partition modifications')

total_vol_available = sum(
[p.length for p in other_part],
(p.length for p in other_part),
Size(0, Unit.B, SectorSize.default()),
)
root_vol_size = process_root_partition_size(total_vol_available, SectorSize.default())
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/disk/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def _setup_lvm(
# to the desired sizes and subtract some equally from the actually
# created volume
avail_size = vg_info.vg_size
desired_size = sum([vol.length for vol in vg.volumes], Size(0, Unit.B, SectorSize.default()))
desired_size = sum((vol.length for vol in vg.volumes), Size(0, Unit.B, SectorSize.default()))

delta = desired_size - avail_size
delta_bytes = delta.convert(Unit.B)
Expand Down Expand Up @@ -318,7 +318,7 @@ def _lvm_vol_handle_e2scrub(self, vol_gp: LvmVolumeGroup) -> None:
# from arch wiki:
# If a logical volume will be formatted with ext4, leave at least 256 MiB
# free space in the volume group to allow using e2scrub
if any([vol.fs_type == FilesystemType.EXT4 for vol in vol_gp.volumes]):
if any(vol.fs_type == FilesystemType.EXT4 for vol in vol_gp.volumes):
largest_vol = max(vol_gp.volumes, key=lambda x: x.length)

lvm_vol_reduce(
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/partitioning_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ async def _suggest_partition_layout(
) -> DeviceModification | None:
# if modifications have been done already, inform the user
# that this operation will erase those modifications
if any([not entry.exists() for entry in data]):
if any(not entry.exists() for entry in data):
if not await self._reset_confirmation():
return None

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/general/system_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def select_driver(options: list[GfxDriver] = [], preset: GfxDriver | None
there for appeal to the general public first and edge cases later)
"""
if not options:
options = [driver for driver in GfxDriver]
options = list(GfxDriver)

items = [
MenuItem(
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/locale/locale_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def _select_kb_layout(self, preset: str | None) -> str | None:

async def select_locale_lang(preset: str | None = None) -> str | None:
locales = list_locales()
locale_lang = set([locale.split()[0] for locale in locales])
locale_lang = {locale.split()[0] for locale in locales}

items = [MenuItem(ll, value=ll) for ll in locale_lang]
group = MenuItemGroup(items, sort_items=True)
Expand All @@ -97,7 +97,7 @@ async def select_locale_lang(preset: str | None = None) -> str | None:

async def select_locale_enc(preset: str | None = None) -> str | None:
locales = list_locales()
locale_enc = set([locale.split()[1] for locale in locales])
locale_enc = {locale.split()[1] for locale in locales}

items = [MenuItem(le, value=le) for le in locale_enc]
group = MenuItemGroup(items, sort_items=True)
Expand Down
5 changes: 4 additions & 1 deletion archinstall/lib/mirror/mirror_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ def _parse_remote_mirror_list(self, data: bytes) -> dict[str, list[MirrorStatusE
sorting_placeholder.setdefault(mirror.country, []).append(mirror)

sorted_by_regions: dict[str, list[MirrorStatusEntryV3]] = dict(
{region: unsorted_mirrors for region, unsorted_mirrors in sorted(sorting_placeholder.items(), key=lambda item: item[0])}
sorted(
sorting_placeholder.items(),
key=lambda item: item[0],
)
)

return sorted_by_regions
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def json(self) -> _DiskLayoutConfigurationSerialization:
def summary(self) -> list[str]:
out = [tr('{} layout').format(self.config_type.short_msg())]

devices = set(mod.device_path for mod in self.device_modifications)
devices = {mod.device_path for mod in self.device_modifications}

if devices:
dev_str = ', '.join(str(d) for d in devices)
Expand Down Expand Up @@ -613,7 +613,7 @@ def __hash__(self) -> int:
return hash(self.path)

def table_data(self) -> dict[str, str | int | bool]:
total_free_space = sum([region.get_length(unit=Unit.MiB) for region in self.free_space_regions])
total_free_space = sum(region.get_length(unit=Unit.MiB) for region in self.free_space_regions)
return {
'Model': self.model,
'Path': str(self.path),
Expand Down
2 changes: 1 addition & 1 deletion archinstall/tui/menu_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def get_focused_index(self) -> int | None:

@cached_property
def _max_items_text_width(self) -> int:
return max([len(item.text) for item in self._menu_items])
return max(len(item.text) for item in self._menu_items)

def _default_suffix(self, item: MenuItem) -> str:
if self.default_item == item:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ docstring-code-format = true
select = [
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # mccabe
"COM", # flake8-commas
"DTZ", # flake8-datetimez
Expand Down