From 4b49797b4d57c2d2cf63472636622a7a6280a38e Mon Sep 17 00:00:00 2001 From: historia Date: Tue, 25 Aug 2026 18:10:08 -0400 Subject: feat: no console drop when uninstalling backends --- app/backends/envs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'app/backends/envs.py') 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: -- cgit v1.2.3