mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 18:04:32 +02:00
fix: Plugins are still loaded when running tests (#719)
* fix: defer plugin entrypoint loading until runtime Fixes simonw/sqlite-utils#713 * 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. --------- Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
parent
733a67490f
commit
f448b61f5e
4 changed files with 43 additions and 4 deletions
|
|
@ -16,7 +16,7 @@ from sqlite_utils.db import (
|
|||
NoTable,
|
||||
quote_identifier,
|
||||
)
|
||||
from sqlite_utils.plugins import pm, get_plugins
|
||||
from sqlite_utils.plugins import ensure_plugins_loaded, pm, get_plugins
|
||||
from sqlite_utils.utils import maximize_csv_field_size_limit
|
||||
from sqlite_utils import recipes
|
||||
import textwrap
|
||||
|
|
@ -3412,6 +3412,7 @@ def plugins_list():
|
|||
click.echo(json.dumps(get_plugins(), indent=2))
|
||||
|
||||
|
||||
ensure_plugins_loaded()
|
||||
pm.hook.register_commands(cli=cli)
|
||||
cli.add_command(migrate)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue