Skip to content
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 add updates the version of the other dependencies #5185

Closed
2 of 3 tasks
zyrikby opened this issue Feb 11, 2022 · 6 comments · Fixed by #4618
Closed
2 of 3 tasks

poetry add updates the version of the other dependencies #5185

zyrikby opened this issue Feb 11, 2022 · 6 comments · Fixed by #4618
Labels
kind/bug Something isn't working as expected

Comments

@zyrikby
Copy link

zyrikby commented Feb 11, 2022

  • 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: 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.

@zyrikby zyrikby added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 11, 2022
@finswimmer
Copy link
Member

Hello @zyrikby,

updating existing dependency on a poetry add should 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

@finswimmer finswimmer added the status/waiting-on-response Waiting on response from author label Feb 11, 2022
@zyrikby
Copy link
Author

zyrikby commented 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:

$ poetry add pyhash
Using version ^0.9.3 for pyhash

Updating dependencies
Resolving dependencies... (1.3s)

Writing lock file

Package operations: 1 install, 1 update, 0 removals

• Updating datasketch (1.5.6 -> 1.5.7)
• Installing pyhash (0.9.3)

However, I updated poetry after to 1.1.13 version, this may be the explanation.

@quantus
Copy link

quantus commented Mar 1, 2022

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.

@radoering
Copy link
Member

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.

@quantus
Copy link

quantus commented Mar 2, 2022

I just tested and #4618 does solve the issue I'm seeing.

Copy link

github-actions bot commented 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
5 participants