Skip to content

Conversation

@seddonym
Copy link
Collaborator

@seddonym seddonym commented Dec 4, 2025

Add support for passing in native namespace packages as root_packages. (Prior to this, you could only pass the portion.)

@seddonym seddonym mentioned this pull request Dec 4, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 4, 2025

CodSpeed Performance Report

Merging #267 will improve performances by 10.25%

Comparing namespace-root-packages (c76a1d4) with main (9030d92)

Summary

⚡ 2 improvements
✅ 24 untouched
⏩ 23 skipped1

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
WallTime test_no_chains 685 µs 621.9 µs +10.16%
WallTime test_no_chain 683.9 µs 620.3 µs +10.25%

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.

Prior to this, subsequent sibling packages in the contents string would
be incorrectly nested under the directory the line above, due to an
assumption that the contents string would be dedented. This takes
account of that.
As it's more flexible.
This internal change will make it easier to walk the filesystem
regardless of how deep the first line of contents is.
This improves the debugging experience in IDEs.
@seddonym seddonym force-pushed the namespace-root-packages branch from 06c26e6 to 3e5bb04 Compare December 9, 2025 08:52
This doesn't change the implementation yet, but it prepares us for
supporting namespace packages passed in.
This pushes the NamespacePackageEncountered error up
the call stack into the use case.
This gets us most of the way, but we still want to include the namespace
packages in the graph too (depending on what's passed in).
This stops us from discovering Python modules that aren't importable.
Prior to this, an import of a namespace package would be included if
include_external_packages=True but not if it was False. Although in
practice it's unlikely that a module would import a namespace package,
this makes the behaviour consistent.
@seddonym seddonym force-pushed the namespace-root-packages branch from 6688240 to c76a1d4 Compare December 10, 2025 16:42
@seddonym seddonym marked this pull request as ready for review December 10, 2025 16:44
@seddonym seddonym merged commit f428912 into main Dec 10, 2025
18 checks passed
@seddonym seddonym deleted the namespace-root-packages branch December 10, 2025 16:58
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.

2 participants