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

A better description for "Requires-Python" metadata field #1274

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

wimglenn
Copy link
Contributor

@wimglenn wimglenn commented Jul 12, 2023

The common usage of this field is for Dropping support for older Python versions. Adding upper bounds can be problematic.

The current description is misleading, and that was discussed extensively here, but unfortunately no PR came out of it. So here's an attempt!

I won't reproduce all of Henry's excellent arguments, but I will reiterate that the wording "is guaranteed to be compatible with" causes issues - today I've witnessed an environment failing to bootstrap when updated from Python 3.11.3 to Python 3.11.4 because one (internal) dependency had declared an upper bound on 3.11.3.

This was added because 3.11.3 was the runtime the developer's code was tested in, and if you were to take the current description literally, it's quite right that their distribution is not "guaranteed to be compatible with" 3.11.4 - how could you guarantee compatibility with an unreleased Python version? For someone unfamiliar with Python packaging, it is not obvious that such an upper bound would wreak havoc on the tooling and block an upgrade until a new release is published without over-constraining the Requires-Python metadata.

@wimglenn wimglenn force-pushed the Requires-Python branch 2 times, most recently from 9b81007 to c4d514d Compare September 7, 2023 00:29
…is should better demonstrate that usage of this field is more commonly about _excluding known incompatible versions_ than it is about specifying _guaranteed compatible versions_. Remove the multiple example code-block because it is not a (multiple use) field, and the other examples seem to exist only to show further usage of PEP 440 version specifiers (which are explained better elsewhere) rather than Requires-Python itself.
@pradyunsg pradyunsg enabled auto-merge November 5, 2023 15:02
@chrysle chrysle added this pull request to the merge queue Nov 8, 2023
Merged via the queue into pypa:main with commit 2b84f3e Nov 8, 2023
3 checks passed
@wimglenn wimglenn deleted the Requires-Python branch November 8, 2023 16:24
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.

8 participants