Skip to content

Commit

Permalink
chore: Rename gallia_cli_commands entry point to gallia_commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Oct 27, 2022
1 parent 8460549 commit 17f2740
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: CC0-1.0
`gallia` uses the [`entry_points` mechanism](https://docs.python.org/3/library/importlib.metadata.html#entry-points) for registering plugins.
These entry points are known by `gallia`:

`gallia_cli_commands`
`gallia_commands`
: List of subclasses of {class}`gallia.command.BaseCommand` add new a command to the CLI.

`gallia_cli_init`
Expand Down Expand Up @@ -50,7 +50,7 @@ commands = [HelloWorld]
In `pyproject.toml` using `poetry` the following entry_point needs to be specified:

``` toml
[tool.poetry.plugins."gallia_cli_commands"]
[tool.poetry.plugins."gallia_commands"]
"hello_world_commands" = "hello_gallia.hello:commands"
```

Expand Down
2 changes: 1 addition & 1 deletion src/gallia/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def cmd_show_plugins() -> None:
_print_plugin(
"initialization callbacks (gallia_cli_init)", load_cli_init_plugin_eps()
)
_print_plugin("commands (gallia_cli_commands)", load_command_plugin_eps())
_print_plugin("commands (gallia_commands)", load_command_plugin_eps())
_print_plugin("transports (gallia_transports)", load_transport_plugin_eps())
_print_plugin("ecus (gallia_ecus)", load_ecu_plugin_eps())

Expand Down
2 changes: 1 addition & 1 deletion src/gallia/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def load_ecu(vendor: str) -> type[ECU]:

def load_command_plugin_eps() -> list[EntryPoint]:
eps = entry_points()
return list(eps.select(group="gallia_cli_commands"))
return list(eps.select(group="gallia_commands"))


def load_command_plugins() -> list[type[BaseCommand]]:
Expand Down

0 comments on commit 17f2740

Please sign in to comment.