INNER CODE UNIT · Python

sync_deps

fastapi-practices/fba-slim · backend/cli.py:428

async def sync_deps(plugin: str | None, *, no_project: bool = False, no_plugin: bool = False) -> None:
    """同步项目和插件依赖"""
    if no_project and no_plugin:
        raise cappa.Exit('--no-project 和 --no-plugin 不能同时使用', code=1)
    if plugin is not None and no_plugin:
        raise cappa.Exit('--plugin 和 --no-plugin 不能同时使用', code=1)

    should_sync_plugins = False if no_plugin else should_sync_plugin_deps(plugin, allow_empty=not no_project)
    if not no_project:
        await sync_project_deps()
    if should_sync_plugins:
        await sync_plugin_deps(plugin)


async def remove_plugin(plugin: str | None, *, no_sql: bool = False) -> None:  # ruff:ignore[complex-structure]
    """卸载插件"""
    if settings.ENVIRONMENT != 'dev':
        raise cappa.Exit('插件卸载仅在开发环境可用', code=1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…