-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Local developping modules ill referenced by VSCode's "go to definition" #8513
Comments
please figure out whether this is a poetry question or a vscode question I expect that poetry is correctly installing the path dependency in the virtual environment that it manages, and you have vscode picking up some other virtual environment. If so, there is nothing that poetry can do about that |
I think it may be related to this issue |
ah yes, that sounds right. Not a poetry bug then. |
Ok my bad, guys :) Thanks for highlighting the related PyLance issue :) I'll close the issue. |
@francoisWeber Did you figure out a workaround? |
Not yet but I had no time to dig into this problem for the moment. |
Hi Guys, So I have the following question to reopen this issue : why would Poetry install a library with option |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Context
Environment from
poetry debug info
:OS is Mac Ventura 13.3.1
I consider a mono-repo holding a main
pyproject.toml
(see sanitized version here) that mainly references a few sub-libraries of my own ; among them a certainsome_local_lib
. Each sub-lib has a dedicatedpyproject.toml
holding its own requirements. See a gist for the pyproject.toml ofsome_local_lib
here.As shown on the gist, the main
pyproject.toml
requiressome_local_lib
with a relative path and adevelop = true
tag:Finally, I have a few scripts in the project's directory that use
from some_local_lib import stuff
to work.When I want to init or reset my project, I just type
poetry install
in order to get every reqs in the virtualenv + making venv's Python aware of my localsome_local_lib
. Everything works fine so far and I can launch my scripts without trouble.Description of the problem
My problem occurs on VSCode (I don't know if this could happen elsewhere) when I use the "go to definition" (keyboard F12) feature of some symbol
some_symbol
imported fromsome_local_lib
throughfrom some_local_lib.stuff import symbol
. I expected this to open the symbol's definition from the pathroot_dir_of_project/lib/some_local_lib/stuff.py
. What actually happens is that it opens/Users/me/Library/Caches/pypoetry/virtualenvs/my_project_someHash-py3.11/lib/python3.11/site-packages/some_local_lib/stuff.py
.This is very annoying since I actively work on these sources and I would like Poetry/VSCode to open the working version of
stuff.py
, not the packaged and frozen version of it.Is it a bug or rather a misuse of the Poetry configuration ?
Thank you :)
The text was updated successfully, but these errors were encountered: