Preserve aliases in lazy_export absolute imports - #7273
Preserve aliases in lazy_export absolute imports#7273sylvesterkaczmarek wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot
The change correctly preserves aliases for absolute named imports in .pyi stubs by carrying both source and export names through parsing and runtime installation. The regression test verifies the aliased callable and __all__ surface, and the changelog fragment documents the user-visible fix.
- Design and architecture: The representation change remains confined to the private
_parse_stub()helper and its consumer inlazy_export(). Existing package grouping, eager resolution, and wildcard fallback architecture remain unchanged. - API: Non-aliased absolute imports retain their existing names and
__all__entries. Aliased imports now expose only the alias, aligning the runtime module surface with the stub-declared public API without changing the deprecatedpackagesargument or wildcard behavior. - Implementation: The parser annotation, documentation, collected values, export loop, and
__all__handling were updated consistently. The focused test covers callable resolution and confirms that the source name is not publicly exported. Duplicate aliases across package groups retain the pre-existing package-grouped resolution behavior.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
Greptile SummaryThis PR updates
Confidence Score: 4/5The alias fix should not merge until the existing The implementation changes every absolute named import from a string to a tuple, while several existing direct parser assertions still require string lists and will fail when the suite runs. Files Needing Attention: source/isaaclab/isaaclab/utils/module.py and source/isaaclab_tasks/test/core/test_lazy_export_stubs.py Important Files Changed
Reviews (1): Last reviewed commit: "Format lazy export changelog fragment" | Re-trigger Greptile |
There was a problem hiding this comment.
AI review disclosure: This review was produced with assistance from multiple AI systems.
Thank you for putting this PR together.
Assessment: Alias parsing and eager export binding preserve as-names without changing unaliased behavior.
Findings: Invalid isaaclab .patch.rst filename and no isaaclab_tasks fragment despite touching its managed tests.
Requested changes: Rename isaaclab fragment to .rst; add an isaaclab_tasks .skip; run changelog gate and focused tests.
Changelog filename: Rename the current <slug>.patch.rst fragment to <slug>.rst for this patch-level change. IsaacLab accepts <slug>.rst (patch), <slug>.minor.rst, and <slug>.major.rst; it does not accept a .patch.rst suffix.
Test scope: Runtime alias/all regression and parser expectations are focused.
Documentation / AI skills: No additional documentation update is required: existing semantics are being repaired. No AI-skill update is required.
Description
Fixes alias handling for absolute named imports declared in
.pyistubs used bylazy_export()._parse_stub()currently records onlyalias.name. For a stub such as:the runtime export is created as
sqrtinstead ofsquare_root, so the module does not match the public API described by its stub.This change records both the source name and the exported name and installs the object under the alias when one is present. Non-aliased absolute imports keep their existing behavior.
Type of change
Validation
.pyistub.__all__, while the original source name is not exported.isaaclabchangelog fragment.Checklist