From 1261daeeb55395074196a41419ea35d3fc58a136 Mon Sep 17 00:00:00 2001 From: Stefan Tatschner Date: Tue, 18 Oct 2022 10:49:10 +0200 Subject: [PATCH] fix: Remove deprecations and fix the relevant warnings --- src/gallia/cli.py | 14 ++++++-------- src/gallia/command.py | 11 +++++------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/gallia/cli.py b/src/gallia/cli.py index d52b301a8..1c11e1e1e 100644 --- a/src/gallia/cli.py +++ b/src/gallia/cli.py @@ -47,20 +47,18 @@ def load_cli_commands() -> list[type[BaseCommand]]: out = [] eps = entry_points() - if (s := "gallia_cli_commands") in eps: - for entry in eps.select(group=s): - cmd_list: list[type[BaseCommand]] = entry.load() - for cmd in cmd_list: - out.append(cmd) + for entry in eps.select(group="gallia_cli_commands"): + cmd_list: list[type[BaseCommand]] = entry.load() + for cmd in cmd_list: + out.append(cmd) return out def load_cli_init() -> list[Callable[[dict[str, Any]], None]]: out = [] eps = entry_points() - if (s := "gallia_cli_init") in eps: - for entry in eps.select(group=s): - out.append(entry.load()) + for entry in eps.select(group="gallia_cli_init"): + out.append(entry.load()) return out diff --git a/src/gallia/command.py b/src/gallia/command.py index d87043159..c381b15aa 100644 --- a/src/gallia/command.py +++ b/src/gallia/command.py @@ -76,12 +76,11 @@ class RunMeta(msgspec.Struct): def load_ecus() -> list[type[ECU]]: ecus = [] eps = entry_points() - if (s := "gallia_uds_ecus") in eps: - for ep in eps.select(group=s): - for t in ep.load(): - if not issubclass(t, ECU): - raise ValueError(f"entry_point {t} is not derived from ECU") - ecus.append(t) + for ep in eps.select(group="gallia_uds_ecus"): + for t in ep.load(): + if not issubclass(t, ECU): + raise ValueError(f"entry_point {t} is not derived from ECU") + ecus.append(t) return ecus