mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-27 03:14:33 +02:00
Lazy-load plugins when listing them
Keep plugin entrypoints from loading at module import time, but preserve the existing behavior of get_plugins() by loading entrypoints the first time plugins are listed outside tests.
This commit is contained in:
parent
974fe2f82f
commit
af5e3e3a5b
2 changed files with 32 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ def ensure_plugins_loaded() -> None:
|
|||
|
||||
|
||||
def get_plugins() -> List[Dict[str, Union[str, List[str]]]]:
|
||||
ensure_plugins_loaded()
|
||||
plugins: List[Dict[str, Union[str, List[str]]]] = []
|
||||
plugin_to_distinfo = dict(pm.list_plugin_distinfo())
|
||||
for plugin in pm.get_plugins():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue