Skip to content

Clone your own voice on your own computer: speak any text in 60+ languages and dub videos into another language in your voice. Fully local. Early version.

feat(setup): install every environment from a lock file of tested versions (#181)

Taras Hevlich558c6cd1d6e9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a2b801b..a0058c4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@
VoxCPM2, and the speech workers never download that code. After the update, the app asks to run setup once more.
* **A speech model that fails to load is no longer reported as not installed,** and a turned-off voice training
component is named as such instead of "RVC runtime not found".
+* **Every package setup installs has a fixed version:** each environment installs from a lock file of the versions
+ Mimvox was tested with, so a new release of a library can no longer break a fresh install. VoxCPM2 and voice
+ training need macOS 14 or later (their own packages do).
## 0.9.1
diff --git a/engine/tests/test_setup_tool.py b/engine/tests/test_setup_tool.py
index cdaba06..f84eba8 100644
--- a/engine/tests/test_setup_tool.py
+++ b/engine/tests/test_setup_tool.py
@@ -202,8 +202,9 @@ def test_a_venv_from_outside_the_runtime_is_made_again_with_its_packages(tmp_pat
assert {"--offline", "--relocatable", "--managed-python"} <= set(venv_call)
install = next(argv for argv in uv.calls if argv[1:3] == ["pip", "install"])
assert "--offline" in install
- pins = Path(install[install.index("-c") + 1]).read_text(encoding="utf-8").split()
- assert pins == ["torch==2.8.0+cpu", "omnivoice==0.2.1", "old-thing==1.0"]
+ files = [Path(install[i + 1]) for i, a in enumerate(install) if a == "-c"]
+ assert files[0] == setup.LOCKS / "engine.txt"
+ assert files[1].read_text(encoding="utf-8").split() == ["old-thing==1.0"]
assert s.on_runtime_python(s.engine_venv)
assert not (s.engine_venv / "old-file").exists()
assert (s.engine_venv / ".mimvox-setup-ok").is_file()
@@ -229,7 +230,7 @@ def test_a_venv_on_an_older_python_is_made_again_on_the_new_one(fake_uv, capsys)
(venv_call,) = uv.venv_calls()
assert venv_call[venv_call.index("--python") + 1] == setup.ENGINE_PYTHON
install = next(argv for argv in uv.calls if argv[1:3] == ["pip", "install"])
- assert "-c" not in install
+ assert [install[i + 1] for i, a in enumerate(install) if a == "-c"] == [str(setup.LOCKS / "engine.txt")]
assert setup.venv_version(s.engine_venv) == setup.ENGINE_PYTHON
assert not (s.engine_venv / "old-file").exists()
assert sorted(p.name for p in s.engine_venv.parent.iterdir()) == [".venv"]
diff --git a/engine/tests/test_speech_models.py b/engine/tests/test_speech_models.py
index bc2dc79..dd3600d 100644
--- a/engine/tests/test_speech_models.py
+++ b/engine/tests/test_speech_models.py
@@ -229,3 +229,20 @@ def test_workers_run_without_hub_kernels(monkeypatch):
monkeypatch.setenv("USE_HUB_KERNELS", "1")
assert workerproc.child_env()["USE_HUB_KERNELS"] == "0"
+
+
+def test_every_environment_has_a_lock_that_agrees_with_setup():
+ setup = _setup_module()
+ envs = {
+ "engine": (*setup.ENGINE_TORCH, *setup.ENGINE_PACKAGES, *setup.ENGINE_NO_DEPS, *setup.SEEDVC_PACKAGES),
+ "holos": (*setup.ENGINE_TORCH, *setup.HOLOS_PACKAGES, *setup.HOLOS_NO_DEPS),
+ "applio": (),
+ **{name: (*setup.ENGINE_TORCH, *spec["packages"]) for name, spec in setup.CLONE_MODELS.items()},
+ }
+ for env, packages in envs.items():
+ lines = (setup.LOCKS / f"{env}.txt").read_text(encoding="utf-8").splitlines()
+ locked = dict(line.split("==", 1) for line in lines)
+ assert list(locked) == sorted(locked) and all("==" in line for line in lines), env
+ for pin in (p for p in packages if "==" in p):
+ name, version = pin.split("==", 1)
+ assert locked.get(name.lower().replace("_", "-")) == version, (env, pin)
diff --git a/tools/setup/lock.py b/tools/setup/lock.py
new file mode 100644
index 0000000..3ef8535
--- /dev/null
+++ b/tools/setup/lock.py
@@ -0,0 +1,153 @@
+"""Write tools/setup/locks/<environment>.txt from a working runtime.
+
+Each lock holds every package of that environment at the version the runtime runs, plus the packages that only
+Windows or macOS install, at the versions they resolve to under those pins. Setup installs with ``-c`` each lock.
+
+ uv run --no-project python tools/setup/lock.py <runtime folder>
+"""
+
+from __future__ import annotations
+
+import importlib.util
+import os
+import re
+import subprocess
+import sys
+import tempfile
+import types
+from pathlib import Path
+
+HERE = Path(__file__).resolve().parent
+LOCKS = HERE / "locks"
+PLATFORMS = ("x86_64-manylinux_2_28", "x86_64-pc-windows-msvc", "aarch64-apple-darwin")
+# crates/desktop/Packager.toml minimum-system-version, then the first one an environment's own pins have wheels for.
+MACOS = ("13.0", "14.0")
+LINE = re.compile(r"^([A-Za-z0-9][A-Za-z0-9._-]*)==([^\s;+]+)")
+# Each torch build (CUDA, ROCm, CPU) pins its own GPU packages exactly.
+BUILD = re.compile(r"^(nvidia-|cuda-|triton$|pytorch-triton)")
+
+
+def setup_module() -> types.ModuleType:
+ spec = importlib.util.spec_from_file_location("mimvox_setup_lock", HERE / "setup.py")
+ module = importlib.util.module_from_spec(spec)
+ sys.modules[spec.name] = module
+ spec.loader.exec_module(module)
+ return module
+
+
+def canonical(name: str) -> str:
+ return re.sub(r"[-_.]+", "-", name).lower()
+
+
+def pins(text: str) -> dict[str, str]:
+ found = {}
+ for line in text.splitlines():
+ match = LINE.match(line.strip())
+ if match and not BUILD.match(canonical(match.group(1))):
+ found[canonical(match.group(1))] = match.group(2)
+ return found
+
+
+class UvError(Exception):
+ pass
+
+
+def uv(*args: object, cwd: Path | None = None, env: dict[str, str] | None = None) -> str:
+ done = subprocess.run(
+ ["uv", *map(str, args)], capture_output=True, text=True, cwd=cwd, check=False, env={**os.environ, **(env or {})}
+ )
+ if done.returncode != 0:
+ raise UvError(f"uv {' '.join(map(str, args[:3]))} failed:\n{done.stderr.strip()}")
+ return done.stdout
+
+
+def environments(s: types.ModuleType, runtime: Path) -> dict[str, tuple[Path, str, list[str], Path | None]]:
+ """Each environment: its venv, Python version, requirements and the folder they are read in."""
+ torch = list(s.ENGINE_TORCH)
+ envs = {
+ "engine": (
+ runtime / s.ENGINE_DIR / ".venv",
+ s.ENGINE_PYTHON,
+ [*torch, *s.ENGINE_PACKAGES, *s.SEEDVC_PACKAGES],
+ None,
+ ),
+ "holos": (runtime / s.HOLOS_DIR / ".venv", s.HOLOS_PYTHON, [*torch, *s.HOLOS_PACKAGES], None),
+ "applio": (runtime / "applio" / ".venv", s.APPLIO_PYTHON, ["-r", "requirements.txt"], runtime / "applio"),
+ }
+ for name, spec in s.CLONE_MODELS.items():
+ envs[name] = (runtime / name / ".venv", s.ENGINE_PYTHON, [*torch, *spec["packages"]], None)
+ return envs
+
+
+def lock(name: str, venv: Path, python: str, requirements: list[str], cwd: Path | None) -> dict[str, str]:
+ py = venv / ("Scripts/python.exe" if sys.platform == "win32" else "bin/python")
+ if not py.exists():
+ raise SystemExit(f"{name}: no environment at {venv}")
+ locked = pins(uv("pip", "freeze", "--python", py))
+ with tempfile.TemporaryDirectory() as tmp:
+ constraints = Path(tmp) / "constraints.txt"
+ constraints.write_text("".join(f"{n}=={v}\n" for n, v in sorted(locked.items())), encoding="utf-8")
+ for target in PLATFORMS:
+ for macos in MACOS if "apple" in target else MACOS[:1]:
+ try:
+ out = compile_for(
+ target, python, constraints, requirements, cwd, {"MACOSX_DEPLOYMENT_TARGET": macos}
+ )
+ except UvError:
+ if macos == MACOS[-1] or "apple" not in target:
+ raise
+ continue
+ if "apple" in target and macos != MACOS[0]:
+ print(f"{name}: needs macOS {macos} or later")
+ break
+ for n, v in pins(out).items():
+ locked.setdefault(n, v)
+ return locked
+
+
+def compile_for(
+ target: str, python: str, constraints: Path, requirements: list[str], cwd: Path | None, env: dict[str, str]
+) -> str:
+ with tempfile.TemporaryDirectory() as tmp:
+ inputs = Path(tmp) / "requirements.in"
+ if requirements[:1] == ["-r"]:
+ inputs = (cwd or Path.cwd()) / requirements[1]
+ else:
+ inputs.write_text("".join(f"{r}\n" for r in requirements), encoding="utf-8")
+ return uv(
+ "pip",
+ "compile",
+ "--quiet",
+ "--no-header",
+ "--no-annotate",
+ "--python-version",
+ python,
+ "--python-platform",
+ target,
+ "-c",
+ constraints,
+ inputs,
+ cwd=cwd,
+ env=env,
+ )
+
+
+def main() -> int:
+ if len(sys.argv) != 2:
+ print(__doc__.strip(), file=sys.stderr)
+ return 2
+ runtime = Path(sys.argv[1]).expanduser().resolve()
+ s = setup_module()
+ LOCKS.mkdir(exist_ok=True)
+ for name, (venv, python, requirements, cwd) in environments(s, runtime).items():
+ try:
+ locked = lock(name, venv, python, requirements, cwd)
+ except UvError as exc:
+ raise SystemExit(f"{name}: {exc}") from None
+ (LOCKS / f"{name}.txt").write_text("".join(f"{n}=={v}\n" for n, v in sorted(locked.items())), "utf-8")
+ print(f"{name}: {len(locked)} packages")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/tools/setup/locks/applio.txt b/tools/setup/locks/applio.txt
new file mode 100644
index 0000000..e3e8d15
--- /dev/null
+++ b/tools/setup/locks/applio.txt
@@ -0,0 +1,129 @@
+absl-py==2.5.1
+aiohappyeyeballs==2.7.1
+aiohttp==3.14.5
+aiosignal==1.4.0
+annotated-doc==0.0.7
+annotated-types==0.8.0
+anyio==4.16.0
+attrs==26.1.0
+audioread==3.1.0
+beautifulsoup4==4.15.0
+brotli==1.2.1
+certifi==2026.11.20
+cffi==2.1.1
+charset-normalizer==3.5.3
+click==8.1.8
+cloudpickle==3.1.3
+colorama==0.4.6
+coloredlogs==15.0.1
+contourpy==1.4.0
+cycler==0.12.1
+decorator==5.3.2
+edge-tts==7.3.1
+einops==0.8.2
+faiss-cpu==1.14.3
+fastapi==0.165.0
+filelock==4.3.1
+flatbuffers==25.12.19
+fonttools==4.69.1
+frozenlist==1.8.0
+fsspec==2026.9.0
+gradio==6.20.0
+gradio-client==2.5.0
+groovy==0.1.2
+grpcio==1.85.4
+h11==0.16.0
+hf-gradio==0.4.1
+hf-xet==1.8.0
+httpcore==1.0.9
+httpx==0.29.0
+huggingface-hub==1.16.1
+humanfriendly==10.0
+hyper-connections==0.4.11
+idna==3.20
+jinja2==3.1.6
+joblib==1.6.0
+kiwisolver==1.5.1
+lazy-loader==0.6
+librosa==0.11.0
+llvmlite==0.50.0
+local-attention==1.11.2
+markdown==3.11.4
+markdown-it-py==4.3.0
+markupsafe==3.0.4
+matplotlib==3.11.0
+mdurl==0.1.2
+ml-dtypes==0.7.0
+mpmath==1.3.0
+msgpack==1.2.4
+multidict==7.2.1
+narwhals==2.29.0
+networkx==3.7
+numba==0.68.1
+numpy==2.4.6
+onnx==1.23.1
+onnxruntime==1.32.0
+onnxruntime-gpu==1.22.0
+opentelemetry-api==1.45.2
+orjson==3.13.0
+packaging==26.4
+pandas==3.1.1
+pillow==12.3.0
+platformdirs==4.14.9
+pooch==1.9.0
+propcache==0.5.4
+protobuf==7.36.2
+psutil==7.2.2
+pycparser==3.12
+pydantic==2.14.4
+pydantic-core==2.50.5
+pydub==0.25.1
+pygments==2.21.0
+pyparsing==3.3.3
+pypresence==4.6.2
+pyreadline3==3.5.6
+python-dateutil==4.0.0
+python-multipart==0.0.34
+pytz==2026.6
+pyyaml==6.0.4
+regex==2026.11.25
+requests==2.34.2
+resampy==0.4.3
+rich==15.0.0
+safehttpx==0.1.7
+safetensors==0.8.0
+scikit-learn==1.9.1
+scipy==1.18.0
+semantic-version==2.10.0
+setuptools==81.0.0
+shellingham==1.5.4
+sounddevice==0.5.5
+soundfile==0.14.0
+soupsieve==4.1.3
+soxr==1.1.0
+starlette==1.10.0
+stftpitchshift==2.0
+sympy==1.14.0
+tabulate==0.10.0
+tensorboard==2.21.0
+tensorboard-data-server==0.7.2
+threadpoolctl==3.8.0
+tokenizers==0.22.2
+tomlkit==0.14.0
+torch==2.11.0
+torch-einops-utils==0.2.10
+torchaudio==2.11.0
+torchcrepe==0.0.24
+torchfcpe==0.0.4
+tqdm==4.68.4
+transformers==5.13.1
+typer==0.29.3
+typing-extensions==4.16.0
+typing-inspection==0.4.5
+tzdata==2026.6
+urllib3==2.8.0
+uvicorn==0.54.0
+webrtcvad-wheels==2.0.14
+websockets==17.4
+werkzeug==3.1.9
+yarl==1.25.1
diff --git a/tools/setup/locks/chatterbox.txt b/tools/setup/locks/chatterbox.txt
new file mode 100644
index 0000000..81f3b59
--- /dev/null
+++ b/tools/setup/locks/chatterbox.txt
@@ -0,0 +1,118 @@
+aiofiles==24.1.0
+annotated-doc==0.0.7
+annotated-types==0.8.0
+anyio==4.16.0
+audioop-lts==0.2.2
+audioread==3.1.0
+brotli==1.2.1
+catalogue==2.0.10
+certifi==2026.11.20
+cffi==2.1.1
+cfgv==3.5.0
+charset-normalizer==3.5.3
+chatterbox-tts==0.1.7
+click==8.5.1
+cloudpickle==3.1.3
+colorama==0.4.6
+conformer==0.3.2
+decorator==5.3.2
+deprecated==3.0.1
+diffusers==0.29.0
+distlib==0.4.4
+docopt==0.6.2
+einops==0.8.2
+fastapi==0.163.2
+ffmpy==1.0.0
+filelock==4.3.1
+fsspec==2026.9.0
+gradio==6.8.0
+gradio-client==2.2.0
+groovy==0.1.2
+h11==0.16.0
+hf-xet==1.8.0
+httpcore==1.0.9
+httpx==0.29.0
+huggingface-hub==1.33.0
+identify==2.6.20
+idna==3.20
+importlib-metadata==10.2.0
+jaconv==0.5.0
+jinja2==3.1.6
+joblib==1.6.0
+lazy-importer==0.1.0
+lazy-loader==0.6
+librosa==0.11.0
+llvmlite==0.50.0
+markdown-it-py==4.3.0
+markupsafe==3.0.4
+mdurl==0.1.2
+ml-dtypes==0.7.0
+mpmath==1.3.0
+msgpack==1.2.4
+narwhals==2.29.0
+networkx==3.7
+nodeenv==1.12.0
+num2words==0.5.14
+numba==0.68.1
+numpy==2.5.5
+omegaconf==2.4.0
+onnx==1.23.2
+opentelemetry-api==1.45.2
+orjson==3.13.0
+packaging==26.4
+pandas==3.1.1
+pillow==12.3.0
+platformdirs==4.14.8
+pooch==1.9.0
+pre-commit==4.7.0
+protobuf==7.36.2
+pycparser==3.12
+pydantic==2.14.4
+pydantic-core==2.50.5
+pydub==0.25.1
+pygments==2.21.0
+pykakasi==2.3.0
+pyloudnorm==0.2.0
+python-dateutil==4.0.0
+python-discovery==1.9.7
+python-multipart==0.0.34
+pytz==2026.6
+pyyaml==6.0.4
+regex==2026.11.25
+requests==2.34.2
+resemble-perth==1.0.1
+rich==15.0.0
+s3tokenizer==0.3.0
+safehttpx==0.1.7
+safetensors==0.5.3
+scikit-learn==1.9.1
+scipy==1.18.1
+semantic-version==2.10.0
+setuptools==81.0.0
+shellingham==1.5.4
+soundfile==0.14.0
+soxr==1.1.0
+spacy-pkuseg==1.0.2
+srsly==2.5.6
+standard-aifc==3.13.0
+standard-chunk==3.13.0
+standard-sunau==3.13.0
+starlette==0.52.1
+sympy==1.14.0
+threadpoolctl==3.8.0
+tokenizers==0.22.2
+tomlkit==0.13.3
+torch==2.11.0
+torchaudio==2.11.0
+tqdm==4.70.1
+transformers==5.2.0
+typer==0.29.3
+typer-slim==0.24.0
+typing-extensions==4.16.0
+typing-inspection==0.4.5
+tzdata==2026.6
+urllib3==2.8.0
+uvicorn==0.54.0
+virtualenv==21.15.13
+wrapt==2.5.2
+zipp==4.1.2
diff --git a/tools/setup/locks/engine.txt b/tools/setup/locks/engine.txt
new file mode 100644
index 0000000..8129638
--- /dev/null
+++ b/tools/setup/locks/engine.txt
@@ -0,0 +1,115 @@
+accelerate==1.16.0
+annotated-doc==0.0.7
+annotated-types==0.8.0
+anyascii==0.3.3
+anyio==4.16.0
+audioop-lts==0.2.2
+braceexpand==0.1.7
+brotli==1.2.1
+certifi==2026.11.20
+cffi==2.1.1
+charset-normalizer==3.5.3
+click==8.5.1
+cloudpickle==3.1.3
+colorama==0.4.6
+decorator==5.3.2
+defusedxml==0.7.1
+distance==0.1.3
+docopt==0.6.2
+einops==0.8.0
+fastapi==0.165.0
+filelock==4.3.1
+flatbuffers==25.12.19
+fsspec==2026.9.0
+g2p-en==2.1.0
+gradio==6.32.0
+gradio-client==2.7.2
+groovy==0.1.2
+h11==0.16.0
+hf-gradio==0.4.1
+hf-xet==1.8.0
+httpcore==1.0.9
+httpcore2==2.16.2
+httpx==0.29.0
+httpx2==2.16.2
+huggingface-hub==2.5.0
+idna==3.20
+inflect==7.6.0
+jaraco-functools==4.6.0
+jinja2==3.1.6
+joblib==1.6.0
+lazy-loader==0.6
+librosa==1.0.1
+llvmlite==0.50.0
+marisa-trie==1.4.1
+markdown-it-py==4.3.0
+markupsafe==3.0.4
+mdurl==0.1.2
+more-itertools==11.2.1
+mpmath==1.3.0
+msgpack==1.2.4
+munch==4.0.0
+narwhals==2.29.0
+networkx==3.7
+nltk==3.10.4
+num2words==0.5.14
+numba==0.68.1
+numpy==2.5.5
+omnivoice==0.2.1
+onnxruntime==1.32.0
+openai-whisper==20250625
+opentelemetry-api==1.45.2
+orjson==3.13.0
+packaging==26.4
+pandas==3.1.1
+pillow==13.0.0
+platformdirs==4.14.8
+pooch==1.9.0
+protobuf==7.36.2
+psutil==7.2.2
+pycparser==3.12
+pydantic==2.14.4
+pydantic-core==2.50.5
+pydub==0.25.1
+pygments==2.21.0
+pypdf==6.21.4
+pypinyin==0.55.0
+python-dateutil==4.0.0
+python-multipart==0.0.34
+pytz==2026.6
+pyworld-prebuilt==0.3.6.post1
+pyyaml==6.0.4
+regex==2026.11.25
+requests==2.34.2
+rich==15.0.0
+safehttpx==0.1.7
+safetensors==0.8.0
+scikit-learn==1.9.1
+scipy==1.18.1
+semantic-version==2.10.0
+sentencepiece==0.2.3
+setuptools==81.0.0
+shellingham==1.5.4
+soundfile==0.14.0
+soxr==1.1.0
+starlette==1.10.0
+sympy==1.14.0
+tensorboardx==2.6.5
+threadpoolctl==3.8.0
+tiktoken==0.14.0
+tokenizers==0.23.3
+tomlkit==0.14.0
+torch==2.11.0
+torchaudio==2.11.0
+tqdm==4.70.1
+transformers==5.24.1
+truststore==0.10.5
+typeguard==4.6.1
+typer==0.29.3
+typing-extensions==4.16.0
+typing-inspection==0.4.5
+tzdata==2026.6
+ukrainian-word-stress==2.1.0
+urllib3==2.8.0
+uvicorn==0.54.0
+webdataset==1.0.2
diff --git a/tools/setup/locks/holos.txt b/tools/setup/locks/holos.txt
new file mode 100644
index 0000000..5c8dbbd
--- /dev/null
+++ b/tools/setup/locks/holos.txt
@@ -0,0 +1,79 @@
+annotated-doc==0.0.7
+annotated-types==0.8.0
+anyio==4.16.0
+audioop-lts==0.2.2
+audioread==3.1.0
+certifi==2026.11.20
+cffi==2.1.1
+charset-normalizer==3.5.3
+click==8.5.1
+cloudpickle==3.1.3
+colorama==0.4.6
+decorator==5.3.2
+docopt==0.6.2
+emoji==2.16.0
+filelock==4.3.1
+fsspec==2026.9.0
+h11==0.16.0
+hf-xet==1.8.0
+holos-tts==0.4
+httpcore2==2.16.2
+httpx2==2.16.2
+huggingface-hub==2.4.0
+idna==3.20
+jinja2==3.1.6
+joblib==1.6.0
+lazy-loader==0.6
+librosa==0.11.0
+llvmlite==0.50.0
+marisa-trie==1.4.1
+markdown-it-py==4.3.0
+markupsafe==3.0.4
+mdurl==0.1.2
+mpmath==1.3.0
+msgpack==1.2.4
+narwhals==2.29.0
+networkx==3.7
+num2words==0.5.14
+numba==0.68.1
+numpy==2.4.6
+orjson==3.13.0
+packaging==26.4
+platformdirs==4.14.8
+pooch==1.9.0
+protobuf==7.36.2
+pycparser==3.12
+pydantic==2.14.4
+pydantic-core==2.50.5
+pygments==2.21.0
+pyyaml==6.0.4
+regex==2026.11.25
+requests==2.34.2
+rich==15.0.0
+safetensors==0.8.0
+scikit-learn==1.9.1
+scipy==1.17.1
+setuptools==81.0.0
+shellingham==1.5.4
+six==1.17.0
+soundfile==0.14.0
+soxr==1.1.0
+standard-aifc==3.13.0
+standard-chunk==3.13.0
+standard-sunau==3.13.0
+stanza==1.15.1
+sympy==1.14.0
+termcolor==3.3.0
+threadpoolctl==3.8.0
+tokenizers==0.23.3
+torch==2.11.0
+torchaudio==2.11.0
+tqdm==4.70.1
+transformers==5.23.0
+truststore==0.10.5
+typer==0.29.3
+typing-extensions==4.16.0
+typing-inspection==0.4.5
+udapi==0.5.2
+udtools==0.2.9
+urllib3==2.8.0
diff --git a/tools/setup/locks/voxcpm.txt b/tools/setup/locks/voxcpm.txt
new file mode 100644
index 0000000..11f3e9d
--- /dev/null
+++ b/tools/setup/locks/voxcpm.txt
@@ -0,0 +1,152 @@
+addict==2.4.0
+aiohappyeyeballs==2.7.1
+aiohttp==3.14.5
+aiosignal==1.4.0
+aliyun-python-sdk-core==2.16.1
+aliyun-python-sdk-kms==2.16.5
+annotated-doc==0.0.7
+annotated-types==0.8.0
+antlr4-python3-runtime==4.9.3
+anyascii==0.3.3
+anyio==4.16.0
+argbind==0.3.9
+attrs==26.1.0
+audioop-lts==0.2.2
+brotli==1.2.1
+certifi==2026.11.20
+cffi==2.1.1
+charset-normalizer==3.5.3
+click==8.5.1
+cloudpickle==3.1.3
+colorama==0.4.6
+contourpy==1.4.0
+contractions==0.1.73
+crcmod==1.7
+cryptography==50.0.2
+cycler==0.12.1
+datasets==3.6.0
+decorator==5.3.2
+dill==0.3.8
+docopt==0.6.2
+docstring-parser==0.18.0
+einops==0.8.2
+fastapi==0.165.0
+filelock==4.3.2
+fonttools==4.69.1
+frozenlist==1.8.0
+fsspec==2025.3.0
+funasr==1.4.29
+gradio==6.32.0
+gradio-client==2.7.2
+groovy==0.1.2
+h11==0.16.0
+hf-gradio==0.4.1
+hf-xet==1.8.0
+httpcore==1.0.9
+httpcore2==2.16.2
+httpx==0.29.0
+httpx2==2.16.2
+huggingface-hub==2.5.0
+hydra-core==1.3.8
+idna==3.20
+inflect==7.6.0
+jaconv==0.5.0
+jamo==0.4.1
+jaraco-functools==4.6.0
+jieba==0.42.1
+jinja2==3.1.6
+jmespath==1.1.0
+joblib==1.6.0
+kaldifst==1.9.2
+kaldiio==2.18.1
+kiwisolver==1.5.1
+lazy-loader==0.6
+librosa==1.0.1
+llvmlite==0.50.0
+markdown-it-py==4.3.0
+markupsafe==3.0.4
+matplotlib==3.11.2
+mdurl==0.1.2
+modelscope==1.40.3
+modelscope-hub==0.7.2
+more-itertools==11.2.1
+mpmath==1.3.0
+msgpack==1.2.4
+multidict==7.2.1
+multiprocess==0.70.16
+narwhals==2.29.0
+networkx==3.7
+num2words==0.5.14
+numba==0.68.1
+numpy==2.5.5
+omegaconf==2.3.1
+opentelemetry-api==1.45.2
+orjson==3.13.0
+oss2==2.19.1
+packaging==26.4
+pandas==3.1.1
+pillow==13.0.0
+platformdirs==4.14.9
+pooch==1.9.0
+propcache==0.5.4
+protobuf==7.36.2
+pyahocorasick==2.3.1
+pyarrow==26.0.1
+pycparser==3.12
+pycryptodome==4.6.0
+pydantic==2.14.4
+pydantic-core==2.50.5
+pydub==0.25.1
+pygments==2.21.0
+pynndescent==0.7.0
+pyparsing==3.3.3
+python-dateutil==4.0.0
+python-multipart==0.0.34
+pytz==2026.6
+pyyaml==6.0.4
+rapidfuzz==3.14.6
+regex==2026.11.25
+requests==2.34.2
+rich==15.0.0
+safehttpx==0.1.7
+safetensors==0.8.0
+scikit-learn==1.9.1
+scipy==1.18.1
+semantic-version==2.10.0
+sentencepiece==0.2.3
+setuptools==81.0.0
+shellingham==1.5.4
+simplejson==4.3.0
+six==1.17.0
+sortedcontainers==2.4.0
+soundfile==0.14.0
+soxr==1.1.0
+spaces==0.53.0
+starlette==1.10.0
+sympy==1.14.0
+tensorboardx==2.6.5
+textsearch==0.0.24
+threadpoolctl==3.8.0
+tiktoken==0.14.0
+tokenizers==0.23.3
+tomlkit==0.14.0
+torch==2.11.0
+torch-complex==0.4.4
+torchaudio==2.11.0
+torchcodec==0.17.0
+tqdm==4.70.1
+transformers==5.24.1
+truststore==0.10.5
+typeguard==4.6.1
+typer==0.29.3
+typing-extensions==4.16.0
+typing-inspection==0.4.5
+tzdata==2026.6
+umap-learn==0.6.0
+urllib3==2.8.0
+uvicorn==0.55.0
+voxcpm==2.0.3
+websockets==17.4
+wetext==0.2.1
+xxhash==4.1.0
+yarl==1.25.1
diff --git a/tools/setup/setup.py b/tools/setup/setup.py
index 3eec84a..b99ccca 100644
--- a/tools/setup/setup.py
+++ b/tools/setup/setup.py
@@ -28,6 +28,22 @@ from pathlib import Path
APP_DIR_NAME = "mimvox"
+LOCKS = Path(__file__).with_name("locks") # written by lock.py from a working runtime
+
+
+def lock_args(env: str) -> list[str]:
+ """Every package of that environment at the version it was tested with."""
+ return ["-c", str(LOCKS / f"{env}.txt")]
+
+
+def canonical_name(name: str) -> str:
+ return re.sub(r"[-_.]+", "-", name).lower()
+
+
+def lock_stamp(env: str) -> str:
+ return hashlib.sha256((LOCKS / f"{env}.txt").read_bytes()).hexdigest()[:12]
+
+
def runtime_version() -> int:
"""The app reads the same file."""
path = Path(__file__).with_name("runtime_version.txt")
@@ -1696,7 +1712,11 @@ class Setup:
) -> None:
"""Builds the venv again next to it, from the cache first (``keep``: pinned to the packages it has), and swaps
it in only once that worked: the old venv stays otherwise."""
- pins = self._frozen(venv) if keep else []
+ lock = LOCKS / f"{venv.parent.name}.txt"
+ locked = (
+ {re.split(r"==", line)[0] for line in lock.read_text(encoding="utf-8").split()} if lock.is_file() else set()
+ )
+ pins = [p for p in self._frozen(venv) if canonical_name(p.split("==")[0]) not in locked] if keep else []
constraints = self.temp_dir() / f"{venv.parent.name}-constraints.txt"
constraints.write_text("".join(f"{line}\n" for line in pins), encoding="utf-8")
say(
@@ -1787,7 +1807,7 @@ class Setup:
def _applio_install(self, py: Path, extra: Sequence[str]) -> bool:
note = self._build_note()
say(f"Applio environment: installing requirements (torch 2.11{' ' + note if note else ''})...")
- command = self.uv("pip", "install", "--python", py, "-r", "requirements.txt", *extra)
+ command = self.uv("pip", "install", "--python", py, "-r", "requirements.txt", *lock_args("applio"), *extra)
command += self._torch_args()
self.must(command, "Installing the Applio requirements", cwd=self.applio)
return True
@@ -1797,7 +1817,7 @@ class Setup:
"Applio environment",
self.applio / ".venv",
APPLIO_PYTHON,
- self._stamp_value(APPLIO_COMMIT),
+ f"{self._stamp_value(APPLIO_COMMIT)} {lock_stamp('applio')}",
self._applio_install,
self.applio,
)
@@ -2089,12 +2109,23 @@ class Setup:
note = self._build_note()
say(f"Engine environment: installing torch 2.11{f' ({note})' if note else ''}, OmniVoice, Whisper...")
command = self.uv(
- "pip", "install", "--python", py, "--compile-bytecode", *ENGINE_TORCH, *ENGINE_PACKAGES, *extra
+ "pip",
+ "install",
+ "--python",
+ py,
+ "--compile-bytecode",
+ *ENGINE_TORCH,
+ *ENGINE_PACKAGES,
+ *lock_args("engine"),
+ *extra,
)
command += self._torch_args()
self.must(command, "Installing the engine environment", cwd=self.runtime)
if (
- self.run(self.uv("pip", "install", "--python", py, "--no-deps", *ENGINE_NO_DEPS, *extra), cwd=self.runtime)
+ self.run(
+ self.uv("pip", "install", "--python", py, "--no-deps", *ENGINE_NO_DEPS, *lock_args("engine"), *extra),
+ cwd=self.runtime,
+ )
!= 0
):
warn(
@@ -2106,7 +2137,7 @@ class Setup:
def _seedvc_install(self, py: Path, extra: Sequence[str]) -> None:
self.must(
- self.uv("pip", "install", "--python", py, *SEEDVC_PACKAGES, *extra),
+ self.uv("pip", "install", "--python", py, *SEEDVC_PACKAGES, *lock_args("engine"), *extra),
"Installing the zero-shot voice converter's packages",
cwd=self.runtime,
)
@@ -2114,7 +2145,7 @@ class Setup:
def engine_env(self) -> None:
stamp_value = (
f"{' '.join(ENGINE_TORCH)} {' '.join(ENGINE_PACKAGES)} {' '.join(ENGINE_NO_DEPS)} "
- f"{self.gpu.build} {self.plat}"
+ f"{self.gpu.build} {self.plat} {lock_stamp('engine')}"
)
def install(py: Path, extra: Sequence[str]) -> bool:
@@ -2151,7 +2182,7 @@ class Setup:
def holos_env(self) -> None:
stamp_value = (
f"{' '.join(ENGINE_TORCH)} {' '.join(HOLOS_PACKAGES)} {' '.join(HOLOS_NO_DEPS)} "
- f"{self.gpu.build} {self.plat}"
+ f"{self.gpu.build} {self.plat} {lock_stamp('holos')}"
)
self._venv_step(
"Ukrainian speech environment",
@@ -2166,12 +2197,20 @@ class Setup:
note = self._build_note()
say(f"Ukrainian speech environment: installing torch 2.11{f' ({note})' if note else ''}, HolosTTS, Stanza...")
command = self.uv(
- "pip", "install", "--python", py, "--compile-bytecode", *ENGINE_TORCH, *HOLOS_PACKAGES, *extra
+ "pip",
+ "install",
+ "--python",
+ py,
+ "--compile-bytecode",
+ *ENGINE_TORCH,
+ *HOLOS_PACKAGES,
+ *lock_args("holos"),
+ *extra,
)
command += self._torch_args()
self.must(command, "Installing the Ukrainian speech environment", cwd=self.runtime)
self.must(
- self.uv("pip", "install", "--python", py, "--no-deps", *HOLOS_NO_DEPS, *extra),
+ self.uv("pip", "install", "--python", py, "--no-deps", *HOLOS_NO_DEPS, *lock_args("holos"), *extra),
"Installing the Ukrainian stress dictionary",
cwd=self.runtime,
)
@@ -2180,13 +2219,23 @@ class Setup:
def clone_env(self, name: str) -> None:
spec = CLONE_MODELS[name]
label = f"{spec['label']} environment"
- stamp_value = f"{' '.join(ENGINE_TORCH)} {' '.join(spec['packages'])} {self.gpu.build} {self.plat}"
+ stamp_value = (
+ f"{' '.join(ENGINE_TORCH)} {' '.join(spec['packages'])} {self.gpu.build} {self.plat} {lock_stamp(name)}"
+ )
def install(py: Path, extra: Sequence[str]) -> bool:
note = self._build_note()
say(f"{label}: installing torch 2.11{f' ({note})' if note else ''} and {spec['packages'][0]}...")
command = self.uv(
- "pip", "install", "--python", py, "--compile-bytecode", *ENGINE_TORCH, *spec["packages"], *extra
+ "pip",
+ "install",
+ "--python",
+ py,
+ "--compile-bytecode",
+ *ENGINE_TORCH,
+ *spec["packages"],
+ *lock_args(name),
+ *extra,
)
command += self._torch_args()
self.must(command, f"Installing the {label}", cwd=self.runtime)