mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-19 23:33:03 +00:00
lint(ruff): fix E402 and related import issues
- Fix E402 by removing sys.path hacks and ensuring imports are at module top level - Replace ad-hoc imports with proper package imports (filter_plugins, lookup_plugins, module_utils, cli) - Make lookup plugins importable via package paths (e.g. lookup_plugins.application_gid) - Clean up test imports to rely on installed package layout instead of sys.path manipulation - Partially fix F821 caused by missing/invalid imports This establishes a consistent, ruff-compliant import architecture across CLI, filters, plugins, and tests.
This commit is contained in:
@@ -3,17 +3,8 @@ import argparse
|
||||
import yaml
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Ensure project root on PYTHONPATH so module_utils is importable
|
||||
repo_root = Path(__file__).resolve().parent.parent.parent
|
||||
sys.path.insert(0, str(repo_root))
|
||||
|
||||
# Add lookup_plugins for application_gid
|
||||
plugin_path = repo_root / "lookup_plugins"
|
||||
sys.path.insert(0, str(plugin_path))
|
||||
|
||||
from module_utils.dict_renderer import DictRenderer
|
||||
from application_gid import LookupModule
|
||||
from lookup_plugins.application_gid import LookupModule
|
||||
|
||||
def load_yaml_file(path: Path) -> dict:
|
||||
if not path.exists():
|
||||
|
||||
Reference in New Issue
Block a user