-
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
Fix dependency cache inconsistency with prerelease versions #7978
Merged
radoering
merged 2 commits into
python-poetry:master
from
chriskuehl:fix-dependency-cache-inconsistency-with-prerelease-versions
May 22, 2023
Merged
Fix dependency cache inconsistency with prerelease versions #7978
radoering
merged 2 commits into
python-poetry:master
from
chriskuehl:fix-dependency-cache-inconsistency-with-prerelease-versions
May 22, 2023
Conversation
This file contains 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
chriskuehl
commented
May 21, 2023
radoering
requested changes
May 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍 Just something about our (implicit) internal coding style considering tests.
chriskuehl
force-pushed
the
fix-dependency-cache-inconsistency-with-prerelease-versions
branch
from
May 21, 2023 19:30
4ac3bea
to
952af40
Compare
radoering
approved these changes
May 22, 2023
radoering
force-pushed
the
fix-dependency-cache-inconsistency-with-prerelease-versions
branch
from
May 22, 2023 04:33
952af40
to
6a189da
Compare
poetry-bot bot
pushed a commit
that referenced
this pull request
May 24, 2023
(cherry picked from commit fd70f7e)
radoering
pushed a commit
that referenced
this pull request
May 24, 2023
(cherry picked from commit fd70f7e)
Closed
3 tasks
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. |
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.
This PR fixes an inconsistency identified in #7950 (comment) where in some situations Poetry will not select a prerelease package version even though it satisfies all constraints.
Poetry is supposed to consider prerelease package versions if no other package versions satisfy the constraints. I believe this works if the constrained dependency is at the top level, but not necessarily if the constraint is introduced at a later level. Currently, whether it works or not depends on some arbitrary factors like the order dependencies are evaluated in and if the solver recently backtracked.
Regression test
I introduced a regression test which fails on
master
:The test passes if I disable the
DependencyCache
(replace the contents ofDependencyCache._search_for()
withreturn self.provider.search_for(dependency)
, and also passes with the patch provided in this PR.Additionally, the reproduction using
black<22
from #7950 (comment) also succeeds for me now.