-
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
Clarify that poetry update only updates main dependencies #9857
base: main
Are you sure you want to change the base?
Conversation
Add a note that `--with` is required to have `poetry update` also update optional dependency groups.
eg your first change is definitely wrong, the lockfile will be updated even for dependencies in optional groups I think what has surprised you is that |
The poetry file is updated, just not the installed packages
You are right, the lock file is indeed updated, but the optional dependencies that are installed are not updated; clarified that. The behavior is rather confusing (to me at least), so it is good to be as explicit as possible. |
docs/cli.md
Outdated
@@ -310,6 +311,11 @@ You can do this using the `add` command. | |||
When `--only` is specified, `--with` and `--without` options are ignored. | |||
{{% /note %}} | |||
|
|||
{{% note %}} | |||
`poetry update` without any options will only update the main dependencies of the project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pedantically not correct - non-optional dependency groups are also updated, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is probably right than non-optional dependency groups are also updated, although I have not tested this; updated, thanks.
Clarify that it is the non-optional dependencies that are updated
I was wondering whether the update behavior can leave the user with a broken state, and that seems indeed possible. E.g. see this example project https://github.com/hugobuddel/poetrytest Maybe we should add a warning that the user can be left with an inconsistent environment if |
Add a note that
--with
is required to letpoetry update
also update optional dependency groups.This behavior of
poetry update
confused me, so I thought let's try to save other people the trouble by updating the documentation.I do want to note that I find the behavior strange. If I do
poetry install --with=dev
followed bypoetry update
, then I expect all installed dependencies to be updated, also the dev ones.Pull Request Check List
Resolves: #issue-number-here