Skip to content

Add a function to get layered architectures#459

Merged
nathanjmcdougall merged 3 commits into
mainfrom
455-function-to-create-a-layered-assessment-of-the-current-package-architecture
Apr 3, 2025
Merged

Add a function to get layered architectures#459
nathanjmcdougall merged 3 commits into
mainfrom
455-function-to-create-a-layered-assessment-of-the-current-package-architecture

Conversation

@nathanjmcdougall

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-hq

codspeed-hq Bot commented Apr 3, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #459 will not alter performance

Comparing 455-function-to-create-a-layered-assessment-of-the-current-package-architecture (8ea37d3) with main (8ca7cc4)

Summary

✅ 1 untouched benchmarks

@codecov

codecov Bot commented Apr 3, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.30%. Comparing base (8ca7cc4) to head (8ea37d3).
Report is 1 commits behind head on main.

✅ 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.
📢 Have feedback on the report? Share it here.

@nathanjmcdougall nathanjmcdougall merged commit b06af8c into main Apr 3, 2025
@nathanjmcdougall nathanjmcdougall deleted the 455-function-to-create-a-layered-assessment-of-the-current-package-architecture branch April 3, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function to create a layered assessment of the current package architecture

2 participants