aboutsummaryrefslogtreecommitdiff
path: root/backends/common.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-24 01:57:13 -0400
committerhistoria <historiavg@proton.me>2026-08-24 01:58:17 -0400
commitc02d66b2d3221c0c5f5e8f2cb2ae218f1e325a0a (patch)
treee9ec4f35c18102d4624d3cd59358d192be7bbfcb /backends/common.py
parent194c63e4d11e6de9792a736a7b99788f1db78741 (diff)
downloadtts-audiobook-generator-c02d66b2d3221c0c5f5e8f2cb2ae218f1e325a0a.tar.gz
feat: manage venv for all backends
Diffstat (limited to 'backends/common.py')
-rw-r--r--backends/common.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/backends/common.py b/backends/common.py
index d707fdc..2529a8f 100644
--- a/backends/common.py
+++ b/backends/common.py
@@ -20,6 +20,11 @@ from typing import Dict, List, Optional, Set, Tuple
# (./audio.cpp, ./faster-qwen3-tts) so a single tree holds everything.
TTS_ROOT = Path(__file__).resolve().parent.parent
+# The project's sample-voice directory: .wav files dropped here are offered
+# as the default source when a setup/configure wizard asks for a wav
+# directory (both the TUI browser start and the --wavs flag default).
+VOICES_DIR = TTS_ROOT / "voices"
+
# converter/config.py — rewritten in place by update_config_value so the
# converter picks up the host/port/voice a wizard configured.
CONFIG_PATH = TTS_ROOT / "converter" / "config.py"
@@ -249,8 +254,12 @@ def git_clone(url: str, target: Path) -> int:
def pip_install(packages: List[str]) -> int:
- """pip install PACKAGES (into the current environment). Returns exit code."""
- print(f"[INFO] pip install {' '.join(packages)}...")
- import sys
- return run_console_subprocess([sys.executable, "-m", "pip", "install",
- *packages])
+ """pip install PACKAGES into the managed venv (``envs/tts``). Returns exit code.
+
+ Delegates to ``backends.envs.pip_install`` so backend TTS packages are
+ installed alongside the app requirements in the tool-managed environment
+ rather than into whatever interpreter happens to be running the wizard.
+ The import is local to avoid a circular import (envs imports this module).
+ """
+ from backends import envs
+ return envs.pip_install(packages)