From 174b29bc691149f80894de377472ea9688db430f Mon Sep 17 00:00:00 2001 From: wim glenn Date: Wed, 6 Sep 2023 19:29:45 -0500 Subject: [PATCH 1/2] 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. --- source/specifications/core-metadata.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/specifications/core-metadata.rst b/source/specifications/core-metadata.rst index 0c4f4b490..5749e618e 100644 --- a/source/specifications/core-metadata.rst +++ b/source/specifications/core-metadata.rst @@ -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 `_ +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: From e604f4360bea19bd5f6025ecee44450d23113b1a Mon Sep 17 00:00:00 2001 From: wim glenn Date: Sat, 7 Oct 2023 13:58:02 -0500 Subject: [PATCH 2/2] review suggestions --- source/specifications/core-metadata.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/specifications/core-metadata.rst b/source/specifications/core-metadata.rst index 5749e618e..cccd611e0 100644 --- a/source/specifications/core-metadata.rst +++ b/source/specifications/core-metadata.rst @@ -556,8 +556,8 @@ picking which version of a project to install. The value must be in the format specified in :doc:`version-specifiers`. -For example, if a distribution uses `f-strings `_ -then it may prevent installation on Python < 3.6 by specifying: +For example, if a distribution uses :ref:`f-strings ` +then it may prevent installation on Python < 3.6 by specifying:: Requires-Python: >=3.6