From f7891eb22c50db1ae39d259ab0851f3486cbaaba Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 3 Sep 2024 09:45:08 -0400 Subject: [PATCH 1/3] add documentation for PEP 639, License-Expression and License-Field --- source/specifications/core-metadata.rst | 53 ++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/source/specifications/core-metadata.rst b/source/specifications/core-metadata.rst index fb6570fbb..66218b178 100644 --- a/source/specifications/core-metadata.rst +++ b/source/specifications/core-metadata.rst @@ -48,7 +48,7 @@ Metadata-Version .. versionadded:: 1.0 Version of the file format; legal values are "1.0", "1.1", "1.2", "2.1", -"2.2", and "2.3". +"2.2", "2.3", and "2.4". Automated tools consuming metadata SHOULD warn if ``metadata_version`` is greater than the highest version they support, and MUST fail if @@ -63,7 +63,7 @@ all of the needed fields. Example:: - Metadata-Version: 2.3 + Metadata-Version: 2.4 .. _core-metadata-name: @@ -477,6 +477,50 @@ Examples:: License: GPL version 3, excluding DRM provisions +.. _license-expression-optional: +.. _core-metadata-license-expression: + +License-Expression +================== + +.. versionadded:: 2.4 + +Text string that is a valid SPDX +`license expression `__ +as `defined in PEP 639 `__. + +Examples:: + + License-Expression: MIT + License-Expression: BSD-3-Clause + License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause) + License-Expression: MIT OR GPL-2.0-or-later OR (FSFUL AND BSD-2-Clause) + License-Expression: GPL-3.0-only WITH Classpath-Exception-2.0 OR BSD-3-Clause + License-Expression: LicenseRef-Special-License OR CC0-1.0 OR Unlicense + License-Expression: LicenseRef-Proprietary + + +.. _license-file-optional: +.. _core-metadata-license-file: + +License-File (multiple use) +=========================== + +.. versionadded:: 2.4 + +Each entry is a string representation of the path of a license-related file. +The path is located within the project source tree, relative to the project +root directory. + +Examples:: + + License-File: LICENSE + License-File: AUTHORS + License-File: LICENSE.txt + License-File: licenses/LICENSE.MIT + License-File: licenses/LICENSE.CC0 + + .. _metadata-classifier: .. _core-metadata-classifier: @@ -864,6 +908,11 @@ History - Restricted extra names to be normalized. +- August 2024: Core metadata 2.4 was approved through :pep:`639`. + + - Added the ``License-Expression`` field. + - Added the ``License-File`` field. + ---- .. [1] reStructuredText markup: From a222c4a83b8f13f79f1e709772f1db447cad250d Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Sun, 15 Sep 2024 20:52:26 -0400 Subject: [PATCH 2/3] document deprecations and conflicts --- source/specifications/core-metadata.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/specifications/core-metadata.rst b/source/specifications/core-metadata.rst index 66218b178..97686c543 100644 --- a/source/specifications/core-metadata.rst +++ b/source/specifications/core-metadata.rst @@ -460,6 +460,14 @@ License ======= .. versionadded:: 1.0 +.. deprecated:: 2.4 + in favour of ``License-Expression``. + +.. warning:: + As of Metadata 2.4, ``License`` and ``License-Expression`` are mutually + exclusive. If both are specified, tools which parse metadata will disregard + ``License`` and PyPI will reject uploads. + See `PEP 639 `__. Text indicating the license covering the distribution where the license is not a selection from the "License" Trove classifiers. See @@ -510,7 +518,7 @@ License-File (multiple use) Each entry is a string representation of the path of a license-related file. The path is located within the project source tree, relative to the project -root directory. +root directory. For details see :pep:`639`. Examples:: @@ -534,6 +542,11 @@ for the distribution. Classifiers are described in :pep:`301`, and the Python Package Index publishes a dynamic list of `currently defined classifiers `__. +.. note:: + The use of ``License ::`` classifiers is deprecated as of Metadata 2.4, + use ``License-Expression`` instead. See + `PEP 639 `_. + This field may be followed by an environment marker after a semicolon. Examples:: From 30450630fc30a76c03a4ef9bba4d86911a846170 Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Thu, 19 Sep 2024 08:48:07 -0400 Subject: [PATCH 3/3] fix broken link --- source/specifications/platform-compatibility-tags.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/specifications/platform-compatibility-tags.rst b/source/specifications/platform-compatibility-tags.rst index 740a28a1a..3679cf4ad 100644 --- a/source/specifications/platform-compatibility-tags.rst +++ b/source/specifications/platform-compatibility-tags.rst @@ -343,5 +343,5 @@ History .. _musl: https://musl.libc.org -.. _ldd: https://www.unix.com/man-page/posix/1/ldd/ +.. _ldd: https://www.man7.org/linux/man-pages/man1/ldd.1.html .. _elf: https://refspecs.linuxfoundation.org/elf/elf.pdf