Skip to content

Commit 38c270d

Browse files
Latest setuptools and flit now support PEP 639
This updates the now outdated notes added in faf4c7d. Closes #1831.
1 parent 99469d7 commit 38c270d

File tree

3 files changed

+34
-62
lines changed

3 files changed

+34
-62
lines changed

source/guides/licensing-examples-and-user-scenarios.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ This document aims to provide clear guidance how to migrate from the legacy
1212
to the standardized way of declaring licenses.
1313
Make sure your preferred build backend supports :pep:`639` before
1414
trying to apply the newer guidelines.
15-
As of February 2025, :doc:`setuptools <setuptools:userguide/pyproject_config>`
16-
and :ref:`flit <flit:pyproject_toml_project>` don't support :pep:`639` yet.
1715

1816

1917
Licensing Examples

source/guides/writing-pyproject-toml.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,11 @@ You can also specify the format explicitly, like this:
328328
-----------
329329

330330
:pep:`639` (accepted in August 2024) has changed the way the ``license`` field
331-
is declared. Make sure your preferred build backend supports :pep:`639` before
332-
trying to apply the newer guidelines.
333-
As of February 2025, :doc:`setuptools <setuptools:userguide/pyproject_config>`
334-
and :ref:`flit <flit:pyproject_toml_project>` don't support :pep:`639` yet.
331+
is declared. As of March 19th 2025 the latest versions of all recommended
332+
build backends support :pep:`639` (although :ref:`flit <flit:pyproject_toml_project>`
333+
only supports single license expressions as of flit 3.11.0)
334+
If you have to use an older version of a build backend, that doesn't support it
335+
yet, you have to use the legacy format instead.
335336

336337
:pep:`639` license declaration
337338
''''''''''''''''''''''''''''''
@@ -394,10 +395,6 @@ whose license is unapproved.)
394395
-----------------
395396

396397
:pep:`639` (accepted in August 2024) has introduced the ``license-files`` field.
397-
Make sure your preferred build backend supports :pep:`639` before declaring the
398-
field.
399-
As of February 2025, :doc:`setuptools <setuptools:userguide/pyproject_config>`
400-
and :ref:`flit <flit:pyproject_toml_project>` don't support :pep:`639` yet.
401398

402399
This is a list of license files and files containing other legal
403400
information you want to distribute with your package.

source/tutorials/packaging-projects.rst

Lines changed: 29 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -141,31 +141,31 @@ for more details.
141141
.. code-block:: toml
142142
143143
[build-system]
144-
requires = ["hatchling"]
144+
requires = ["hatchling>=1.26"]
145145
build-backend = "hatchling.build"
146146
147147
.. tab:: setuptools
148148

149149
.. code-block:: toml
150150
151151
[build-system]
152-
requires = ["setuptools>=61.0"]
152+
requires = ["setuptools>=77.0.1"]
153153
build-backend = "setuptools.build_meta"
154154
155155
.. tab:: Flit
156156

157157
.. code-block:: toml
158158
159159
[build-system]
160-
requires = ["flit_core>=3.4"]
160+
requires = ["flit_core>=3.11.0"]
161161
build-backend = "flit_core.buildapi"
162162
163163
.. tab:: PDM
164164

165165
.. code-block:: toml
166166
167167
[build-system]
168-
requires = ["pdm-backend"]
168+
requires = ["pdm-backend>=2.4.0"]
169169
build-backend = "pdm.backend"
170170
171171
@@ -175,6 +175,9 @@ Frontends usually run builds in isolated environments, so omitting dependencies
175175
here may cause build-time errors.
176176
This should always include your backend's package, and might have other build-time
177177
dependencies.
178+
The minimum version specified in the above code block is the one that introduced support
179+
for ``license-files`` being a list, if you need to use an older version you can adapt
180+
this requirement but will also need to specify the license files in a legacy format.
178181

179182
The ``build-backend`` key is the name of the Python object that frontends will use
180183
to perform the build.
@@ -200,52 +203,27 @@ to include your username; this ensures that you have a unique
200203
package name that doesn't conflict with packages uploaded by other people
201204
following this tutorial.
202205

203-
.. tab:: hatchling/pdm
204-
205-
.. code-block:: toml
206-
207-
[project]
208-
name = "example_package_YOUR_USERNAME_HERE"
209-
version = "0.0.1"
210-
authors = [
211-
{ name="Example Author", email="[email protected]" },
212-
]
213-
description = "A small example package"
214-
readme = "README.md"
215-
requires-python = ">=3.8"
216-
classifiers = [
217-
"Programming Language :: Python :: 3",
218-
"Operating System :: OS Independent",
219-
]
220-
license = "MIT"
221-
license-files = ["LICEN[CS]E*"]
222-
223-
[project.urls]
224-
Homepage = "https://github.com/pypa/sampleproject"
225-
Issues = "https://github.com/pypa/sampleproject/issues"
226-
227-
.. tab:: setuptools/flit
228-
229-
.. code-block:: toml
230-
231-
[project]
232-
name = "example_package_YOUR_USERNAME_HERE"
233-
version = "0.0.1"
234-
authors = [
235-
{ name="Example Author", email="[email protected]" },
236-
]
237-
description = "A small example package"
238-
readme = "README.md"
239-
requires-python = ">=3.8"
240-
classifiers = [
241-
"Programming Language :: Python :: 3",
242-
"Operating System :: OS Independent",
243-
"License :: OSI Approved :: MIT License",
244-
]
245-
246-
[project.urls]
247-
Homepage = "https://github.com/pypa/sampleproject"
248-
Issues = "https://github.com/pypa/sampleproject/issues"
206+
.. code-block:: toml
207+
208+
[project]
209+
name = "example_package_YOUR_USERNAME_HERE"
210+
version = "0.0.1"
211+
authors = [
212+
{ name="Example Author", email="[email protected]" },
213+
]
214+
description = "A small example package"
215+
readme = "README.md"
216+
requires-python = ">=3.8"
217+
classifiers = [
218+
"Programming Language :: Python :: 3",
219+
"Operating System :: OS Independent",
220+
]
221+
license = "MIT"
222+
license-files = ["LICEN[CS]E*"]
223+
224+
[project.urls]
225+
Homepage = "https://github.com/pypa/sampleproject"
226+
Issues = "https://github.com/pypa/sampleproject/issues"
249227
250228
- ``name`` is the *distribution name* of your package. This can be any name as
251229
long as it only contains letters, numbers, ``.``, ``_`` , and ``-``. It also
@@ -274,10 +252,9 @@ following this tutorial.
274252
your package will work on. For a complete list of classifiers, see
275253
https://pypi.org/classifiers/.
276254
- ``license`` is the :term:`SPDX license expression <License Expression>` of
277-
your package. Not supported by all the build backends yet.
255+
your package.
278256
- ``license-files`` is the list of glob paths to the license files,
279257
relative to the directory where :file:`pyproject.toml` is located.
280-
Not supported by all the build backends yet.
281258
- ``urls`` lets you list any number of extra links to show on PyPI.
282259
Generally this could be to the source, documentation, issue trackers, etc.
283260

0 commit comments

Comments
 (0)