Fix Python submodule import ordering#165
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a060f8fbd3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut sibling_path = ns_path.to_vec(); | ||
| sibling_path.push(sibling_name.clone()); | ||
| let sibling_qualified_name = module_qualified_name(&sibling_path); | ||
| if contains_qualified_name(&rendered_code, &sibling_qualified_name) { |
There was a problem hiding this comment.
Avoid matching nested namespaces as root siblings
When ordering root-level packages (ns_path is empty), sibling_qualified_name is just the bare root name, so contains_qualified_name also matches nested references like x.common.Type because the preceding . is treated as a boundary. If there is also a real top-level common package and it depends on x, this false x -> common edge creates a cycle and the code falls back to the original/alphabetical order, leaving common imported before its real dependency x and reintroducing the import-time failure this change is meant to prevent. Root sibling detection needs to distinguish common.Type from suffixes such as x.common.Type.
Useful? React with 👍 / 👎.
|
📖 Documentation Preview: https://reflectapi-docs-preview-pr-165.partly.workers.dev Updated automatically from commit e995249 |
Summary
Fixes #164
Testing