mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
refactor: remove compatibility layer, use Plugin Architecture directly
- Delete abogen/tts_plugin/compat.py (CompatBackend, create_backend, get_metadata, etc.) - Add abogen/tts_plugin/utils.py with direct Plugin Manager functions: get_voices, get_default_voice, is_plugin_registered, resolve_voice_to_plugin, create_pipeline - Update all 16 consumer files to import from utils instead of compat - Update __init__.py to re-export utils instead of compat - Update 5 test files and add TestNoCompatLayer regression tests - All 493 tests pass
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from types import SimpleNamespace
|
||||
from typing import cast
|
||||
|
||||
from abogen.tts_plugin.compat import get_metadata
|
||||
from abogen.tts_plugin.utils import get_voices
|
||||
from abogen.webui.conversion_runner import (
|
||||
_chapter_voice_spec,
|
||||
_chunk_voice_spec,
|
||||
@@ -49,4 +49,4 @@ def test_voice_collection_includes_formula_components():
|
||||
voices = _collect_required_voice_ids(job)
|
||||
|
||||
assert {"af_nova", "am_liam"}.issubset(voices)
|
||||
assert voices.issuperset(get_metadata("kokoro").voices)
|
||||
assert voices.issuperset(get_voices("kokoro"))
|
||||
|
||||
Reference in New Issue
Block a user