Skip to content

Commit

Permalink
Change wording of Requires-Python and offer a lower bound example. Th…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
wimglenn committed Sep 7, 2023
1 parent 68115b5 commit c4d514d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions source/specifications/core-metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -551,18 +551,17 @@ Requires-Python
.. versionadded:: 1.2

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

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

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

Examples::
Requires-Python: >=3.6

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

.. _core-metadata-requires-external:

Expand Down

0 comments on commit c4d514d

Please sign in to comment.