Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove deprecations and fix the relevant warnings #275

Merged
merged 1 commit into from
Oct 18, 2022
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
14 changes: 6 additions & 8 deletions src/gallia/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
11 changes: 5 additions & 6 deletions src/gallia/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down