Requires-Python upper limits

I plan to write a pre-PEP in the next couple of months that formalizes the semantics of Requires-Python, based on the discussion in https://discuss.python.org/t/requires-python-and-pre-release-python-versions/62959

It will specify the semantics as only being the language version part of the version string, i.e. 3.10, 3.11, so not something like 3.11.1, and that the only valid operators as “>”, “>=”, and “!=”, and that tools should warn users when they find requires Python strings that don’t match this, and may throw an error (I’m thinking specifically of tools that build source trees).

We’ll see if it achieves consensus and is accepted.

12 Likes