INNER CODE UNIT · Python

sync_project_deps

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

async def sync_project_deps() -> None:
    """同步项目依赖"""
    console.note('正在同步项目依赖...')
    try:
        await run_in_threadpool(subprocess.run, ['uv', 'sync'], cwd=BASE_PATH.parent, check=True)
    except FileNotFoundError:
        raise cappa.Exit('uv 未安装,请先安装 uv', code=1)
    except subprocess.CalledProcessError as e:
        raise cappa.Exit('项目依赖同步失败', code=e.returncode)
    console.tip('项目依赖同步完成')


async def sync_plugin_deps(plugin: str | None = None) -> None:
    """同步插件依赖"""
    console.note(f'正在安装插件 {plugin} 依赖...' if plugin else '正在安装所有插件依赖...')
    try:
        await install_requirements_async(plugin)
    except Exception as e:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…