Skip to content
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

Relocate yanked warning into the legacy resolver #8125

Merged
merged 3 commits into from
May 5, 2020

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Apr 24, 2020

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 of PackageFinder.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.

@uranusjr uranusjr added skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code labels Apr 24, 2020
@uranusjr uranusjr force-pushed the yanked-link-warning-relocate branch 2 times, most recently from fb8fe58 to 5cb135b Compare April 24, 2020 11:02
@pradyunsg
Copy link
Member

You'd likely need to update tests too. :)

@uranusjr uranusjr force-pushed the yanked-link-warning-relocate branch 2 times, most recently from 2898142 to 6f1350b Compare April 24, 2020 19:37
@uranusjr uranusjr force-pushed the yanked-link-warning-relocate branch from 6f1350b to 367e661 Compare April 24, 2020 19:54
@uranusjr
Copy link
Member Author

I think this is really.

@pradyunsg
Copy link
Member

strongly resists urge to click the big tempting green button

@pradyunsg pradyunsg merged commit 09a5af5 into pypa:master May 5, 2020
@uranusjr uranusjr deleted the yanked-link-warning-relocate branch May 7, 2020 10:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants