You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
poetry add updates the version of the other dependencies #5185
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: Kubuntu 20.04 Poetry version: 1.1.12
Issue
Hi there! First of all, thank you very much for this tool!
Recently, I have found out a weird behavior to me. However, maybe it poetry works as expected, so please then explain this behavior to me.
The issue is the following. When you add a new dependency to a project using the poetry add command, poetry also updates the versions of other libraries if the updates are available despite that the previous version is recorded in the poetry.lock file. Such behavior to me is unexpected and may lead to bugs in the developed application.
I can reproduce this issue locally on both poetry add and poetry update commands. In my case it's always the coverage dependency that is being updated unexpectedly and after doing a bit more searching I found an existing issue #4612 which looks really similar to my situation. So something similar might have been happening here.
If your issue looks similar to #4612, you may want to check if #4618 solves your issue. If it does not solve your issue, please provide the state of pyproject.toml and poetry.lock before running poetry add or poetry update and give the exact command you run to trigger the issue.
Activity
finswimmer commentedon Feb 11, 2022
Hello @zyrikby,
updating existing dependency on a
poetry addshould only happen if the new dependency (or one of its dependencies) require newer versions.If you think that is not the case in your case, please provide a minimal reproducible example, so we can debug it.
fin swimmer
zyrikby commentedon Feb 11, 2022
Interesting, I cannot now reproduce this behavior with minimum working version. However, here is the output that I've experienced in the morning:
However, I updated poetry after to 1.1.13 version, this may be the explanation.
quantus commentedon Mar 1, 2022
I can reproduce this issue locally on both
poetry addandpoetry updatecommands. In my case it's always thecoveragedependency that is being updated unexpectedly and after doing a bit more searching I found an existing issue #4612 which looks really similar to my situation. So something similar might have been happening here.radoering commentedon Mar 1, 2022
If your issue looks similar to #4612, you may want to check if #4618 solves your issue. If it does not solve your issue, please provide the state of
pyproject.tomlandpoetry.lockbefore runningpoetry addorpoetry updateand give the exact command you run to trigger the issue.quantus commentedon Mar 2, 2022
I just tested and #4618 does solve the issue I'm seeing.
github-actions commentedon Mar 2, 2024
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.