Skip to content

Commit 174b29b

Browse files
committed
Change wording of Requires-Python and offer a lower bound example. This 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.
1 parent 944431d commit 174b29b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

source/specifications/core-metadata.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -551,18 +551,17 @@ Requires-Python
551551
.. versionadded:: 1.2
552552

553553
This field specifies the Python version(s) that the distribution is
554-
guaranteed to be compatible with. Installation tools may look at this when
554+
compatible with. Installation tools may look at this when
555555
picking which version of a project to install.
556556

557557
The value must be in the format specified in :doc:`version-specifiers`.
558558

559-
This field cannot be followed by an environment marker.
559+
For example, if a distribution uses `f-strings <https://docs.python.org/3/whatsnew/3.6.html#pep-498-formatted-string-literals>`_
560+
then it may prevent installation on Python < 3.6 by specifying:
560561

561-
Examples::
562+
Requires-Python: >=3.6
562563

563-
Requires-Python: >=3
564-
Requires-Python: >2.6,!=3.0.*,!=3.1.*
565-
Requires-Python: ~=2.6
564+
This field cannot be followed by an environment marker.
566565

567566
.. _core-metadata-requires-external:
568567

0 commit comments

Comments
 (0)