diff options
| author | Daisy Hollman <daisy@anthropic.com> | 2025-12-19 02:54:38 +0000 |
|---|---|---|
| committer | Daisy Hollman <daisy@anthropic.com> | 2025-12-19 02:54:38 +0000 |
| commit | 5f2db35c65ac214bc0efcf97d7f2c93964c1e740 (patch) | |
| tree | d41700479cec04d18700e2cda5d7a5185b870257 /plugins/hookify/core/rule_engine.py | |
| parent | 4bab8d0f501eb674a5661128ee5007624f4b9786 (diff) | |
Fix hookify plugin import error: No module named 'hookify'daisy/plugins/fix-hookify-imports
The hook scripts used absolute imports like `from hookify.core.config_loader`
but when installed, the plugin lives in a cache directory with a hash name,
not in a directory named `hookify/`. Python couldn't resolve the package.
Changed to local imports (`from core.X`) which work because PLUGIN_ROOT
is added to sys.path. Also simplified the sys.path setup.
Fixes: https://github.com/anthropics/claude-code/issues/14267
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'plugins/hookify/core/rule_engine.py')
| -rw-r--r-- | plugins/hookify/core/rule_engine.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/hookify/core/rule_engine.py b/plugins/hookify/core/rule_engine.py index 8244c005..51561c39 100644 --- a/plugins/hookify/core/rule_engine.py +++ b/plugins/hookify/core/rule_engine.py @@ -7,7 +7,7 @@ from functools import lru_cache from typing import List, Dict, Any, Optional # Import from local module -from hookify.core.config_loader import Rule, Condition +from core.config_loader import Rule, Condition # Cache compiled regexes (max 128 patterns) @@ -275,7 +275,7 @@ class RuleEngine: # For testing if __name__ == '__main__': - from hookify.core.config_loader import Condition, Rule + from core.config_loader import Condition, Rule # Test rule evaluation rule = Rule( |
