From bdee98facbc8e4e266f6699e43a8b229f04d205b Mon Sep 17 00:00:00 2001 From: Harshit Sharma <66710144+harshitethic@users.noreply.github.com> Date: Sat, 26 Sep 2026 10:57:13 +0530 Subject: [PATCH 1/4] docs: clarify PEP 639 license field semantics --- source/guides/writing-pyproject-toml.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index a0ff484f1a..e1ab988f90 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -323,11 +323,13 @@ You can also specify the format explicitly, like this: ``license`` and ``license-files`` --------------------------------- -As per :pep:`639`, licenses should be declared with two fields: +:pep:`639` defines two fields for modern license metadata. They serve +different purposes and can be used independently: -- ``license`` is an :term:`SPDX license expression ` +- ``license`` declares an :term:`SPDX license expression ` consisting of one or more :term:`license identifiers `. -- ``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` 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 that introduced :pep:`639` +support; it is not a recommendation to pin projects to those historical +versions. Prefer a current supported backend release when possible. + .. _license: From 6b60f12d58e88957295dd5fc688c331629fed241 Mon Sep 17 00:00:00 2001 From: Harshit Sharma <66710144+harshitethic@users.noreply.github.com> Date: Tue, 29 Sep 2026 20:58:43 +0530 Subject: [PATCH 2/4] docs: link license guidance to core metadata spec --- source/guides/writing-pyproject-toml.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index e1ab988f90..0a5d594df8 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -323,8 +323,9 @@ You can also specify the format explicitly, like this: ``license`` and ``license-files`` --------------------------------- -:pep:`639` defines two fields for modern license metadata. They serve -different purposes and can be used independently: +The :ref:`Core Metadata specification ` defines two fields +for modern license metadata. They serve different purposes and can be used +independently: - ``license`` declares an :term:`SPDX license expression ` consisting of one or more :term:`license identifiers `. From f073eecd912a036ca73c554a6e9b202df27e35cb Mon Sep 17 00:00:00 2001 From: Harshit Sharma <66710144+harshitethic@users.noreply.github.com> Date: Sat, 10 Oct 2026 21:31:21 +0530 Subject: [PATCH 3/4] docs: cite canonical Core Metadata license specification --- source/guides/writing-pyproject-toml.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index 0a5d594df8..a57ac4b6b8 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -336,7 +336,7 @@ 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` 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 @@ -352,9 +352,10 @@ backend>` now support the new format as shown in the following table. - 2.2.0 - 0.7.19 -The table records the first backend release that introduced :pep:`639` -support; it is not a recommendation to pin projects to those historical -versions. Prefer a current supported backend release when possible. +The table records the first backend release implementing the license fields +in the :ref:`Core Metadata specification `; it is not +a recommendation to pin projects to those historical versions. Prefer a +current supported backend release when possible. .. _license: From c0b43b56cc57ee4b9d8a963c41bb2b25db7e0386 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Thu, 26 Nov 2026 10:02:39 +0100 Subject: [PATCH 4/4] Address review comments: text precision, remove version change, flit footnote --- source/guides/writing-pyproject-toml.rst | 25 ++++++++++-------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index 262a1add03..4c0d005980 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -333,39 +333,37 @@ You can also specify the format explicitly, like this: ``license`` and ``license-files`` --------------------------------- -The :ref:`Core Metadata specification ` defines two fields -for modern license metadata. They serve different purposes and can be used -independently: +The :ref:`Core Metadata specification ` defines +two fields for modern license metadata. They serve different purposes and can be +used independently: - ``license`` declares an :term:`SPDX license expression ` consisting of one or more :term:`license identifiers `. -- ``license-files`` declares the license and other legal files that should be - included in distribution metadata, using a list of 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` now support the new format as shown in the following table. -.. list-table:: build backend versions introducing the standardized license fields +.. 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 * - 1.27.0 - - 77.0.0 + - 77.0.3 - 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 `; it is not -a recommendation to pin projects to those historical versions. Prefer a -current supported backend release when possible. +The table lists minimum backend versions for these fields; prefer a current +supported backend release when possible. .. _license: @@ -626,9 +624,6 @@ A full example like ``requires-python = "<= 3.10"`` here. `This blog post `_ contains some information regarding possible problems. -.. [#flit-core-pep639] flit-core `does not yet `_ 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