@@ -21,36 +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-ai' )} [/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
- # exhcange.smth, goose.smth
34
- #print("filtered_groups ", filtered_groups)
35
- for eps in filtered_groups .values ():
36
- for ep in eps :
37
- if not ep .value :
38
- module_name = ep .name
39
- else :
40
- module_name = ep .module .split ("." )[0 ]
41
- modules .add (module_name )
42
- else :
43
- eps = entry_points ()
44
- for group , entries in eps .items ():
45
- if group .startswith ("exchange." ) or group .startswith ("goose." ):
46
- for entry in entries :
47
- module_name = entry .value .split ("." )[0 ]
48
- modules .add (module_name )
49
-
50
- print ("modules" , modules )
51
28
52
- modules .remove ("goose" )
53
- modules .remove ("exchange" )
29
+ for ep in entry_points :
30
+ module_name = ep .name
31
+ modules .add (module_name )
32
+ modules .remove ("goose-ai" )
54
33
for module in sorted (list (modules )):
55
34
# TODO: figure out how to get this to work for goose plugins block
56
35
# as the module name is set to block.goose.cli
0 commit comments