Skip to content

poetry update with git-based dependencies updates poetry.lock but not the virtual environment #2921

@jeffcasavant

Description

@jeffcasavant
  • I am on the latest beta 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).

Issue

I have a git dependency that is defined with a branch instead of a specific commit or revision. As a result, the commit that the reference points to can change.

poetry update successfully updates the poetry.lock file with the correct latest commit, but the library in the virtual environment remains checked-out at the commit that was latest when poetry install was last run.

Replication

  • Add a git-based dependency to a poetry project.
  • poetry install
  • Note the commit hash that was installed (e.g. inside poetry shell, cd $VIRTUAL_ENV/src/<git dependency name> && git log | head -1)
  • Note the commit hash that was set in poetry.lock (cat poetry.lock | grep -i <git dependency name> -B 2 | grep -i reference worked for me, but obviously YMMV; you're looking for the reference field in the package.source block with the url equal to the git repository you installed from)
  • Push another commit to the git-based dependency.
  • poetry update <git dependency name>
  • Note that the reference in poetry.lock has changed
  • Note that the checked-out commit in src has not changed

I expected that since poetry.lock was updated that my virtualenv was updated as well.

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