aboutsummaryrefslogtreecommitdiff
path: root/app/backends/envs.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-24 23:49:34 -0400
committerhistoria <historiavg@proton.me>2026-08-24 23:49:34 -0400
commitfe4b2b9eb7fb8aac81f65630720c9079d0a3121a (patch)
tree9c5e5f56d0b931d25e6580f10d09453505eddc2f /app/backends/envs.py
parentf4b1de303704e13818259d5057d176cd841b6ed8 (diff)
downloadtts-audiobook-generator-fe4b2b9eb7fb8aac81f65630720c9079d0a3121a.tar.gz
feat: user-friendly menu gating, clearer install/configure path for backends
Diffstat (limited to 'app/backends/envs.py')
-rw-r--r--app/backends/envs.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/backends/envs.py b/app/backends/envs.py
index 5a51a33..7b3c54b 100644
--- a/app/backends/envs.py
+++ b/app/backends/envs.py
@@ -94,17 +94,23 @@ def install_requirements() -> int:
[str(env_python()), "-m", "pip", "install", "-r", str(REQUIREMENTS_PATH)])
-def pip_install(packages: List[str]) -> int:
+def pip_install(packages: List[str], *, emit=None, cancel=None) -> int:
"""pip install PACKAGES into the venv, creating it first if needed.
Used by the qwen/faster setup wizards to install backend TTS packages
- alongside the app requirements. Returns pip's exit code.
+ alongside the app requirements. Returns pip's exit code. With EMIT given
+ (the in-TUI task view) pip runs with ``--progress-bar off`` so its output
+ is clean status lines rather than carriage-return progress spam.
"""
if not env_exists() and create_env() != 0:
return 1
print(f"[INFO] pip install {' '.join(packages)} into {ENV_DIR}...")
- return common.run_console_subprocess(
- [str(env_python()), "-m", "pip", "install", *packages])
+ argv = [str(env_python()), "-m", "pip", "install"]
+ if emit is not None:
+ argv.append("--progress-bar")
+ argv.append("off")
+ argv.extend(packages)
+ return common.run_console_subprocess(argv, emit=emit, cancel=cancel)
def pip_uninstall(packages: List[str]) -> int: