Skip to content

Commit 403f1b9

Browse files
authored
Merge branch 'main' into add-pep739
2 parents 9a188f2 + 6c792a1 commit 403f1b9

File tree

8 files changed

+808
-145
lines changed

8 files changed

+808
-145
lines changed

source/discussions/downstream-packaging.rst

Lines changed: 481 additions & 0 deletions
Large diffs are not rendered by default.

source/discussions/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ specific topic. If you're just trying to get stuff done, see
1717
src-layout-vs-flat-layout
1818
setup-py-deprecated
1919
single-source-version
20+
downstream-packaging

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Licensing examples and user scenarios
1010
license files and other legally required information.
1111
This document aims to provide clear guidance how to migrate from the legacy
1212
to the standardized way of declaring licenses.
13+
Make sure your preferred build backend supports :pep:`639` before
14+
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.
1317

1418

1519
Licensing Examples

source/guides/writing-pyproject-toml.rst

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,20 @@ You can also specify the format explicitly, like this:
322322
readme = {file = "README.txt", content-type = "text/x-rst"}
323323
324324
325+
.. _license:
326+
325327
``license``
326328
-----------
327329

330+
: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.
335+
336+
:pep:`639` license declaration
337+
''''''''''''''''''''''''''''''
338+
328339
This is a valid :term:`SPDX license expression <License Expression>` consisting
329340
of one or more :term:`license identifiers <License Identifier>`.
330341
The full license list is available at the
@@ -352,10 +363,42 @@ The custom identifiers must follow the SPDX specification,
352363
[project]
353364
license = "LicenseRef-My-Custom-License"
354365
366+
Legacy license declaration
367+
''''''''''''''''''''''''''
368+
369+
This can take two forms. You can put your license in a file, typically
370+
:file:`LICENSE` or :file:`LICENSE.txt`, and link that file here:
371+
372+
.. code-block:: toml
373+
374+
[project]
375+
license = {file = "LICENSE"}
376+
377+
or you can write the name of the license:
378+
379+
.. code-block:: toml
380+
381+
[project]
382+
license = {text = "MIT License"}
383+
384+
If you are using a standard, well-known license, it is not necessary to use this
385+
field. Instead, you should use one of the :ref:`classifiers` starting with ``License
386+
::``. (As a general rule, it is a good idea to use a standard, well-known
387+
license, both to avoid confusion and because some organizations avoid software
388+
whose license is unapproved.)
389+
390+
391+
.. _license-files:
355392

356393
``license-files``
357394
-----------------
358395

396+
: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.
401+
359402
This is a list of license files and files containing other legal
360403
information you want to distribute with your package.
361404

@@ -529,7 +572,7 @@ A full example
529572
]
530573
description = "Lovely Spam! Wonderful Spam!"
531574
readme = "README.rst"
532-
license = "MIT"
575+
license = "MIT" # or license = {file = "LICENSE.txt"} for legacy declaration
533576
license-files = ["LICEN[CS]E.*"]
534577
keywords = ["egg", "bacon", "sausage", "tomatoes", "Lobster Thermidor"]
535578
classifiers = [

source/specifications/platform-compatibility-tags.rst

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ subset of Linux platforms, and allows building wheels tagged with the
109109
``manylinux`` platform tag which can be used across most common Linux
110110
distributions.
111111

112-
The current standard is the future-proof ``manylinux_x_y`` standard. It defines
113-
tags of the form ``manylinux_x_y_arch``, where ``x`` and ``y`` are glibc major
112+
The current standard is the future-proof :file:`manylinux_{x}_{y}` standard. It defines
113+
tags of the form :file:`manylinux_{x}_{y}_{arch}`, where ``x`` and ``y`` are glibc major
114114
and minor versions supported (e.g. ``manylinux_2_24_xxx`` should work on any
115115
distro using glibc 2.24+), and ``arch`` is the architecture, matching the value
116116
of :py:func:`sysconfig.get_platform()` on the system as in the "simple" form above.
@@ -151,7 +151,7 @@ auditwheel ``>=1.0.0`` ``>=2.0.0`` ``>=3.0.0`` ``>=3.3.0`` [#
151151

152152
The ``musllinux`` family of tags is similar to ``manylinux``, but for Linux
153153
platforms that use the musl_ libc rather than glibc (a prime example being Alpine
154-
Linux). The schema is ``musllinux_x_y_arch``, supporting musl ``x.y`` and higher
154+
Linux). The schema is :file:`musllinux_{x}_{y}_{arch}``, supporting musl ``x.y`` and higher
155155
on the architecture ``arch``.
156156

157157
The musl version values can be obtained by executing the musl libc shared
@@ -189,6 +189,108 @@ There are currently two possible ways to find the musl library’s location that
189189
Python interpreter is running on, either with the system ldd_ command, or by
190190
parsing the ``PT_INTERP`` section’s value from the executable’s ELF_ header.
191191

192+
.. _macos:
193+
194+
macOS
195+
-----
196+
197+
macOS uses the ``macosx`` family of tags (the ``x`` suffix is a historical
198+
artefact of Apple's official macOS naming scheme). The schema for compatibility
199+
tags is :file:`macosx_{x}_{y}_{arch}`, indicating that the wheel is compatible
200+
with macOS ``x.y`` or later on the architecture ``arch``.
201+
202+
The values of ``x`` and ``y`` correspond to the major and minor version number of
203+
the macOS release, respectively. They must both be positive integers, with the
204+
``x`` value being ``>= 10``. The version number always includes a major *and*
205+
minor version, even if Apple's official version numbering only refers to
206+
the major value. For example, ``macosx_11_0_arm64`` indicates compatibility
207+
with macOS 11 or later.
208+
209+
macOS binaries can be compiled for a single architecture, or can include support
210+
for multiple architectures in the same binary (sometimes called "fat" binaries).
211+
To indicate support for a single architecture, the value of ``arch`` must match
212+
the value of :py:func:`platform.machine()` on the system. To indicate
213+
support multiple architectures, the ``arch`` tag should be an identifier from
214+
the following list that describes the set of supported architectures:
215+
216+
============== ========================================
217+
``arch`` Architectures supported
218+
============== ========================================
219+
``universal2`` ``arm64``, ``x86_64``
220+
``universal`` ``i386``, ``ppc``, ``ppc64``, ``x86_64``
221+
``intel`` ``i386``, ``x86_64``
222+
``fat`` ``i386``, ``ppc``
223+
``fat3`` ``i386``, ``ppc``, ``x86_64``
224+
``fat64`` ``ppc64``, ``x86_64``
225+
============== ========================================
226+
227+
The minimum supported macOS version may also be constrained by architecture. For
228+
example, macOS 11 (Big Sur) was the first release to support arm64. These
229+
additional constraints are enforced transparently by the macOS compilation
230+
toolchain when building binaries that support multiple architectures.
231+
232+
.. _android:
233+
234+
Android
235+
-------
236+
237+
Android uses the schema :file:`android_{apilevel}_{abi}`, indicating
238+
compatibility with the given Android API level or later, on the given ABI. For
239+
example, ``android_27_arm64_v8a`` indicates support for API level 27 or later,
240+
on ``arm64_v8a`` devices. Android makes no distinction between physical devices
241+
and emulated devices.
242+
243+
The API level should be a positive integer. This is *not* the same thing as
244+
the user-facing Android version. For example, the release known as Android
245+
12 (code named "Snow Cone") uses API level 31 or 32, depending on the specific
246+
Android version in use. Android's release documentation contains the `full list
247+
of Android versions and their corresponding API levels
248+
<https://developer.android.com/tools/releases/platforms>`__.
249+
250+
There are 4 `supported ABIs <https://developer.android.com/ndk/guides/abis>`__.
251+
Normalized according to the rules above, they are:
252+
253+
* ``armeabi_v7a``
254+
* ``arm64_v8a``
255+
* ``x86``
256+
* ``x86_64``
257+
258+
Virtually all current physical devices use one of the ARM architectures. ``x86``
259+
and ``x86_64`` are supported for use in the emulator. ``x86`` has not been
260+
supported as a development platform since 2020, and no new emulator images have
261+
been released since then.
262+
263+
.. _ios:
264+
265+
iOS
266+
---
267+
268+
iOS uses the schema :file:`ios_{x}_{y}_{arch}_{sdk}`, indicating compatibility with
269+
iOS ``x.y`` or later, on the ``arch`` architecture, using the ``sdk`` SDK.
270+
271+
The value of ``x`` and ``y`` correspond to the major and minor version number of
272+
the iOS release, respectively. They must both be positive integers. The version
273+
number always includes a major *and* minor version, even if Apple's official
274+
version numbering only refers to the major value. For example, a
275+
``ios_13_0_arm64_iphonesimulator`` indicates compatibility with iOS 13 or later.
276+
277+
The value of ``arch`` must match the value of :py:func:`platform.machine()` on
278+
the system.
279+
280+
The value of ``sdk`` must be either ``iphoneos`` (for physical devices), or
281+
``iphonesimulator`` (for device simulators). These SDKs have the same API
282+
surface, but are incompatible at the binary level, even if they are running on
283+
the same CPU architecture. Code compiled for an arm64 simulator will not run on
284+
an arm64 device.
285+
286+
The combination of :file:`{arch}_{sdk}` is referred to as the "multiarch". There
287+
are three possible values for multiarch:
288+
289+
* ``arm64_iphoneos``, for physical iPhone/iPad devices. This includes every
290+
iOS device manufactured since ~2015;
291+
* ``arm64_iphonesimulator``, for simulators running on Apple Silicon macOS
292+
hardware; and
293+
* ``x86_64_iphonesimulator``, for simulators running on x86_64 hardware.
192294

193295
Use
194296
===
@@ -339,7 +441,8 @@ History
339441
- November 2019: The ``manylinux_x_y`` perennial tag was approved through
340442
:pep:`600`.
341443
- April 2021: The ``musllinux_x_y`` tag was approved through :pep:`656`.
342-
444+
- December 2023: The tags for iOS were approved through :pep:`730`.
445+
- March 2024: The tags for Android were approved through :pep:`738`.
343446

344447

345448
.. _musl: https://musl.libc.org

source/specifications/pyproject-toml.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ The table subkeys of the ``license`` key are deprecated.
252252

253253
- TOML_ type: array of strings
254254
- Corresponding :ref:`core metadata <core-metadata>` field:
255-
:ref:`License-Expression <core-metadata-license-file>`
255+
:ref:`License-File <core-metadata-license-file>`
256256

257257
An array specifying paths in the project source tree relative to the project
258258
root directory (i.e. directory containing :file:`pyproject.toml` or legacy project

0 commit comments

Comments
 (0)