Skip to content

Commit 48ad6bf

Browse files
authored
Merge pull request #1595 from ewdurbin/pep_639
PEP 639: Add documentation for Metadata 2.4, License-Expression and License-Field
2 parents 958adec + 3045063 commit 48ad6bf

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

source/specifications/core-metadata.rst

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Metadata-Version
4848
.. versionadded:: 1.0
4949

5050
Version of the file format; legal values are "1.0", "1.1", "1.2", "2.1",
51-
"2.2", and "2.3".
51+
"2.2", "2.3", and "2.4".
5252

5353
Automated tools consuming metadata SHOULD warn if ``metadata_version`` is
5454
greater than the highest version they support, and MUST fail if
@@ -63,7 +63,7 @@ all of the needed fields.
6363

6464
Example::
6565

66-
Metadata-Version: 2.3
66+
Metadata-Version: 2.4
6767

6868

6969
.. _core-metadata-name:
@@ -460,6 +460,14 @@ License
460460
=======
461461

462462
.. versionadded:: 1.0
463+
.. deprecated:: 2.4
464+
in favour of ``License-Expression``.
465+
466+
.. warning::
467+
As of Metadata 2.4, ``License`` and ``License-Expression`` are mutually
468+
exclusive. If both are specified, tools which parse metadata will disregard
469+
``License`` and PyPI will reject uploads.
470+
See `PEP 639 <https://peps.python.org/pep-0639/#deprecate-license-field>`__.
463471

464472
Text indicating the license covering the distribution where the license
465473
is not a selection from the "License" Trove classifiers. See
@@ -477,6 +485,50 @@ Examples::
477485
License: GPL version 3, excluding DRM provisions
478486

479487

488+
.. _license-expression-optional:
489+
.. _core-metadata-license-expression:
490+
491+
License-Expression
492+
==================
493+
494+
.. versionadded:: 2.4
495+
496+
Text string that is a valid SPDX
497+
`license expression <https://peps.python.org/pep-0639/#term-license-expression>`__
498+
as `defined in PEP 639 <https://peps.python.org/pep-0639/#spdx>`__.
499+
500+
Examples::
501+
502+
License-Expression: MIT
503+
License-Expression: BSD-3-Clause
504+
License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause)
505+
License-Expression: MIT OR GPL-2.0-or-later OR (FSFUL AND BSD-2-Clause)
506+
License-Expression: GPL-3.0-only WITH Classpath-Exception-2.0 OR BSD-3-Clause
507+
License-Expression: LicenseRef-Special-License OR CC0-1.0 OR Unlicense
508+
License-Expression: LicenseRef-Proprietary
509+
510+
511+
.. _license-file-optional:
512+
.. _core-metadata-license-file:
513+
514+
License-File (multiple use)
515+
===========================
516+
517+
.. versionadded:: 2.4
518+
519+
Each entry is a string representation of the path of a license-related file.
520+
The path is located within the project source tree, relative to the project
521+
root directory. For details see :pep:`639`.
522+
523+
Examples::
524+
525+
License-File: LICENSE
526+
License-File: AUTHORS
527+
License-File: LICENSE.txt
528+
License-File: licenses/LICENSE.MIT
529+
License-File: licenses/LICENSE.CC0
530+
531+
480532
.. _metadata-classifier:
481533
.. _core-metadata-classifier:
482534

@@ -490,6 +542,11 @@ for the distribution. Classifiers are described in :pep:`301`,
490542
and the Python Package Index publishes a dynamic list of
491543
`currently defined classifiers <https://pypi.org/classifiers/>`__.
492544

545+
.. note::
546+
The use of ``License ::`` classifiers is deprecated as of Metadata 2.4,
547+
use ``License-Expression`` instead. See
548+
`PEP 639 <https://peps.python.org/pep-0639/#deprecate-license-classifiers>`_.
549+
493550
This field may be followed by an environment marker after a semicolon.
494551

495552
Examples::
@@ -864,6 +921,11 @@ History
864921

865922
- Restricted extra names to be normalized.
866923

924+
- August 2024: Core metadata 2.4 was approved through :pep:`639`.
925+
926+
- Added the ``License-Expression`` field.
927+
- Added the ``License-File`` field.
928+
867929
----
868930

869931
.. [1] reStructuredText markup:

source/specifications/platform-compatibility-tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,5 +343,5 @@ History
343343

344344

345345
.. _musl: https://musl.libc.org
346-
.. _ldd: https://www.unix.com/man-page/posix/1/ldd/
346+
.. _ldd: https://www.man7.org/linux/man-pages/man1/ldd.1.html
347347
.. _elf: https://refspecs.linuxfoundation.org/elf/elf.pdf

0 commit comments

Comments
 (0)