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 --- README.md | 4 + app/backends/__init__.py | 8 ++ app/backends/audiocpp/__init__.py | 6 +- app/backends/audiocpp/build.py | 114 +++++++++++++++++- app/backends/common.py | 114 +++++++++++++++++- app/backends/envs.py | 16 ++- app/backends/faster.py | 38 ++++++ app/backends/qwen.py | 27 +++++ app/tests/test_backends.py | 55 +++++++++ app/tests/test_backends_audiocpp.py | 230 ++++++++++++++++++++++++++++++++++++ app/tests/test_backends_common.py | 120 +++++++++++++++++++ app/tests/test_backends_envs.py | 28 +++++ app/tests/test_backends_faster.py | 97 +++++++++++++++ app/tests/test_hub.py | 158 ++++++++++++++++++++++++- app/ui/hub.py | 69 ++++++++++- 15 files changed, 1059 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index de802c8..c496b0c 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ python audiobook.py 6. Run through the rest of the wizard. The defaults are probably all correct. The script will simultaneously build audiocpp_server and download the model files. This will take a while. +## Updating Backends + +`Configure Backends > Update backends` refreshes every installed backend to the latest upstream version in one run: `pip install -U` for the pip packages (`qwen-tts`, `faster-qwen3-tts`) and a git fetch + hard reset to the remote's HEAD for the checkouts (`app/audio.cpp`, `app/faster-qwen3-tts`) — downloaded models, `server.json`, and `voices.json` are untouched. audiocpp_server is rebuilt automatically when the audio.cpp checkout moved or the on-disk binary is older than the checked-out sources (which also heals an update whose build was cancelled or failed); an up-to-date checkout with a fresh binary costs one fetch. Updates are always-latest with no version pinning; managed servers are stopped before their code is refreshed. + ## CLI Options Everything the TUI does can also be scripted with flags: `python audiobook.py --backend audiocpp --model higgs --voice narrator`. diff --git a/app/backends/__init__.py b/app/backends/__init__.py index e59c464..8c9f045 100644 --- a/app/backends/__init__.py +++ b/app/backends/__init__.py @@ -160,6 +160,10 @@ class BackendInfo: removes the backend (stops its servers, pip-uninstalls, deletes its files); the hub runs it inside the task view, calling it with optional ``emit``/``cancel`` keywords (cancel honored between phases only). + UPDATE refreshes the installed backend to the latest upstream version + (pip -U / git fetch+reset, rebuilding where a binary must match the + sources); same calling convention as UNINSTALL. Without UPDATE a + backend is skipped by the hub's "Update backends" action. CONFIGURE_SCREEN, when given, is what the hub's "Configure