Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions source/guides/writing-pyproject-toml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,20 @@ You can also specify the format explicitly, like this:
``license`` and ``license-files``
---------------------------------

As per :pep:`639`, licenses should be declared with two fields:
The :ref:`Core Metadata specification <core-metadata-license>` defines two fields
for modern license metadata. They serve different purposes and can be used
independently:

- ``license`` is an :term:`SPDX license expression <License Expression>`
- ``license`` declares an :term:`SPDX license expression <License Expression>`
consisting of one or more :term:`license identifiers <License Identifier>`.
- ``license-files`` is a list of license file glob patterns.
- ``license-files`` declares the license and other legal files that should be
included in distribution metadata, using a list of glob patterns.

A previous PEP had specified ``license`` to be a table with a ``file`` or a
``text`` key, this format is now deprecated. Most :term:`build backends<build
backend>` now support the new format as shown in the following table.

.. list-table:: build backend versions that introduced :pep:`639` support
.. list-table:: build backend versions introducing the standardized license fields
:header-rows: 1

* - hatchling
Expand All @@ -343,12 +346,17 @@ backend>` now support the new format as shown in the following table.
- poetry-core
- uv-build
* - 1.27.0
- 77.0.3
- 77.0.0
- 3.12
- 2.4.0
- 2.2.0
- 0.7.19

The table records the first backend release implementing the license fields
in the :ref:`Core Metadata specification <core-metadata-license>`; it is not
a recommendation to pin projects to those historical versions. Prefer a
current supported backend release when possible.


.. _license:

Expand Down