Skip to content

Packages skipped by requires-python no longer show up in error message by default #13260

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

Open
1 task done
dpad opened this issue Mar 4, 2025 · 1 comment
Open
1 task done
Assignees
Labels
type: bug A confirmed bug or unintended behavior

Comments

@dpad
Copy link

dpad commented Mar 4, 2025

Description

This is only a minor issue, but when trying to install a package with a requires-python that you don't meet, the error message no longer provides useful information about the Python version being incompatible.

For example, trying to pip install "ipython>9" while using Python 3.10 will result in an error, but the error message won't mention anything about a Python version incompatibility. As a user, this is confusing because ipython 9 definitely exists on PyPi, but it doesn't show up anywhere in the error message. In pip<25, the error message would explicitly state that version 9 was skipped due to a Python version incompatibility.

The cause seems to be due to the addition of the if not logger.isEnabledFor(logging.DEBUG) in _log_skipped_link() in #13128 . This change means that skipped links are not stored, so requires_python_skipped_reasons() returns nothing.

A work around is to use pip install -v or pip install -vv to see information about the Python requires incompatibilities.

Expected behavior

In pip-24.3.1, the error message includes a line as follows:

ERROR: Ignored the following versions that require a different python version: 9.0.0 Requires-Python >=3.11; 9.0.0b1 Requires-Python >=3.11; 9.0.0b2 Requires-Python >=3.11; 9.0.1 Requires-Python >=3.11

pip version

25.0.1

Python version

3.10.12

OS

Linux

How to Reproduce

  1. Try to install a package with a requires-python that you don't meet
  2. (e.g. pip install "ipython>9" when using Python 3.10)
  3. Error message does not mention the version incompatibility.

Output

On pip 25.0.0 and 25.0.1:

$ pip install "ipython>9"

ERROR: Ignored the following yanked versions: 7.1.0, 7.30.0, 8.13.0, 8.16.0, 8.17.0, 8.19.0, 8.22.0
ERROR: Could not find a version that satisfies the requirement ipython>9 (from versions: 0.10, 0.10.1, 0.10.2, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.13.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.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, 8.33.0)
ERROR: No matching distribution found for ipython>9

On pip 24.3.1:

$ pip install "ipython>9"

ERROR: Ignored the following yanked versions: 7.1.0, 7.30.0, 8.13.0, 8.16.0, 8.17.0, 8.19.0, 8.22.0
ERROR: Ignored the following versions that require a different python version: 9.0.0 Requires-Python >=3.11; 9.0.0b1 Requires-Python >=3.11; 9.0.0b2 Requires-Python >=3.11; 9.0.1 Requires-Python >=3.11
ERROR: Could not find a version that satisfies the requirement ipython>9 (from versions: 0.10, 0.10.1, 0.10.2, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.13.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 4.0.0b1, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.1.0rc1, 4.1.0rc2, 4.1.0, 4.1.1, 4.1.2, 4.2.0, 4.2.1, 5.0.0b1, 5.0.0b2, 5.0.0b3, 5.0.0b4, 5.0.0rc1, 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.2.2, 5.3.0, 5.4.0, 5.4.1, 5.5.0, 5.6.0, 5.7.0, 5.8.0, 5.9.0, 5.10.0, 6.0.0rc1, 6.0.0, 6.1.0, 6.2.0, 6.2.1, 6.3.0, 6.3.1, 6.4.0, 6.5.0, 7.0.0b1, 7.0.0rc1, 7.0.0, 7.0.1, 7.1.1, 7.2.0, 7.3.0, 7.4.0, 7.5.0, 7.6.0, 7.6.1, 7.7.0, 7.8.0, 7.9.0, 7.10.0, 7.10.1, 7.10.2, 7.11.0, 7.11.1, 7.12.0, 7.13.0, 7.14.0, 7.15.0, 7.16.0, 7.16.1, 7.16.2, 7.16.3, 7.17.0, 7.18.0, 7.18.1, 7.19.0, 7.20.0, 7.21.0, 7.22.0, 7.23.0, 7.23.1, 7.24.0, 7.24.1, 7.25.0, 7.26.0, 7.27.0, 7.28.0, 7.29.0, 7.30.1, 7.31.0, 7.31.1, 7.32.0, 7.33.0, 7.34.0, 8.0.0a1, 8.0.0b1, 8.0.0rc1, 8.0.0, 8.0.1, 8.1.0, 8.1.1, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0, 8.10.0, 8.11.0, 8.12.0, 8.12.1, 8.12.2, 8.12.3, 8.13.1, 8.13.2, 8.14.0, 8.15.0, 8.16.1, 8.17.1, 8.17.2, 8.18.0, 8.18.1, 8.20.0, 8.21.0, 8.22.1, 8.22.2, 8.23.0, 8.24.0, 8.25.0, 8.26.0, 8.27.0, 8.28.0, 8.29.0, 8.30.0, 8.31.0, 8.32.0, 8.33.0)

Code of Conduct

@dpad dpad added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 4, 2025
@ichard26
Copy link
Member

ichard26 commented Mar 4, 2025

The performance uplift was very minor in the first place (0.7% on a cached homeassistant run) so I'm in favour of simply reverting the early exit. I'll file a PR in the next few days when I have time to write a test (unless someone beats me to it).

Thanks for the detailed bug report @dpad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants