mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
feat: add plugin loader infrastructure
Implement plugin loading and validation: - loader.py: discover, import, validate plugins - validate PLUGIN_MANIFEST, MODEL_REQUIREMENTS, create_engine - validate api_version compatibility (major must match) - validate capabilities (reject unknown) - diagnostic messages for all error cases - no partial registration after error Test plugins: - fake_plugin: minimal valid plugin for testing - missing_manifest: no PLUGIN_MANIFEST - invalid_api_version: major version mismatch - invalid_capabilities: unknown capabilities - missing_create_engine: no create_engine function - import_error: raises ImportError during import - missing_model_requirements: no MODEL_REQUIREMENTS 39 new tests covering all loader functionality.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""Invalid plugin: raises ImportError during import."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
# This plugin intentionally raises an ImportError
|
||||
raise ImportError("Simulated import error for testing")
|
||||
|
||||
# The following code will never be reached, but is here for documentation
|
||||
from abogen.tts_plugin.manifest import PluginManifest
|
||||
|
||||
PLUGIN_MANIFEST = PluginManifest(
|
||||
id="import_error",
|
||||
name="Import Error Plugin",
|
||||
version="1.0.0",
|
||||
api_version="1.0",
|
||||
description="Plugin that fails to import",
|
||||
author="Test Author",
|
||||
)
|
||||
Reference in New Issue
Block a user