fix: remove hardcoded src prefix from package imports#115
Merged
Conversation
The handler discovery and dependency resolver were using hardcoded 'src.application', 'src.domain', 'src.infrastructure' paths which don't exist when the package is installed via pip. When installed, the package structure is: - application/ (not src.application) - domain/ - infrastructure/ This caused handler discovery to fail with 'No matches found for pattern: src' when running the CLI from an installed package. Changes: - HandlerDiscoveryService: Changed default base_package from 'src.application' to 'application' (line 96) - HandlerDiscoveryService: Fixed fallback discovery path (line 339) - DependencyResolver: Removed 'src.' prefix from fallback import locations (lines 356-358) Fixes CLI import errors when package is installed via pip install.
fgogolli
force-pushed
the
fix/package-import-paths
branch
from
January 21, 2026 13:47
336c01e to
25a93e3
Compare
Contributor
Test Results Summary1 219 tests ±0 781 ✅ ±0 53s ⏱️ ±0s For more details on these failures and errors, see this check. Results for commit 25a93e3. ± Comparison against base commit e94ebb3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes hardcoded 'src.' prefix in package import paths that caused CLI failures when the package is installed via pip.
The handler discovery and dependency resolver were using hardcoded string literals like 'src.application', 'src.domain', 'src.infrastructure' which don't exist in the installed package structure. When installed via pip, modules are at top-level (application/, domain/, infrastructure/) not under src/.
This caused the CLI to fail with 'No matches found for pattern: src' when running commands like
orb templates listfrom an installed package.Type of Change
Related Issues
Fixes the CLI import errors discovered during TestPyPI testing.
How Has This Been Tested?
make build-with-versionpip install dist/orb_py-*.whlorb --helpandorb templates listTest Configuration
Checklist
Additional Notes
This is a minimal, surgical fix that only changes 3 hardcoded string literals used for dynamic module discovery. All actual import statements in the codebase already use the correct pattern (without 'src.' prefix).
Analysis document included at
docs/research/package-structure-analysis.mdfor future reference on package structure alignment with Python standards.Performance Impact
Security Considerations
Dependencies
None
Files Changed
src/infrastructure/di/handler_discovery.py: Changed default base_package from 'src.application' to 'application' (2 locations)src/infrastructure/di/components/dependency_resolver.py: Removed 'src.' prefix from fallback import locationsdocs/research/package-structure-analysis.md: Added analysis document (new file)