diff --git a/.flake8 b/.flake8 index 20eeab5534..becf15f697 100644 --- a/.flake8 +++ b/.flake8 @@ -1,7 +1,7 @@ [flake8] count = True # Several of the following could be autofixed or improved by running the code through psf/black -ignore = E123,E128,E722,F541,W191,W503,W504 +ignore = E123,E128,E722,W191,W503,W504 max-complexity = 40 max-line-length = 220 show-source = True diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 14b530d7ba..ffb9e2f2d3 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -1,5 +1,5 @@ on: [ push, pull_request ] -name: flake8 linting (7 ignores) +name: flake8 linting (6 ignores) jobs: flake8: runs-on: ubuntu-latest diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 3802c9750d..af895511fd 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -296,7 +296,7 @@ def _check_new_version() -> None: Pacman.run("-Sy") except Exception as e: debug(f'Failed to perform version check: {e}') - info(f'Arch Linux mirrors are not reachable. Please check your internet connection') + info('Arch Linux mirrors are not reachable. Please check your internet connection') exit(1) upgrade = None diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index c548b85b04..e85441538b 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -319,7 +319,7 @@ def _lvm_info( for report in reports['report']: if len(report[info_type]) != 1: - raise ValueError(f'Report does not contain any entry') + raise ValueError('Report does not contain any entry') entry = report[info_type][0] @@ -334,12 +334,12 @@ def _lvm_info( return LvmVolumeInfo( lv_name=entry['lv_name'], vg_name=entry['vg_name'], - lv_size=Size(int(entry[f'lv_size'][:-1]), Unit.B, SectorSize.default()) + lv_size=Size(int(entry['lv_size'][:-1]), Unit.B, SectorSize.default()) ) case 'vg': return LvmGroupInfo( vg_uuid=entry['vg_uuid'], - vg_size=Size(int(entry[f'vg_size'][:-1]), Unit.B, SectorSize.default()) + vg_size=Size(int(entry['vg_size'][:-1]), Unit.B, SectorSize.default()) ) return None diff --git a/archinstall/lib/disk/fido.py b/archinstall/lib/disk/fido.py index ea9d812a5c..ccfe29c923 100644 --- a/archinstall/lib/disk/fido.py +++ b/archinstall/lib/disk/fido.py @@ -85,7 +85,7 @@ def fido2_enroll( worker.write(bytes(password, 'UTF-8')) pw_inputted = True elif pin_inputted is False: - if bytes(f"please enter security token pin", 'UTF-8') in worker._trace_log.lower(): + if bytes("please enter security token pin", 'UTF-8') in worker._trace_log.lower(): worker.write(bytes(getpass.getpass(" "), 'UTF-8')) pin_inputted = True diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 31cfd9c45d..9ef6926cdb 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -382,7 +382,7 @@ def __iter__(self, *args: List[Any], **kwargs: Dict[str, Any]) -> Iterator[bytes def __getitem__(self, key: slice) -> Optional[bytes]: if not self.session: - raise KeyError(f"SysCommand() does not have an active session.") + raise KeyError("SysCommand() does not have an active session.") elif type(key) is slice: start = key.start or 0 end = key.stop or len(self.session._trace_log) diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 30c165b1ad..963083ab81 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -242,12 +242,12 @@ def cpu_model() -> Optional[str]: @staticmethod def sys_vendor() -> str: - with open(f"/sys/devices/virtual/dmi/id/sys_vendor") as vendor: + with open("/sys/devices/virtual/dmi/id/sys_vendor") as vendor: return vendor.read().strip() @staticmethod def product_name() -> str: - with open(f"/sys/devices/virtual/dmi/id/product_name") as product: + with open("/sys/devices/virtual/dmi/id/product_name") as product: return product.read().strip() @staticmethod diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 563ff3be01..ccd59de043 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -510,7 +510,7 @@ def genfstab(self, flags: str = '-pU') -> None: fp.write(gen_fstab) if not fstab_path.is_file(): - raise RequirementError(f'Could not create fstab file') + raise RequirementError('Could not create fstab file') for plugin in plugins.values(): if hasattr(plugin, 'on_genfstab'): @@ -893,7 +893,7 @@ def minimal_installation( def setup_swap(self, kind: str = 'zram') -> None: if kind == 'zram': - info(f"Setting up swap on zram") + info("Setting up swap on zram") self.pacman.strap('zram-generator') # We could use the default example below, but maybe not the best idea: https://github.com/archlinux/archinstall/pull/678#issuecomment-962124813 @@ -906,7 +906,7 @@ def setup_swap(self, kind: str = 'zram') -> None: self._zram_enabled = True else: - raise ValueError(f"Archinstall currently only supports setting up swap on zram") + raise ValueError("Archinstall currently only supports setting up swap on zram") def _get_efi_partition(self) -> Optional[disk.PartitionModification]: for layout in self._disk_config.device_modifications: @@ -1307,7 +1307,7 @@ def _add_limine_bootloader( for kernel in self.kernels: for variant in ('', '-fallback'): entry = [ - f'protocol: linux', + 'protocol: linux', f'kernel_path: boot():/vmlinuz-{kernel}', f'kernel_cmdline: {kernel_params}', f'module_path: boot():/initramfs-{kernel}{variant}.img', @@ -1620,7 +1620,7 @@ def set_x11_keyboard_language(self, language: str) -> bool: except SysCallError as err: raise ServiceException(f"Unable to set locale '{language}' for X11: {err}") else: - info(f'X11-Keyboard language was not changed from default (no language specified)') + info('X11-Keyboard language was not changed from default (no language specified)') return True diff --git a/archinstall/lib/interactions/general_conf.py b/archinstall/lib/interactions/general_conf.py index 2dfc4a928b..893f10f26c 100644 --- a/archinstall/lib/interactions/general_conf.py +++ b/archinstall/lib/interactions/general_conf.py @@ -154,7 +154,7 @@ def read_packages(p: list[str] = []) -> list[str]: def add_number_of_parallel_downloads(input_number: Optional[int] = None) -> Optional[int]: max_recommended = 5 - print(_(f"This option enables the number of parallel downloads that can occur during package downloads")) + print(_("This option enables the number of parallel downloads that can occur during package downloads")) print(_("Enter the number of parallel downloads to be enabled.\n\nNote:\n")) print(str(_(" - Maximum recommended value : {} ( Allows {} parallel downloads at a time )")).format(max_recommended, max_recommended)) print(_(" - Disable/Default : 0 ( Disables parallel downloading, allows only 1 download at a time )\n")) diff --git a/archinstall/lib/models/mirrors.py b/archinstall/lib/models/mirrors.py index e852d813aa..d5aa8842e1 100644 --- a/archinstall/lib/models/mirrors.py +++ b/archinstall/lib/models/mirrors.py @@ -46,7 +46,7 @@ def speed(self) -> float | None: self._speed = size / timer.time debug(f" speed: {self._speed} ({int(self._speed / 1024 / 1024 * 100) / 100}MiB/s)") except http.client.IncompleteRead: - debug(f" speed: ") + debug(" speed: ") self._speed = 0 except urllib.error.URLError as error: debug(f" speed: ({error})") @@ -101,4 +101,4 @@ def check_model(cls, data: Dict[str, int | datetime.datetime | List[MirrorStatus if data.get('version') == 3: return data - raise ValueError(f"MirrorStatusListV3 only accepts version 3 data from https://archlinux.org/mirrors/status/json/") + raise ValueError("MirrorStatusListV3 only accepts version 3 data from https://archlinux.org/mirrors/status/json/")