From 0522e73b68291af62e43c387ab8f9b8ffa2cab47 Mon Sep 17 00:00:00 2001 From: historia Date: Mon, 24 Aug 2026 18:57:09 -0400 Subject: feat: configure [backend] loads existing backend config rather than just overwriting it --- app/backends/envs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/backends/envs.py') diff --git a/app/backends/envs.py b/app/backends/envs.py index 6e5b6cc..5a51a33 100644 --- a/app/backends/envs.py +++ b/app/backends/envs.py @@ -107,6 +107,20 @@ def pip_install(packages: List[str]) -> int: [str(env_python()), "-m", "pip", "install", *packages]) +def pip_uninstall(packages: List[str]) -> int: + """pip uninstall PACKAGES from the venv. Returns pip's exit code. + + Used by the backends' ``uninstall`` action to remove pip-installed TTS + packages from the managed environment. A missing env is a no-op (there + is nothing to uninstall from), reported as success. + """ + if not env_exists(): + return 0 + print(f"[INFO] pip uninstall {' '.join(packages)} from {ENV_DIR}...") + return common.run_console_subprocess( + [str(env_python()), "-m", "pip", "uninstall", "-y", *packages]) + + def module_available(module: str) -> bool: """True when MODULE imports inside the venv (e.g. qwen_tts, faster_qwen3_tts). -- cgit v1.2.3