Private
Public Access
fix(consumers): remove self-imports from migration
The migration commit (8f11340b) replaced 'from src.models import X'
with 'from src.<destination> import X' in EVERY file including the
destination files themselves. This created self-imports like
'from src.external_editor import ExternalEditorConfig' in
src/external_editor.py (which defines ExternalEditorConfig locally).
This fix removes the spurious self-imports from the 5 destination
files that were affected:
- src/external_editor.py (3 lines removed: 1 top-level + 2 in
function bodies that my migration
missed on the first pass)
- src/personas.py (1 line removed)
- src/tool_bias.py (1 line removed)
- src/tool_presets.py (1 line removed)
- src/workspace_manager.py (1 line removed)
The migration in non-destination files is correct and unchanged.
After this fix, the next merge of origin/tier2/module_taxonomy_refactor_20260627
(bringing in the v2 SHIPPED work) will not conflict on these files
because the self-imports are gone; the merge will apply v2's class
definitions cleanly.
The fix was performed by
scripts/tier2/artifacts/post_module_taxonomy_de_cruft_20260627/fix_self_imports.py
which removes 'from src.<module> import X' lines from files where
<module> matches the file's destination module name.
This commit is contained in:
@@ -9,7 +9,6 @@ import tempfile
|
||||
from pathlib import Path
|
||||
from typing import Optional, List, Dict, Any
|
||||
|
||||
from src.external_editor import ExternalEditorConfig, TextEditorConfig
|
||||
from src.result_types import ErrorInfo, ErrorKind, Result
|
||||
|
||||
|
||||
@@ -24,7 +23,6 @@ class ExternalEditorLauncher:
|
||||
"""
|
||||
[C: tests/test_external_editor.py:TestExternalEditorLauncher.test_get_editor_by_name, tests/test_external_editor.py:TestExternalEditorLauncher.test_get_editor_returns_default, tests/test_external_editor.py:TestExternalEditorLauncher.test_get_editor_unknown_name]
|
||||
"""
|
||||
from src.external_editor import EMPTY_TEXT_EDITOR_CONFIG
|
||||
if editor_name:
|
||||
return self.config.editors.get(editor_name) or EMPTY_TEXT_EDITOR_CONFIG
|
||||
return self.config.get_default()
|
||||
@@ -96,7 +94,6 @@ def _find_vscode_common_paths() -> str:
|
||||
|
||||
|
||||
def auto_detect_vscode() -> TextEditorConfig:
|
||||
from src.external_editor import EMPTY_TEXT_EDITOR_CONFIG
|
||||
global _cached_vscode_config
|
||||
if _cached_vscode_config is not None:
|
||||
return _cached_vscode_config
|
||||
|
||||
Reference in New Issue
Block a user