From 1e94922705728348628753662685ea1e83db23d2 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Mon, 8 Apr 2024 19:51:45 +0200 Subject: [PATCH 1/6] blspec.py: clean-up type 2 (uki) also if no type 1 directory present On systems without systemd-boot we might still install and boot UKIs, with e.g. refind, or directly from firmware. On such systems the 'loader' directory (bls type 1) won't be present. Instead we only have the ESP/EFI/Linux directory (bls type 2), which we still want to clean-up. Signed-off-by: Andrew Ammerlaan --- ecleankernel/layout/blspec.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ecleankernel/layout/blspec.py b/ecleankernel/layout/blspec.py index f43ae29..69d4cde 100644 --- a/ecleankernel/layout/blspec.py +++ b/ecleankernel/layout/blspec.py @@ -53,14 +53,17 @@ def __init__(self, raise LayoutNotFound("/etc/machine-id not found") for d in self.potential_dirs: + # Present if type 1 bootloaderdir = root / d / "loader" - if bootloaderdir.is_dir(): + # Present if type 2 + ukidir = root / d / "EFI" / "Linux" + if bootloaderdir.is_dir() or ukidir.is_dir(): # Type 1 entries (linux+initrd) are in # $BOOT/ENTRY-TOKEN/KERNEL-VERSION/ self.blsdir = root / d / self.kernel_id # Type 2 entries (uki's) are in # $BOOT/EFI/Linux/ENTRY-TOKEN-KERNEL-VERSION.efi - self.ukidir = root / d / "EFI" / "Linux" + self.ukidir = ukidir return else: raise LayoutNotFound("/boot/[EFI/]loader not found") From a7122fd1f370003dc488aae310a6afb3bc8f4ded Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Tue, 23 Apr 2024 20:22:35 +0200 Subject: [PATCH 2/6] ecleankernel/layout: clean-up rEFInd icon files Closes: https://github.com/projg2/eclean-kernel/issues/49 Signed-off-by: Andrew Ammerlaan --- ecleankernel/layout/blspec.py | 16 +++++++++++----- ecleankernel/layout/std.py | 6 ++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ecleankernel/layout/blspec.py b/ecleankernel/layout/blspec.py index 69d4cde..c7cd5e8 100644 --- a/ecleankernel/layout/blspec.py +++ b/ecleankernel/layout/blspec.py @@ -131,16 +131,16 @@ def find_kernels(self, # collect from ESP/Linux if self.ukidir.is_dir(): for file in os.listdir(self.ukidir): - if not file.endswith(".efi"): + basename = file.removesuffix(".efi") + if file == basename: # Not an UKI continue - ver = file.removeprefix(f"{self.kernel_id}-" - ).removeprefix("gentoo-") - if file == ver: + ver = basename.removeprefix(f"{self.kernel_id}-" + ).removeprefix("gentoo-") + if basename == ver: # Not our UKI continue - ver = ver.removesuffix(".efi") kernels[(ver, "uki")] = self.append_kernel_files( KernelFileType.KERNEL, @@ -149,6 +149,12 @@ def find_kernels(self, ver, module_dict, exclusions) + uki_icon = self.ukidir / f"{basename}.png" + if (KernelFileType.MISC not in exclusions and + os.path.isfile(uki_icon)): + kernels[(ver, "uki")].all_files.append(GenericFile( + uki_icon, KernelFileType.MISC)) + # merge unassociated modules into kernel groups for mkv, fobjs in module_dict.items(): if any(mkv == k.real_kv for k in kernels.values()): diff --git a/ecleankernel/layout/std.py b/ecleankernel/layout/std.py index e76d96c..b401a1e 100644 --- a/ecleankernel/layout/std.py +++ b/ecleankernel/layout/std.py @@ -48,6 +48,9 @@ class StdLayout(ModuleDirLayout): '.lz', '.xz', + # refind + ".png", + # efistub '.efi', ] @@ -105,6 +108,9 @@ def find_std_files() -> typing.Iterator: except UnrecognizedKernelError: # fall back to filename for ftype, prefix in self.prefixes: + # kernel refind icon has same name as kernel +'.png' + if fn.endswith(".png"): + ftype = KernelFileType.MISC if ftype not in exclusions: if fn.startswith(prefix): other_files.append( From 30b8b8ceb9c73f3520d717bfe3172ec8db03409c Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Tue, 23 Apr 2024 20:24:13 +0200 Subject: [PATCH 3/6] test: add rEFInd icon files to tests for std and bls Signed-off-by: Andrew Ammerlaan --- test/test_layout_blspec.py | 9 +++++++++ test/test_layout_std.py | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/test/test_layout_blspec.py b/test/test_layout_blspec.py index e435512..1ed9782 100644 --- a/test/test_layout_blspec.py +++ b/test/test_layout_blspec.py @@ -42,6 +42,7 @@ def create_layout(self, entry = self.entry_token if entry_token else self.machine_id test_spec = [ f"boot/{subdir}/EFI/Linux/{entry}-1.2.6.efi", + f"boot/{subdir}/EFI/Linux/{entry}-1.2.6.png", f"boot/{subdir}/EFI/Linux/{entry}-1.2.5.efi", f"boot/{subdir}/{entry}/1.2.5/initrd", f"boot/{subdir}/{entry}/1.2.5/linux", @@ -242,6 +243,8 @@ def test_find_modules(self) -> None: '1.2.5'), ('1.2.6', [KernelImage(ukipath / f"{self.machine_id}-1.2.6.efi"), + GenericFile(ukipath / f"{self.machine_id}-1.2.6.png", + KFT.MISC), ModuleDirectory(modules / '1.2.6'), GenericFile(modules / '1.2.6/../../../usr/src/linux', KFT.BUILD), @@ -373,6 +376,8 @@ def test_exclude_modules(self) -> None: '1.2.5'), ('1.2.6', [KernelImage(ukipath / f"{self.machine_id}-1.2.6.efi"), + GenericFile(ukipath / f"{self.machine_id}-1.2.6.png", + KFT.MISC), GenericFile(modules / '1.2.6/../../../usr/src/linux', KFT.BUILD), ], @@ -433,6 +438,8 @@ def test_exclude_build(self) -> None: '1.2.5'), ('1.2.6', [KernelImage(ukipath / f"{self.machine_id}-1.2.6.efi"), + GenericFile(ukipath / f"{self.machine_id}-1.2.6.png", + KFT.MISC), ModuleDirectory(modules / '1.2.6'), ], '1.2.6'), @@ -499,6 +506,8 @@ def test_find_modules_EFI(self) -> None: '1.2.5'), ('1.2.6', [KernelImage(ukipath / f"{self.machine_id}-1.2.6.efi"), + GenericFile(ukipath / f"{self.machine_id}-1.2.6.png", + KFT.MISC), ModuleDirectory(modules / '1.2.6'), GenericFile(modules / '1.2.6/../../../usr/src/linux', KFT.BUILD), diff --git a/test/test_layout_std.py b/test/test_layout_std.py index 51e7c6e..aa0e9d9 100644 --- a/test/test_layout_std.py +++ b/test/test_layout_std.py @@ -69,6 +69,7 @@ def create_layout(self) -> tempfile.TemporaryDirectory: """EFI Stub""" test_spec += [ 'efi/EFI/Gentoo/vmlinuz-1.2.1.efi', + "efi/EFI/Gentoo/vmlinuz-1.2.1.png", 'efi/EFI/Gentoo/System.map-1.2.1', 'efi/EFI/Gentoo/config-1.2.1', 'efi/EFI/Gentoo/initramfs-1.2.1.img', @@ -165,6 +166,7 @@ def test_find_modules(self) -> None: GenericFile(efistub / 'config-1.2.1', KFT.CONFIG), GenericFile(efistub / 'initramfs-1.2.1.img', KFT.INITRAMFS), KernelImage(efistub / 'vmlinuz-1.2.1.efi'), + GenericFile(efistub / "vmlinuz-1.2.1.png", KFT.MISC), ModuleDirectory(modules / '1.2.1'), GenericFile(modules / '1.2.1/../../../usr/src/linux', KFT.BUILD), @@ -219,6 +221,7 @@ def test_exclude_config(self) -> None: [GenericFile(efistub / 'System.map-1.2.1', KFT.SYSTEM_MAP), GenericFile(efistub / 'initramfs-1.2.1.img', KFT.INITRAMFS), KernelImage(efistub / 'vmlinuz-1.2.1.efi'), + GenericFile(efistub / "vmlinuz-1.2.1.png", KFT.MISC), ModuleDirectory(modules / '1.2.1'), GenericFile(modules / '1.2.1/../../../usr/src/linux', KFT.BUILD), @@ -271,6 +274,7 @@ def test_exclude_modules(self) -> None: GenericFile(efistub / 'config-1.2.1', KFT.CONFIG), GenericFile(efistub / 'initramfs-1.2.1.img', KFT.INITRAMFS), KernelImage(efistub / 'vmlinuz-1.2.1.efi'), + GenericFile(efistub / "vmlinuz-1.2.1.png", KFT.MISC), GenericFile(modules / '1.2.1/../../../usr/src/linux', KFT.BUILD), ], @@ -321,6 +325,7 @@ def test_exclude_build(self) -> None: GenericFile(efistub / 'config-1.2.1', KFT.CONFIG), GenericFile(efistub / 'initramfs-1.2.1.img', KFT.INITRAMFS), KernelImage(efistub / 'vmlinuz-1.2.1.efi'), + GenericFile(efistub / "vmlinuz-1.2.1.png", KFT.MISC), ModuleDirectory(modules / '1.2.1'), ], '1.2.1'), @@ -416,6 +421,7 @@ def test_main_list_kernels(self, - config: {td}/efi/EFI/Gentoo/config-1.2.1 - initramfs: {td}/efi/EFI/Gentoo/initramfs-1.2.1.img - vmlinuz: {td}/efi/EFI/Gentoo/vmlinuz-1.2.1.efi +- misc: {td}/efi/EFI/Gentoo/vmlinuz-1.2.1.png - modules: {td}/lib/modules/1.2.1 - build: {td}/lib/modules/1.2.1/../../../usr/src/linux'''.lstrip()) self.assert_kernels(Path(td)) From bdbc73291ac02831ecb0e5e863967b71dfa78a6b Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Tue, 23 Apr 2024 20:50:17 +0200 Subject: [PATCH 4/6] ecleankernel/layout: do not hardcode os id/name Signed-off-by: Andrew Ammerlaan --- ecleankernel/layout/blspec.py | 5 ++++- ecleankernel/layout/std.py | 11 ++++++---- pyproject.toml | 3 +++ test/test_layout_blspec.py | 20 ++++++++++------- test/test_layout_std.py | 41 +++++++++++++++++++---------------- 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/ecleankernel/layout/blspec.py b/ecleankernel/layout/blspec.py index c7cd5e8..fc4b168 100644 --- a/ecleankernel/layout/blspec.py +++ b/ecleankernel/layout/blspec.py @@ -2,6 +2,7 @@ # (c) 2020-2023 Michał Górny # Released under the terms of the 2-clause BSD license. +import distro import logging import os import typing @@ -136,8 +137,10 @@ def find_kernels(self, # Not an UKI continue + distro_id = distro.id() or "linux" + ver = basename.removeprefix(f"{self.kernel_id}-" - ).removeprefix("gentoo-") + ).removeprefix(f"{distro_id}-") if basename == ver: # Not our UKI continue diff --git a/ecleankernel/layout/std.py b/ecleankernel/layout/std.py index b401a1e..10b090e 100644 --- a/ecleankernel/layout/std.py +++ b/ecleankernel/layout/std.py @@ -2,6 +2,7 @@ # (c) 2011-2020 Michał Górny # Released under the terms of the 2-clause BSD license. +import distro import itertools import os import os.path @@ -70,12 +71,14 @@ def find_kernels(self, kernels: typing.Dict[str, typing.Dict[str, Kernel]] = {} other_files: typing.List[typing.Tuple[GenericFile, str]] = [] + distro_name = distro.name() or "Linux" + def find_std_files() -> typing.Iterator: for directory in (self.root / 'boot', - self.root / 'boot/EFI/EFI/Gentoo', - self.root / 'boot/efi/EFI/Gentoo', - self.root / 'boot/EFI/Gentoo', - self.root / 'efi/EFI/Gentoo'): + self.root / f"boot/EFI/EFI/{distro_name}", + self.root / f"boot/efi/EFI/{distro_name}", + self.root / f"boot/EFI/{distro_name}", + self.root / f"efi/EFI/{distro_name}"): try: for file in os.listdir(directory): yield directory / file diff --git a/pyproject.toml b/pyproject.toml index b59a42f..8a84a8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,9 @@ classifiers = [ "Topic :: System :: Installation/Setup" ] requires-python = ">=3.9" +dependencies = [ + "distro" +] [project.optional-dependencies] test = ["pytest"] diff --git a/test/test_layout_blspec.py b/test/test_layout_blspec.py index 1ed9782..5a37fa6 100644 --- a/test/test_layout_blspec.py +++ b/test/test_layout_blspec.py @@ -2,6 +2,7 @@ # (c) 2020 Michał Górny # Released under the terms of the 2-clause BSD license. +import distro import os import tempfile import unittest @@ -22,6 +23,8 @@ from test.test_file import write_bzImage from test.test_layout_std import make_test_files, kernel_paths +distro_id = distro.id() or "linux" + class BlSpecLayoutTests(unittest.TestCase): maxDiff = None @@ -43,7 +46,7 @@ def create_layout(self, test_spec = [ f"boot/{subdir}/EFI/Linux/{entry}-1.2.6.efi", f"boot/{subdir}/EFI/Linux/{entry}-1.2.6.png", - f"boot/{subdir}/EFI/Linux/{entry}-1.2.5.efi", + f"boot/{subdir}/EFI/Linux/{distro_id}-1.2.5.efi", f"boot/{subdir}/{entry}/1.2.5/initrd", f"boot/{subdir}/{entry}/1.2.5/linux", f"boot/{subdir}/{entry}/1.2.4/initrd", @@ -80,7 +83,8 @@ def create_layout(self, with open(path / "etc/kernel/entry-token", "w") as f: f.write(f"{self.entry_token}\n") write_bzImage(bootsub / f"EFI/Linux/{entry}-1.2.6.efi", b'1.2.6 test') - write_bzImage(bootsub / f"EFI/Linux/{entry}-1.2.5.efi", b'1.2.5 test') + write_bzImage(bootsub / f"EFI/Linux/{distro_id}-1.2.5.efi", + b'1.2.5 test') write_bzImage(bootsub / f"{entry}/1.2.5/linux", b'1.2.5 test') write_bzImage(bootsub / f"{entry}/1.2.3/linux", b'1.2.3 test') write_bzImage(bootsub / f"{entry}/1.2.2/linux", b'1.2.2 test') @@ -106,7 +110,7 @@ def assert_kernels(self, subdir = 'EFI/' if efi_subdir else '' files = { f'boot/{subdir}/EFI/Linux/{self.machine_id}-1.2.6.efi': k126, - f'boot/{subdir}/EFI/Linux/{self.machine_id}-1.2.5.efi': k125, + f'boot/{subdir}/EFI/Linux/{distro_id}-1.2.5.efi': k125, f'boot/{subdir}{self.machine_id}/1.2.5/initrd': k125, f'boot/{subdir}{self.machine_id}/1.2.5/linux': k125, f'boot/{subdir}{self.machine_id}/1.2.5': k125, @@ -235,7 +239,7 @@ def test_find_modules(self) -> None: ], '1.2.5'), ('1.2.5', - [KernelImage(ukipath / f"{self.machine_id}-1.2.5.efi"), + [KernelImage(ukipath / f"{distro_id}-1.2.5.efi"), ModuleDirectory(modules / '1.2.5'), GenericFile(modules / '1.2.5/../../../usr/src/linux', KFT.BUILD), @@ -305,7 +309,7 @@ def test_exclude_misc(self) -> None: ], '1.2.5'), ('1.2.5', - [KernelImage(ukipath / f"{self.machine_id}-1.2.5.efi"), + [KernelImage(ukipath / f"{distro_id}-1.2.5.efi"), ModuleDirectory(modules / '1.2.5'), GenericFile(modules / '1.2.5/../../../usr/src/linux', KFT.BUILD), @@ -369,7 +373,7 @@ def test_exclude_modules(self) -> None: ], '1.2.5'), ('1.2.5', - [KernelImage(ukipath / f"{self.machine_id}-1.2.5.efi"), + [KernelImage(ukipath / f"{distro_id}-1.2.5.efi"), GenericFile(modules / '1.2.5/../../../usr/src/linux', KFT.BUILD), ], @@ -432,7 +436,7 @@ def test_exclude_build(self) -> None: ], '1.2.5'), ('1.2.5', - [KernelImage(ukipath / f"{self.machine_id}-1.2.5.efi"), + [KernelImage(ukipath / f"{distro_id}-1.2.5.efi"), ModuleDirectory(modules / '1.2.5'), ], '1.2.5'), @@ -498,7 +502,7 @@ def test_find_modules_EFI(self) -> None: ], '1.2.5'), ('1.2.5', - [KernelImage(ukipath / f"{self.machine_id}-1.2.5.efi"), + [KernelImage(ukipath / f"{distro_id}-1.2.5.efi"), ModuleDirectory(modules / '1.2.5'), GenericFile(modules / '1.2.5/../../../usr/src/linux', KFT.BUILD), diff --git a/test/test_layout_std.py b/test/test_layout_std.py index aa0e9d9..65e4305 100644 --- a/test/test_layout_std.py +++ b/test/test_layout_std.py @@ -3,6 +3,7 @@ # Released under the terms of the 2-clause BSD license. import io +import distro import os import tempfile import typing @@ -22,6 +23,8 @@ TEST_DATA_DIR = Path(__file__).parent / 'data' +distro_name = distro.name() or "Linux" + def kernel_paths(kd: typing.List[Kernel] ) -> typing.Iterable[typing.Tuple[ @@ -68,11 +71,11 @@ def create_layout(self) -> tempfile.TemporaryDirectory: """EFI Stub""" test_spec += [ - 'efi/EFI/Gentoo/vmlinuz-1.2.1.efi', - "efi/EFI/Gentoo/vmlinuz-1.2.1.png", - 'efi/EFI/Gentoo/System.map-1.2.1', - 'efi/EFI/Gentoo/config-1.2.1', - 'efi/EFI/Gentoo/initramfs-1.2.1.img', + f"efi/EFI/{distro_name}/vmlinuz-1.2.1.efi", + f"efi/EFI/{distro_name}/vmlinuz-1.2.1.png", + f"efi/EFI/{distro_name}/System.map-1.2.1", + f"efi/EFI/{distro_name}/config-1.2.1", + f"efi/EFI/{distro_name}/initramfs-1.2.1.img", ] test_spec += [ @@ -93,7 +96,7 @@ def create_layout(self) -> tempfile.TemporaryDirectory: td = make_test_files(test_spec) path = Path(td.name) boot = path / 'boot' - efistub = path / 'efi/EFI/Gentoo/' + efistub = path / f"efi/EFI/{distro_name}/" modules = path / 'lib/modules' write_bzImage(efistub / 'vmlinuz-1.2.1.efi', b'1.2.1 test') @@ -127,10 +130,10 @@ def assert_kernels(self, 'boot/initrd-1.2.3.img.old': k123old, 'boot/vmlinuz-1.2.2': k122, 'boot/System.map-1.2.2': k122, - 'efi/EFI/Gentoo/vmlinuz-1.2.1.efi': k121, - 'efi/EFI/Gentoo/System.map-1.2.1': k121, - 'efi/EFI/Gentoo/config-1.2.1': k121, - 'efi/EFI/Gentoo/initramfs-1.2.1.img': k121, + f"efi/EFI/{distro_name}/vmlinuz-1.2.1.efi": k121, + f"efi/EFI/{distro_name}/System.map-1.2.1": k121, + f"efi/EFI/{distro_name}/config-1.2.1": k121, + f"efi/EFI/{distro_name}/initramfs-1.2.1.img": k121, 'boot/config-1.2.4': k124, 'lib/modules/1.2.1/test.ko': k121, 'lib/modules/1.2.2/test.ko': k122, @@ -155,7 +158,7 @@ def test_find_modules(self) -> None: with self.create_layout() as td: path = Path(td) boot = path / 'boot' - efistub = path / 'efi/EFI/Gentoo/' + efistub = path / f"efi/EFI/{distro_name}/" modules = path / 'lib/modules' self.assertEqual( @@ -210,7 +213,7 @@ def test_exclude_config(self) -> None: with self.create_layout() as td: path = Path(td) boot = path / 'boot' - efistub = path / 'efi/EFI/Gentoo/' + efistub = path / f"efi/EFI/{distro_name}/" modules = path / 'lib/modules' self.assertEqual( @@ -262,7 +265,7 @@ def test_exclude_modules(self) -> None: with self.create_layout() as td: path = Path(td) boot = path / 'boot' - efistub = path / 'efi/EFI/Gentoo/' + efistub = path / f"efi/EFI/{distro_name}/" modules = path / 'lib/modules' self.assertEqual( @@ -313,7 +316,7 @@ def test_exclude_build(self) -> None: with self.create_layout() as td: path = Path(td) boot = path / 'boot' - efistub = path / 'efi/EFI/Gentoo/' + efistub = path / f"efi/EFI/{distro_name}/" modules = path / 'lib/modules' self.assertEqual( @@ -417,11 +420,11 @@ def test_main_list_kernels(self, - modules: {td}/lib/modules/1.2.2 - build: {td}/lib/modules/1.2.2/../../../usr/src/linux other 1.2.1 [1.2.1] -- systemmap: {td}/efi/EFI/Gentoo/System.map-1.2.1 -- config: {td}/efi/EFI/Gentoo/config-1.2.1 -- initramfs: {td}/efi/EFI/Gentoo/initramfs-1.2.1.img -- vmlinuz: {td}/efi/EFI/Gentoo/vmlinuz-1.2.1.efi -- misc: {td}/efi/EFI/Gentoo/vmlinuz-1.2.1.png +- systemmap: {td}/efi/EFI/{distro_name}/System.map-1.2.1 +- config: {td}/efi/EFI/{distro_name}/config-1.2.1 +- initramfs: {td}/efi/EFI/{distro_name}/initramfs-1.2.1.img +- vmlinuz: {td}/efi/EFI/{distro_name}/vmlinuz-1.2.1.efi +- misc: {td}/efi/EFI/{distro_name}/vmlinuz-1.2.1.png - modules: {td}/lib/modules/1.2.1 - build: {td}/lib/modules/1.2.1/../../../usr/src/linux'''.lstrip()) self.assert_kernels(Path(td)) From dee2b2e3a9d607a3f6d33a44686e55508a1c119b Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Thu, 25 Apr 2024 15:55:45 +0200 Subject: [PATCH 5/6] *{blspec.py,std.py}: update copyright headers Signed-off-by: Andrew Ammerlaan --- ecleankernel/layout/blspec.py | 1 + ecleankernel/layout/std.py | 1 + test/test_layout_blspec.py | 1 + test/test_layout_std.py | 1 + 4 files changed, 4 insertions(+) diff --git a/ecleankernel/layout/blspec.py b/ecleankernel/layout/blspec.py index fc4b168..2b7d136 100644 --- a/ecleankernel/layout/blspec.py +++ b/ecleankernel/layout/blspec.py @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # (c) 2020-2023 Michał Górny +# (c) 2024 Andrew Ammerlaan # Released under the terms of the 2-clause BSD license. import distro diff --git a/ecleankernel/layout/std.py b/ecleankernel/layout/std.py index 10b090e..df8e48c 100644 --- a/ecleankernel/layout/std.py +++ b/ecleankernel/layout/std.py @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # (c) 2011-2020 Michał Górny +# (c) 2024 Andrew Ammerlaan # Released under the terms of the 2-clause BSD license. import distro diff --git a/test/test_layout_blspec.py b/test/test_layout_blspec.py index 5a37fa6..34e92cb 100644 --- a/test/test_layout_blspec.py +++ b/test/test_layout_blspec.py @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # (c) 2020 Michał Górny +# (c) 2024 Andrew Ammerlaan # Released under the terms of the 2-clause BSD license. import distro diff --git a/test/test_layout_std.py b/test/test_layout_std.py index 65e4305..3134f23 100644 --- a/test/test_layout_std.py +++ b/test/test_layout_std.py @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # (c) 2020 Michał Górny +# (c) 2024 Andrew Ammerlaan # Released under the terms of the 2-clause BSD license. import io From a754019bd6e7f9a5269ce34592f45c12b101a478 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Wed, 8 May 2024 10:40:58 +0200 Subject: [PATCH 6/6] tox.ini: move mypy to main testenv this works around a bug in tox.ini where it does not take into account the dependencies of the package Signed-off-by: Andrew Ammerlaan --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 7e18a2b..427b2ad 100644 --- a/tox.ini +++ b/tox.ini @@ -4,21 +4,22 @@ skip_missing_interpreters = True isolated_build = True [testenv] +deps = + mypy extras = test commands = pytest -vv {posargs:test} + mypy {posargs:ecleankernel test} [testenv:qa] basepython = python3 ignore_errors = True skip_install = True deps = - mypy pycodestyle pyflakes commands = - mypy {posargs:ecleankernel test} pyflakes {posargs:ecleankernel test} pycodestyle {posargs:ecleankernel test}