Skip to content

poetry add updates the version of the other dependencies #5185

Closed

Description

@zyrikby
  • 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.

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Feb 11, 2022
  2. finswimmer commented on Feb 11, 2022

    @finswimmer
    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

  3. zyrikby commented on Feb 11, 2022

    @zyrikby
    Author

    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.

  4. quantus commented on Mar 1, 2022

    @quantus

    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.

  5. radoering commented on Mar 1, 2022

    @radoering
    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.

  6. quantus commented on Mar 2, 2022

    @quantus

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

  7. github-actions commented on Mar 2, 2024

    @github-actions

    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.

  8. locked as resolved and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions