Skip to content

Don't log looking-at-multiple-versions on the first rejected candidate - #14293

Open
MaxxxDong wants to merge 3 commits into
pypa:mainfrom
MaxxxDong:fix/12928-multiple-versions-message
Open

MaxxxDong wants to merge 3 commits into
pypa:mainfrom
MaxxxDong:fix/12928-multiple-versions-message

Conversation

@MaxxxDong

Copy link
Copy Markdown

What does this PR do?

Fixes #12928.

PipReporter currently logs "pip is looking at multiple versions of {package}" on the first rejected candidate. Installing a local wheel or a direct URL only has that one candidate, so the message is wrong — pip is not looking at other versions of the package.

Move that hint from reject-count 1 to 2. The later messages at 8 and 13 are unchanged.

Unit tests cover the first vs second rejection.

PR Checklist:

  • I agree to follow the PSF Code of Conduct.
  • I have read and have followed the CONTRIBUTING.md file.
  • I have added a news file fragment (or this PR does not need one).
  • I have read and followed the AI_POLICY.md file, and if any AI tools were used, I have disclosed it below.

Assisted-by: Grok

A single rejection is common when installing a local wheel or a direct
URL. The message is only accurate once a second candidate for that
package has been rejected.
The first looking-at-multiple-versions message now fires on the 2nd
rejection of a package. N=2 only rejects one candidate of A, so the
message must be absent there.

@notatallshaw notatallshaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm +1 on this, I don't think these messages are super useful, and the current first one does trigger unexpectedly, this will likely help.

Comment thread news/12928.bugfix.rst Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong info message shown for installation from URL

2 participants