refactor: move VOICES_INTERNAL into KokoroBackend module

Make the Kokoro voice list an internal implementation detail of the
backend instead of a shared constant. The rest of the project already
accesses voices via get_metadata('kokoro').voices.

- Move VOICES_INTERNAL from constants.py to kokoro.py as _VOICES_INTERNAL
- Update tests to use get_metadata('kokoro').voices instead of importing
  the constant directly
This commit is contained in:
Artem Akymenko
2026-07-08 16:19:34 +00:00
parent 49d66839dc
commit e94ba5257e
4 changed files with 64 additions and 64 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ from typing import cast
import pytest
from abogen.constants import VOICES_INTERNAL
from abogen.tts_backend_registry import get_metadata
from abogen.voice_cache import (
LocalEntryNotFoundError,
_CACHED_VOICES,
@@ -66,4 +66,4 @@ def test_collect_required_voice_ids_includes_all():
voices = _collect_required_voice_ids(cast(Job, job))
assert {"af_nova", "am_liam", "am_michael"}.issubset(voices)
assert voices.issuperset(VOICES_INTERNAL)
assert voices.issuperset(get_metadata("kokoro").voices)