`poetry update` with git-based dependencies updates `poetry.lock` but not the virtual environment
See original GitHub issue- 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).
- OS version and name: MacOS Catalina 10.15.6
- Poetry version: 1.1.0b2
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/jeffcasavant/7454acfce0933e2f4758a35699e890aa
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 thereference
field in thepackage.source
block with theurl
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:56
- Comments:36 (6 by maintainers)
Top Results From Across the Web
Basic usage | Documentation | Poetry - Python dependency ...
When Poetry has finished installing, it writes all the packages and their exact versions that it downloaded to the poetry.lock file, locking the...
Read more >Dependency Management With Python Poetry
Work With Python Poetry. Use Poetry's Virtual Environment; Declare Your Dependencies; Install a Package With Poetry. Handle poetry.lock.
Read more >Python Virtual Environments tutorial using Virtualenv and Poetry
This blog post is mostly aimed at people who didn't work with it. Here you will find that this is not a complete...
Read more >Poetry pyproject.toml not updating after running 'poetry add ...
I solved this by deleting all the poetry envs in my .cache/virtualenvs folder, and then running poetry install from within my project again, ......
Read more >Configure a Poetry environment | PyCharm Documentation
Poetry is a tool that facilitates creating a Python virtual environment based on the project dependencies. You can declare the libraries your project ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I am still dealing with the same issue. Is there anything we can do to have this escalated/reopened? Maybe @sdispater or @abn ?
The workaround that I used was to comment out the package line in the
pyproject.toml
file, runpoetry install
, then uncomment it back and runpoetry install
again.