-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve docs to clarify that import heuristics don't work for local imports #5836
Comments
it is a dup of #5434 currently it is by design. we don't consider alias (import we are planning to add |
@heejaechang got it. I think the reason why issues on this topic keep appearing this is that users can only find outdated information at stackoverflow or old comments in this repo. Maybe I did not find the right section, but if it was addressed clearly (i.e., directly stating "we do not support user file/local discovery, do this instead") it would do wonders for clarity. |
@irm-codebase it looks like I misunderstood your issue. so you are asking about |
I tried your scenario on both |
I added new logging for this case. it will be included in our next pre-release. we probably need that log (unless we can repro it) to figure out what is going on. |
As the name says, discovery heuristics does not seem to work for local imports.
There are a bunch of issues marking this as solved... but the current documentation seems to ignore them (#1167, #68, #253, #3592 and lately #5226).
Obviously finding what works and what does not is... quite hard at the moment.
So, should discovery heuristics work for local imports by default? And if so, how to fix it?
Environment data
Code Snippet
Nothing too complicated: I am importing a local script
The project structure is
Adding the path to extraPaths solves it, but this should be automatic with heuristics enabled (which is my case, per default).
Repro Steps
Expected behavior
Pylance should resolve local imports by default using heuristics.
Actual behavior
Pylance does not resolve the import using heuristics.
Logs
Logs too big... see attachment.
2024 05 01 15 18 32 444.txt
The text was updated successfully, but these errors were encountered: