Skip to content

Commit

Permalink
Document how to install .dist-info/licenses per PEP 639
Browse files Browse the repository at this point in the history
  • Loading branch information
befeleme committed Nov 19, 2024
1 parent 8149535 commit 8b257b7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/specifications/recording-installed-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ The ``METADATA`` file is mandatory.
All other files may be omitted at the installing tool's discretion.
Additional installer-specific files may be present.

This ``.dist-info`` directory may contain the following directory, described in
detail below:

* ``licenses``: contains license files.

.. note::

The :ref:`binary-distribution-format` specification describes additional
Expand Down Expand Up @@ -219,6 +224,17 @@ of requirement (i.e. name plus version specifier).
Its detailed specification is at :ref:`direct-url`.


The licenses subdirectory
=========================

If the metadata version is 2.4 or greater and one or more License-File
fields is specified, the ``.dist-info`` directory MUST contain a ``licenses``
subdirectory which MUST contain the files listed in the License-File fields in
the ``METADATA`` file at their respective paths relative to the licenses
directory.
Any files in this directory MUST be copied from wheels by the install tools.


Intentionally preventing changes to installed packages
======================================================

Expand Down Expand Up @@ -259,3 +275,5 @@ History
for the full definition.
- September 2020: Various amendments and clarifications were approved through
:pep:`627`.
- November 2024: The .dist-info/licenses directory was specified through
:pep:`639`.

0 comments on commit 8b257b7

Please sign in to comment.