-
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
poetry.lock at ~/.config/pypoetry incorrect when installing local plugin via wheel due to symbolic links #5849
Comments
Found out the root cause: If the home directory is a symlink itself, https://github.com/python-poetry/poetry/blob/master/src/poetry/packages/locker.py#L604-L608 is not converting the lock path to the real physical path so the relative path may be incorrect. An option would be to convert the lock path into the real physical path, before resolving the relative path |
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. |
-vvv
option).Issue
While investigating #5440, I found out that if I tried to install a plugin using a path that contained a symlink e.g.
poetry self add /mysymlink/workspace/myuser/myproject/dist/myproject-1.0.0-py3-none-any.whl
where mysymlink resolves to say
home/myuser
, poetry would fail to install the plugin saying FileNotFound.If I had instead used the real physical path using
pwd -P
, so I'd dopoetry self add /home/myuser/workspace/myuser/myproject/dist/myproject-1.0.0-py3-none-any.whl
it works just fine.
The problem is, if I originally used the symlink which caused the plugin install via a local wheel file to fail, the second option using the real physical path would also fail afterwards. Even if I had used the real physical path initially, if I remake a new virtualenv and try again, it also fails. After some digging, I found out when poetry tries to get the locked_repository here: https://github.com/python-poetry/poetry/blob/master/src/poetry/packages/locker.py#L454, it's reading from poetry.lock/pyproject.toml in
~/.config/pypoetry
.The
~/.config/pypoetry/poetry.lock
has an incorrect relative path to the local wheel file:If I try to reinstall the plugin, it says the file is not found:
It looks like it is missing an extra "../".
So far the only way I found to workaround this is to delete
~/.config/pypoetry
every time I want to install the local plugin, but then this means I have to reconfigure poetry every time.The text was updated successfully, but these errors were encountered: