Add a function to get layered architectures#459
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds functionality to compute layered architectures for a package and includes corresponding tests and supporting integrations. Key changes include:
- Implementation of get_layered_architectures and related helper functions to compute module dependency layers.
- Updates to test cases in tests/usethis/_integrations/project/test_imports.py to verify the layered architectures.
- Enhancements to the change_cwd context manager in src/usethis/_test.py and updated dependency declarations and configuration in pyproject.toml.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/usethis/_integrations/project/test_imports.py | New tests covering layered architectures and module dependencies |
| src/usethis/_test.py | Updated change_cwd to optionally add directories to PYTHONPATH |
| src/usethis/_integrations/project/imports.py | New functions to build and compute layered architectures |
| src/usethis/_integrations/project/errors.py | New error type for handling import graph build issues |
| pyproject.toml | Updated dependencies and modular design configurations |
Comments suppressed due to low confidence (1)
tests/usethis/_integrations/project/test_imports.py:228
- Consider adding an automated test that passes a sub-module argument to _get_child_dependencies to improve test coverage, as noted by the TODO comment.
# TODO test sub-module as arg
CodSpeed Performance ReportMerging #459 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #459 +/- ##
==========================================
+ Coverage 97.25% 97.30% +0.04%
==========================================
Files 80 82 +2
Lines 3678 3745 +67
==========================================
+ Hits 3577 3644 +67
Misses 101 101 ☔ View full report in Codecov by Sentry. |
No description provided.