You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add missing __init__.py to prevent namespace package issue
Root cause:
- src/metaspec/ lacked __init__.py, causing Python to treat it as a namespace package
- metaspec.__file__ was None instead of pointing to the package location
- This caused CliRunner tests to fail while actual CLI worked fine
Impact:
- CliRunner couldn't properly load command metadata from typer.Option/Argument
- Tests failed with 'assert "--command" in result.stdout' even though options existed
- Actual installed CLI worked correctly because it loaded via entry points
Solution:
- Add src/metaspec/__init__.py with package metadata
- Now metaspec.__file__ points to /path/to/__init__.py (not None)
- CliRunner and actual CLI both load the same properly initialized package
Result:
✅ All 138 tests pass (4 previously failing tests now pass)
✅ metaspec is now a proper package, not a namespace package
✅ Consistent behavior between test environment and installed CLI
0 commit comments