Skip to content

Requires-Python error message should not sort versions numerically, not alphabetically #13367

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
thomasaarholt opened this issue Apr 30, 2025 · 2 comments
Open
1 task done
Labels
good first issue A good item for first time contributors to work on state: awaiting PR Feature discussed, PR is needed type: enhancement Improvements to functionality

Comments

@thomasaarholt
Copy link

thomasaarholt commented Apr 30, 2025

Description

In the following example, it looks to the human eye like all python versions >= 3.9 are supported by the package. However, since the versions are sorted alphabetically, 3.13 is placed between 3.1 and 3.2.

It would be a nicer user experience if 3.13 was placed at the end, after 3.9. It tricked me, at least.

ERROR: Ignored the following versions that require a different python version: <truncated to make it clearer> 1.17.2 
Requires-Python !=2.7.*,!=3.0.*,!=3.1.*,!=3.13.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9
#                                       ^^^^^^^^ 3.13 listed here!

If the disallowed versions were colored in red and the allowed version in green, that would make it even more obvious.

Expected behavior

Requires-Python !=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9,!=3.13.*

pip version

25.1

Python version

3.13

OS

Windows and Ubuntu

How to Reproduce

This reproduces at least on Windows and Ubuntu, haven't checked Mac.

uv venv --python 3.13
# activate the way you would
uv pip install pip==25.1 # explicitly showing on 25.1
pip install promptflow-devkit==1.17.2

Output

ERROR: Ignored the following versions that require a different python version: 1.16.2 Requires-Python !=2.7.*,!=3.0.*,!=3.1.*,!=3.13.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8; 1.17.0 Requires-Python !=2.7.*,!=3.0.*,!=3.1.*,!=3.13.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9; 1.17.1 Requires-Python !=2.7.*,!=3.0.*,!=3.1.*,!=3.13.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9; 1.17.2 Requires-Python !=2.7.*,!=3.0.*,!=3.1.*,!=3.13.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=3.9
ERROR: Could not find a version that satisfies the requirement promptflow-devkit==1.17.2 (from versions: 0.1.0b1, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.14.0, 1.15.0, 1.15.0.post1, 1.15.1, 1.16.0, 1.16.1)
ERROR: No matching distribution found for promptflow-devkit==1.17.2

Code of Conduct

@thomasaarholt thomasaarholt added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 30, 2025
@thomasaarholt thomasaarholt changed the title Requires-Python should not sort versions alphabetically Requires-Python error message should not sort versions numerically, not alphabetically Apr 30, 2025
@notatallshaw notatallshaw added type: enhancement Improvements to functionality state: awaiting PR Feature discussed, PR is needed and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Apr 30, 2025
@notatallshaw
Copy link
Member

This seems reasonable to me.

Pip is a volunteer project and therefore someone would need to submit a PR of reasonable quality.

@uranusjr
Copy link
Member

uranusjr commented May 7, 2025

The list of versions is generated here

def requires_python_skipped_reasons(self) -> list[str]:
reasons = {
detail
for _, result, detail in self._logged_links
if result == LinkType.requires_python_mismatch
}
return sorted(reasons)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good item for first time contributors to work on state: awaiting PR Feature discussed, PR is needed type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

3 participants