question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Re-running `poetry install` "updates" packages to already existing versions

See original GitHub issue

Issue

When NOT using a virtual environment (POETRY_VIRTUALENVS_CREATE=false) and running poetry install multiple times, already installed packages will be “updated” to the already installed versions. This does not happen with poetry-1.0.9 (change line 29 in provided Dockerfile to confirm).

Running docker build .with the provided files causes:

First run (line 33 in Dockerfile):

Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file

Package operations: 5 installs, 0 updates, 0 removals

  • Installing six (1.15.0)
  • Installing numpy (1.19.2)
  • Installing python-dateutil (2.8.1)
  • Installing pytz (2020.1)
  • Installing pandas (1.1.3)

Second run (line 42 in Dockerfile):

Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file

Package operations: 0 installs, 5 updates, 0 removals

  • Updating six (1.15.0 /home/user/.local/lib/python3.8/site-packages -> 1.15.0)
  • Updating numpy (1.19.2 /home/user/.local/lib/python3.8/site-packages -> 1.19.2)
  • Updating python-dateutil (2.8.1 /home/user/.local/lib/python3.8/site-packages -> 2.8.1)
  • Updating pytz (2020.1 /home/user/.local/lib/python3.8/site-packages -> 2020.1)
  • Updating pandas (1.1.3 /home/user/.local/lib/python3.8/site-packages -> 1.1.3)

PS: The reason for doing this is to make docker cache the project dependencies. So when I change my own code, only my own package will be installed, the project dependencies are cached.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jacek-jablonskicommented, Nov 26, 2020

Same problem here. Seems that using POETRY_VIRTUALENVS_CREATE=false causes reinstallation of all packages to the current versions.

1reaction
mattmm1commented, Mar 18, 2022

Any updates on this? Is this the way it should be behaving without POETRY_VIRTUALENVS_CREATE? Can confirm same behaviour as outlined above in poetry 1.1.12 and python 3.9.9.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update Packages in Python Poetry - YippeeCode
First step is to find out what packages are currently installed in your system. Then, find the ones that are outdated. You can...
Read more >
Commands | Documentation | Poetry - Python dependency ...
This will resolve all dependencies of the project and write the exact versions into poetry.lock . If you just want to update a...
Read more >
Dependency Management With Python Poetry
When your Python project relies on external packages, you need to make sure you're using the right version of each package. After an...
Read more >
Change python version to 3.x - Stack Overflow
How can I update this to 3.7? Simply changing python = "^2.7" to python = "^3.7" results in the following error when poetry...
Read more >
Configure a Poetry environment that runs in PyCharm
For PyCharm Versions >=2021.3, Poetry is already integrated without a manual ... (9.7s)Writing lock filePackage operations: 18 installs, 0 updates, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found