Replies: 1 comment
-
Poetry just chooses the first solution it can find. Thus, it all depends on which package is resolved first. #8256 might be of interest to you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got curious about poetry's dependency solver and what it actually tries to achieve. Obviously we all want the latest of everything the requirements want and will allow, but if there is more than one solution to chose from, what huristics does the solver use to differentiate between them to chose the "best" one.
As a simple demonstration of why I believe such heuristics might exists in the solver:
Imagine three packages (
A
,B
,C
) and they each have versions1.0
and1.1
.C = "^1.0"
C = "<=1.0"
Then a project requirements with requirements:
This would leave two "best" solutions. One that held back C to allow a higher version of B and the other that held back B to allow a higher version of C.
The above isn't the only possible scenario. I'm interested in any such scenarios. Where poetry must chose some packages to hold back in favour of others, how does it chose?
Beta Was this translation helpful? Give feedback.
All reactions