mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-31 08:03:32 +00:00
fix(plugin-loader): fail-fast when install_dependencies returns False
Previously the boolean result was silently discarded, so a failed pip install would log a warning but continue attempting to import the plugin module — resulting in a confusing ModuleNotFoundError instead of a clear dependency failure message. Now raises PluginError with plugin_id and plugin_dir if dependency installation fails, stopping the load before the import is attempted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -609,7 +609,12 @@ class PluginLoader:
|
|||||||
"""
|
"""
|
||||||
# Install dependencies if needed
|
# Install dependencies if needed
|
||||||
if install_deps:
|
if install_deps:
|
||||||
self.install_dependencies(plugin_dir, plugin_id, plugins_dir=plugins_dir)
|
if not self.install_dependencies(plugin_dir, plugin_id, plugins_dir=plugins_dir):
|
||||||
|
raise PluginError(
|
||||||
|
f"Dependency installation failed for plugin {plugin_id} in {plugin_dir}",
|
||||||
|
plugin_id=plugin_id,
|
||||||
|
context={'plugin_dir': str(plugin_dir)},
|
||||||
|
)
|
||||||
|
|
||||||
# Load module
|
# Load module
|
||||||
entry_point = manifest.get('entry_point', 'manager.py')
|
entry_point = manifest.get('entry_point', 'manager.py')
|
||||||
|
|||||||
Reference in New Issue
Block a user