@@ -21,28 +21,15 @@ def version() -> None:
21
21
"""Lists the version of goose and any plugins"""
22
22
from importlib .metadata import entry_points , version
23
23
24
- print (f"[green]Goose[/green]: [bold][cyan]{ version ('goose' )} [/cyan][/bold]" )
24
+ print (f"[green]Goose-ai [/green]: [bold][cyan]{ version ('goose-ai ' )} [/cyan][/bold]" )
25
25
print ("[green]Plugins[/green]:" )
26
- filtered_groups = {}
26
+ entry_points = entry_points ( group = "metadata.plugins" )
27
27
modules = set ()
28
- if sys .version_info .minor >= 12 :
29
- for ep in entry_points ():
30
- group = getattr (ep , "group" , None )
31
- if group and (group .startswith ("exchange." ) or group .startswith ("goose." )):
32
- filtered_groups .setdefault (group , []).append (ep )
33
- for eps in filtered_groups .values ():
34
- for ep in eps :
35
- module_name = ep .module .split ("." )[0 ]
36
- modules .add (module_name )
37
- else :
38
- eps = entry_points ()
39
- for group , entries in eps .items ():
40
- if group .startswith ("exchange." ) or group .startswith ("goose." ):
41
- for entry in entries :
42
- module_name = entry .value .split ("." )[0 ]
43
- modules .add (module_name )
44
-
45
- modules .remove ("goose" )
28
+
29
+ for ep in entry_points :
30
+ module_name = ep .name
31
+ modules .add (module_name )
32
+ modules .remove ("goose-ai" )
46
33
for module in sorted (list (modules )):
47
34
# TODO: figure out how to get this to work for goose plugins block
48
35
# as the module name is set to block.goose.cli
0 commit comments