Relocate yanked warning into the legacy resolver #8125
Merged
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 is the first (easy) half toward fixing #8123. We know from the linked issue that we should log the message when we are sure the candidate will be installed, but before resolving the wheel cache. In th legacy resolver, this means sticking the warning inside
_populate_link()
, after the (remote) link is found, but before it got resolved against the wheel cache.But the mesage needs to access not only the link found, but also why link is found (i.e. the
InstallationCandidate
that points to it), which is not available at the call site ofPackageFinder.find_requirement()
.So the PR contains two parts (reflected by the two commits). The first part makes
PackageFinder.find_requirement()
to return the best candidate instead, and introduced a wrapper in the legacy resolver to get the link. The second moves the yanked warning into the wrapper function in the legacy resolver, which is called before the link is pinned for installation later, but before it got replaced by the cache entry.With the relocation done, what’s left is to implement the warning in the new resolver. Which is the difficult part, as described in the linked issue.