Open slingshotvfx opened 10 months ago
are you telling us that z:\app
and \\server\app
are equivalent?
if so this definitely seems like a pylance problem.
code is here if you want to propose a change.
But I dont see how you can expect to fix this in poetry without "breaking" it for the next person who has things the other way round: if they already have \\server\app
in their path then what you want to do will just put them in the same spot that you are now in.
Advise that if pylance has a problem that makes it go super slowly then this is better reported to pylance.
Yes, in this example \\server is mapped to z:\ (actually should be \\server\share mapped to z:\, fixed in my original post)
Pylance issues aside, I think Poetry should at least generate paths consistently for mapped network drives.
uses Path.resolve() which resolves to a UNC path in windows (//server/share), while:
uses Path.absolute() which maintains the mapped drive letter (z:\).
from pathlib import Path
print("resolve:", Path(__file__).resolve().as_posix())
print("absolute:", Path(__file__).absolute().as_uri())
resolve: //server/storage/dev/paths.py
absolute: file:///Z:/dev/paths.py
I think ideally poetry would use .absolute() in both places, although I'm not familiar with the code to know if that would effect anything else.
feel free to submit a merge request, imo this is unimportant but if you can make the case that it matters then go for it!
-vvv
option) and have included the output below.Issue
possibly related to https://github.com/python-poetry/poetry/issues/4327 https://github.com/python-poetry/poetry/issues/959
I have a poetry project on a mapped network drive (z:) in Windows. When I run
poetry install
, the.venv\Lib\site-packages\app.pth
file that is created uses the UNC path instead of the drive path:But it should be:
This specifically caused problems for me because both the UNC path and the Z:\ path ended up in
sys.path
in my virtualenv:This slowed Pylance to a crawl in VS Code. Might be a bug in Pylance but it basically made it re-index my project continually, as it presumably tried to reconcile duplicate search paths.
Manually changing the
app.pth
path to use Z:\ and restarting VS Code fixed all issues.Curiously,
direct_url.json
appears to use the correct path: