-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[1.2.0b1][Win] symbolic link resolution breaks poetry.portability and tests #5425
Comments
This issue is causing me trouble in other ways too. This time, Test results:
Details of one test:
Update: tests run perfectly if the repo is in a "proper" folder (path doesn't include a symbolic link). |
Should have been solved in #5850. |
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. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Win 11 21H2
Poetry version: latest 1.2.0b1
Issue
If the path to a local source package contains a symbolic link, the symbolic link's path is be expanded when the location is stored in poetry.lock. This is problematic if the path contains machine- or user-specific elements, because the lock file won't be portable anymore.
This can occur very easily if the project folder is located under a symbolic link. For example, my projects are stored (on Google Drive) in C:\Users\username\Google Drive\code. For ease of access, I created a symbolic link to this folder, say, C:\code. So, all projects in C:\code are actually "under" a symbolic link, and all local source packages therein will be added to lock files with expanded source location that contains my username, e.g. instead of
url = "poetry"
, it'll haveurl = "../Users/username/code/poetry"
or something like that.minimal example
Code folder: C:\Users\Root\code
Symbolic link: C:\code (-> C:\Users\Root\code)
git clone poetry into C:\code
add local poetry
Resulting pyproject.toml
Resulting poetry.lock
The important part in poetry.lock is the section describing the source location of the poetry package:
The source location in the pyproject.toml file is simply
poetry = {path = "poetry"}
, but the location in poetry.lock isurl = "../Users/Root/code/poetry"
, in which the symbolic link is expanded.I don't see why it needs to be expanded.
Solution
Don't expand the symbolic link, store as:
This is what you get when you execute the same in a folder that's not under a symbolic link.
The text was updated successfully, but these errors were encountered: