Skip to content
Merged
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
19 changes: 11 additions & 8 deletions source/guides/writing-pyproject-toml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,22 +333,25 @@ 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-expression>` 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`` specifies glob patterns matching license files and other
legal notices to include in distribution archives.

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 supporting the standardized license fields
:header-rows: 1

* - hatchling
- setuptools
- flit-core [#flit-core-pep639]_
- flit-core
- pdm-backend
- poetry-core
- uv-build
Expand All @@ -359,6 +362,9 @@ backend>` now support the new format as shown in the following table.
- 2.2.0
- 0.7.19

The table lists minimum backend versions for these fields; prefer a current
supported backend release when possible.


.. _license:

Expand Down Expand Up @@ -618,9 +624,6 @@ A full example
like ``requires-python = "<= 3.10"`` here. `This blog post <requires-python-blog-post_>`_
contains some information regarding possible problems.

.. [#flit-core-pep639] flit-core `does not yet <flit-issue-735_>`_ support WITH in SPDX license expressions.

.. _flit-issue-735: https://github.com/pypa/flit/issues/735
.. _gfm: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
.. _setuptools: https://setuptools.pypa.io
.. _poetry: https://python-poetry.org
Expand Down