From cef2352a5e81b272d067c2c02eb9588e54edfcfd Mon Sep 17 00:00:00 2001 From: historia Date: Thu, 27 Aug 2026 17:03:57 -0400 Subject: feat: automatic updates added to configure backend menu --- app/backends/envs.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'app/backends/envs.py') diff --git a/app/backends/envs.py b/app/backends/envs.py index 50154c2..ff6d1bf 100644 --- a/app/backends/envs.py +++ b/app/backends/envs.py @@ -190,22 +190,28 @@ def install_requirements(skip_optional: bool = False) -> int: def pip_install(packages: List[str], *, emit=None, cancel=None, - env_dir: Optional[Path] = None) -> int: + env_dir: Optional[Path] = None, + upgrade: bool = False) -> int: """pip install PACKAGES into ENV (an env dir, default the app env), creating it first if needed. Used by the qwen/faster setup wizards to install their TTS packages into their dedicated backend venvs (QWEN_ENV_DIR / FASTER_ENV_DIR), never - alongside each other or 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. + alongside each other or the app requirements. With UPGRADE the install + runs with ``-U``: pip then resolves the latest version itself and + reports "Requirement already satisfied" when the env already holds it — + the backend update action's cheap freshness check. 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(env_dir) and create_env(env_dir) != 0: return 1 target = env_dir if env_dir is not None else ENV_DIR print(f"[INFO] pip install {' '.join(packages)} into {target}...") argv = [str(env_python(env_dir)), "-m", "pip", "install"] + if upgrade: + argv.append("-U") if emit is not None: argv.append("--progress-bar") argv.append("off") -- cgit v1.2.3