-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poetry install and update resolve versions differently when requirements aren't pinned #2883
Comments
In general I don't think there's any guarantee that locking will give the same answer if you do it twice. If the latest versions of two packages - The promise that poetry makes is to find a solution where the packages are compatible with one another: not that it always finds the same solution. If you care more about So while I agree that this behaviour is slightly surprising, I don't think it's a bug. |
I would say it's a bug because the path that poetry takes through a search shouldn't be different for the same inputs. Either whatever is randomising that order needs to stop being random, or (better) the solution-evaluation rule needs to be extended in what is I guess a tie-break case. I'd also suggest that trivially, in a tie-break case, if one of the options is "What's already locked", then it should choose that one, using hysteresis to avoid flip-flopping. That would take care of all the existing bug reports about this behaviour, since none are "It's choosing wrong when this", they're all "It's choosing differently from what it chose 20 seconds ago". Then whatever randomness is being done now would stop actually being a problem except when one deletes the lockfile and relocks, in which case a different solution is less-surprising. That might actually be a simple change, since the flip-flopping around You could also define more rules for the tie-break cases, but I suspect no one will really care that much which one it's choosing, as long as it's consistent. |
It still isn't, though ;-) FWIW I can't reproduce this today even with old versions of poetry, presumably because the universe of packages that poetry has to choose from has changed in the mean time. If anyone cares about this enough to dig into it: one possibility that comes to mind is the code in But IMO this remains at worst "slightly surprising" and not worth bothering about. |
There's a reproducible example in #6470, as of today at least. |
From #6470:
For those who are interested:
I drafted #6477 to make |
duplicate #3779 can also be closed |
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. |
-vvv
option).Issue
Using the pyproject.toml I can run
poetry install
(log) and get the latestdbt
installed (at the time that's 0.17.2), but then when I runpoetry update
(log) it downgradesdbt
and updatesrequests
.The workaround for this is to pin dbt to
dbt = "^0.17.2"
, however I was surprised to see poetry just downgrade.The text was updated successfully, but these errors were encountered: