Skip to content

Add as_package parameter to direct import methods (retry branch) - #336

Merged
seddonym merged 1 commit into
mainfrom
direct-import-methods-as-package-2
Nov 13, 2026
Merged

seddonym merged 1 commit into
mainfrom
direct-import-methods-as-package-2

Conversation

@seddonym

Copy link
Copy Markdown
Collaborator

find_modules_directly_imported_by and find_modules_that_directly_import can now treat the supplied module as a package, as find_upstream_modules and find_downstream_modules already do. The result includes the modules that the package's descendants import (or that import them), and excludes modules within the package.

direct_import_exists already had as_packages.

Fixes #25.

Assistant-model: Claude Code

  • Add tests for the change. In general, aim for full test coverage at the Python level. Rust tests are optional.
  • Add any appropriate documentation.
  • Add a summary of changes to the latest section at the top of CHANGELOG.rst. (If it's not there, add it.)
  • Add your name to AUTHORS.rst.
  • Run just full-check.

@seddonym seddonym changed the title Add as_package parameter to direct import methods Add as_package parameter to direct import methods (retry branch) Nov 13, 2026
find_modules_directly_imported_by and find_modules_that_directly_import
can now treat the supplied module as a package, as find_upstream_modules
and find_downstream_modules already do. The result includes the modules
that the package's descendants import (or that import them), and excludes
modules within the package.

direct_import_exists already had as_packages.

Fixes #25.

Assistant-model: Claude Code
@seddonym
seddonym force-pushed the direct-import-methods-as-package-2 branch from c3f9ff8 to 65a1cfe Compare November 13, 2026 13:11
@codspeed

codspeed Bot commented Nov 13, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.71%

⚡ 1 improved benchmark
✅ 25 untouched benchmarks
⏩ 23 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_get_import_details 171.5 µs 154.9 µs +10.71%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing direct-import-methods-as-package-2 (65a1cfe) with main (185670e)

Open in CodSpeed

Footnotes

  1. 23 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@seddonym
seddonym marked this pull request as ready for review November 13, 2026 13:59
@seddonym
seddonym merged commit f838521 into main Nov 13, 2026
24 checks passed
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.

as_package parameter for direct import methods

2 participants