diff options
| author | historia <historiavg@proton.me> | 2026-08-25 18:10:08 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-25 18:10:08 -0400 |
| commit | 4b49797b4d57c2d2cf63472636622a7a6280a38e (patch) | |
| tree | e3687c734de5d6159cdad288e025057ed6cd3a16 /app/backends/envs.py | |
| parent | bcac6c42eaf9e004716d72960bddefb1db68a93c (diff) | |
| download | tts-audiobook-generator-4b49797b4d57c2d2cf63472636622a7a6280a38e.tar.gz | |
feat: no console drop when uninstalling backends
Diffstat (limited to 'app/backends/envs.py')
| -rw-r--r-- | app/backends/envs.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/backends/envs.py b/app/backends/envs.py index 7b3c54b..cfeeec6 100644 --- a/app/backends/envs.py +++ b/app/backends/envs.py @@ -113,18 +113,21 @@ def pip_install(packages: List[str], *, emit=None, cancel=None) -> int: return common.run_console_subprocess(argv, emit=emit, cancel=cancel) -def pip_uninstall(packages: List[str]) -> int: +def pip_uninstall(packages: List[str], *, emit=None) -> 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. + is nothing to uninstall from), reported as success. With EMIT given + (the in-TUI task view) pip runs with its output piped and streamed to + EMIT, so nothing writes to the terminal behind curses. """ 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]) + [str(env_python()), "-m", "pip", "uninstall", "-y", *packages], + emit=emit) def module_available(module: str) -> bool: |
