-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Issue Kind
Change in current behaviour
Description
When a lock file is outdated, the provided suggestion is to run poetry lock. The same suggestion applies for poetry self subcommands - ex poetry self sync:
"pyproject.toml changed significantly since poetry.lock was last generated. Run poetry lock to fix the lock file"
For poetry self subcommands however, the fix would be poetry self lock:
poetry lockreferencespyproject.tomlfrom the current project/directory.poetry self lockreferencespyproject.tomlfrom the Poetry installation directory:- macOS -
~/Library/Application\ Support/pypoetry - Linux -
~/.config/pypoetry - Windows -
%APPDATA%\pypoetry
- macOS -
Assuming the user is likely to be in a different directory, they might see "Poetry could not find a pyproject.toml file" or a lock file from an unrelated project gets updated. poetry lock updates the expected lock file in this case only if you're in the Poetry installation directory - it does also create a virtualenv and I'm not sure if this may present other unintended consequences.
Proposal
- An outdated lock file from a regular command continues to suggest
poetry lock - An outdated lock file from a
poetry selfsubcommand suggestspoetry self lock
I did not find an existing issue on this, apologies in advance if I missed a duplicate issue!
Impact
Could reduce potential confusion/errors for the user
Workarounds
- Running
poetry self lock - Running
poetry lockas suggested, but specifically in the Poetry installation configuration directory- macOS -
~/Library/Application\ Support/pypoetry - Linux -
~/.config/pypoetry - Windows -
%APPDATA%\pypoetry
- macOS -