Fix an infinite loop in the solver#6178
Merged
radoering merged 1 commit intopython-poetry:masterfrom Aug 17, 2022
Merged
Conversation
12108ce to
99e763e
Compare
radoering
approved these changes
Aug 17, 2022
| if (allow_similar or dependency.is_same_package_as(package)) and ( | ||
| dependency.constraint.allows(package.version) | ||
| or package.is_prerelease() | ||
| and dependency.constraint.allows(package.version.next_patch()) |
Member
There was a problem hiding this comment.
I stumbled over such a construct in #6165 (and removed it, too). I assume this was a workaround to deal with a previous shortcoming somewhere else that has been fixed in the meantime.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried bumping crashtest to 0.4.0 in poetry itself. This can't work because cleo requires a lower version than that, but instead of failure I hit an infinite loop.
Turned out there are two separate bugs here, both with the effect that version 1.0.0a5 of cleo is retried even after it has been ruled out because of this incompatibility
first, we go into
_get_locked()with a constraint that should explicitly rule out 1.0.0a5 ->1.0.0a5,<2.0.0- but because of the prerelease we decide that 1.0.0a5 is fine after all. So far as I can see the code that I've removed just doesn't want to be there: anyway removing it doesn't break any existing tests and helps this one...then we go into
search_for_installed_packages()again having started with a constraint that should rule out 1.0.0a5: but in here we pay no attention to that constraint at all. So we again rediscover the already ruled-out version. I've fixed this one by respecting the dependency in that function.