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.

Poetry install and update resolve versions differently when requirements aren't pinned

See original GitHub issue
  • 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).

Issue

Using the pyproject.toml I can run poetry install (log) and get the latest dbt installed (at the time that’s 0.17.2), but then when I run poetry update (log) it downgrades dbt and updates requests.

The workaround for this is to pin dbt to dbt = "^0.17.2", however I was surprised to see poetry just downgrade.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
radoeringcommented, Sep 11, 2022

From #6470:

I would expect the code paths to be equivalent and poetry update to basically be a fancy poetry lock && poetry install, though I acknowledge that’s probably naive.

For those who are interested:

poetry lock ignores an existing lock file and creates a new lock file from scratch. poetry update takes a whitelist of packages to update. That’s why it’s more like a poetry lock --no-update except for the whitelisted packages. It considers an existing lock file and tries not to update packages that are not on the whitelist. If you don’t pass any names to poetry update all locked packages are on the whitelist, but the lockfile is still taken into consideration which can result in a different resolution order.

I drafted #6477 to make poetry update more determistic and similar to poetry lock.

1reaction
JacobHayescommented, Sep 10, 2022

There’s a reproducible example in https://github.com/python-poetry/poetry/issues/6470, as of today at least.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency specification | Documentation | Poetry - Python ...
If other dependencies require a different version, the solver will ultimately fail and abort any install or update procedures.
Read more >
Dependency Management With Python Poetry
When you run the poetry add command, Poetry automatically updates pyproject.toml and pins the resolved versions in the poetry.lock file. However ...
Read more >
The Nine Circles of Python Dependency Hell - Medium
To fix this problem, use a constraints file to specify the version range that will satisfy both dependencies.2,3 Requirements.txt and constraints files allow ......
Read more >
Which Python Dependency Manager Should I Choose?
Pinning a package to a specific version can become a management nightmare. For example, you may end up with two packages in your...
Read more >
Third-party dependencies - Pants build
python_requirement target for transitive dependencies, i.e. requirements that you do not ... If you incorrectly add a target from a different resolve to...
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