-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Python stubs loaded from extensions folder even when using an explicit interpreter #1982
Comments
In the venv is the But I'm currently working on a Rust version of Jedi/Mypy that should improve this. |
There is no Does this point to a different issue if I am missing the |
I'm unsure if this is an issue. Can you give me a small reproduction zip that I could try? On the other hand I'm also personally interested to know why you prefer Jedi to Pyright/Pylance in VSCode. |
If you just Also I am on linux using vscodium. I actually thought i was using pylance and reported this issue over there first: microsoft/pylance-release#5444 and sure enough after that post, i looked in the output tab and can see :
and trying to then change the |
Also a bit more context for this, i tried adding an empty |
The problem is that with whatever sys.path you import For now I do not think this is important enough and it will also worsen performance. I will keep it open though so if someone comes along and implements it, we can evaluate the impacts and maybe merge. |
Is there a way to force jedi to use Also to be clear, i appreciate you explaining the rationale for the way this works, and as the creator of this project i can respect your opinion on saying this isn't important enough to degrade performance trade offs made in this project just to fix the problem. But I am keen to try and find a workaround IF one exists. If there isn't, I guess i will have to live with it, or give up on using vscodium and accept that i need to use vscode + pylance. But would very very very much like to avoid that :D |
Yes, I understand that very much. I unfortunately don't think there's a solution here for now. If correctly done the performance tradeoffs might not even be that bad, but it's just too much work for me now. So if you want to you try and play with the import system and if it doesn't make tests slower by a lot, I might merge a pull request. But I just don't have the time for that now (nor is it very important). |
Hopefully the title isn't too confusing, But let me explain the steps i went through and the problem im seeing.
pip install micropython-esp8266-stubs
)gc
andmachine
)machine
package import lints correctly and if you go to definition it will open the.pyi
file in that venv location, but if you do the same for thegc
package it opens the.pyi
file in the default extension location (in my example, it opens the path to thejedi/third_party/typeshed/stdlib/*
file)I'm happy to be told im wrong, but this seems like an oversight to me. In my program i am getting lint warnings, and not getting function previews/auto complete for my correct code, because the implementation of
gc
from micropython is different to the python standard librarygc
, but i am developing in a venv for this reason, and i can't seem to find any extension settings that allow me to explicitly tell vs code (or in my case, vscodium) to only use stubs in my venv location (or atleast change the priority order that they are looked for)Extension version: 2024.0.0
VSCodium version: VSCodium 1.82.2 (a5004432af6600c99fa4f918a3f2f8df44df71e6, 2023-09-14T18:27:11.315Z)
OS version: Linux x64 6.1.0-17-amd64
The text was updated successfully, but these errors were encountered: