Repository navigation
fix: resolve lazy login imports relative to the loaded package - #15
Merged
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a0c095-4917-7617-9dac-e99f1ef22d41 Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The lazy login exports added in 1.0.1 use absolute imports such as
lm15.loginandlm15.interactive. When lm15 is vendored under another namespace, those imports resolve outside the loaded package.This breaks plain
import dspy: DSPy bundles lm15 asdspy._vendor.lm15and re-exports its public names. ResolvingAuthraisesModuleNotFoundError: No module named 'lm15'. A separately installed lm15 could instead supply objects from the wrong package. Login account-flow discovery has the same absolute-import problem. The issue remains in 1.1.0.Use relative imports with
__package__in both lazy-import paths. This preserves lazy loading and normal top-level imports without requiring asys.modulesalias or a separate lm15 installation.Two isolated-process regression cases load lm15 under another namespace while blocking the top-level
lm15name. They verify public exports, class identity, and xAI account-flow discovery without network access or credentials. Both fail before the fix and pass afterward.