Skip to content

Commit 5070497

Browse files
authored
Merge pull request #115 from awslabs/fix/package-import-paths
fix: remove hardcoded src prefix from package imports
2 parents e94ebb3 + 25a93e3 commit 5070497

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/infrastructure/di/components/dependency_resolver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ def _resolve_string_annotation(self, annotation: str, context_class: type) -> ty
353353
# Last resort: try to import from common locations
354354
for module_name in [
355355
"typing",
356-
"src.domain",
357-
"src.application",
358-
"src.infrastructure",
356+
"domain",
357+
"application",
358+
"infrastructure",
359359
]:
360360
try:
361361
module_obj = __import__(module_name, fromlist=[annotation])

src/infrastructure/di/handler_discovery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _resolve_cache_path_fallback(self) -> str:
9393
os.makedirs(cache_dir, exist_ok=True)
9494
return os.path.join(cache_dir, "handler_discovery.json")
9595

96-
def discover_and_register_handlers(self, base_package: str = "src.application") -> None:
96+
def discover_and_register_handlers(self, base_package: str = "application") -> None:
9797
"""
9898
Discover all handlers and register them with the DI container.
9999
Uses caching to improve performance on subsequent runs.
@@ -336,7 +336,7 @@ def _register_handlers_from_cache(self, cached_handlers: dict[str, Any]) -> None
336336
def _fallback_to_full_discovery(self) -> None:
337337
"""Fall back to full discovery if cache loading fails."""
338338
logger.info("Falling back to full handler discovery")
339-
self._discover_handlers("src.application")
339+
self._discover_handlers("application")
340340
self._register_handlers()
341341

342342
def _get_source_file_mtimes(self, base_package: str) -> dict[str, float]:

0 commit comments

Comments
 (0)