diff options
| author | historia <historiavg@proton.me> | 2026-08-24 18:57:09 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-24 18:57:09 -0400 |
| commit | 0522e73b68291af62e43c387ab8f9b8ffa2cab47 (patch) | |
| tree | 1800168c1ed5de7540624265945faba8251a7cab /app/backends/envs.py | |
| parent | d950fc8e64ee508334e608f6045d687d73a464be (diff) | |
| download | tts-audiobook-generator-0522e73b68291af62e43c387ab8f9b8ffa2cab47.tar.gz | |
feat: configure [backend] loads existing backend config rather than just overwriting it
Diffstat (limited to 'app/backends/envs.py')
| -rw-r--r-- | app/backends/envs.py | 14 |
1 files changed, 14 insertions, 0 deletions
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). |
