Skip to content
Draft
Show file tree
Hide file tree
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
16 changes: 15 additions & 1 deletion docs/migration.rst
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,6 +68,21 @@ functions for easy access to the most common metadata:
- :ref:`files` provides file-like access to the data blobs backing
the metadata.

.. _packages-distributions:

packages_distributions()
========================

``packages_distributions()`` maps importable top-level package and module names
to the distributions that provide them. When available, it uses the
distribution's ``top_level.txt`` file before falling back to inferring names
from the installed file list.

``top_level.txt`` is a legacy, setuptools-specific metadata file rather than a
requirement of the distribution metadata standards. Build backends are
therefore not required to provide it, and the mapping may be incomplete when a
distribution also does not expose enough file metadata for inference.

pkg_resources.find_distributions()
==================================

Expand All@@ -81,4 +96,3 @@ pkg_resources.get_distribution()

Similar to ``distributions``, the ``distribution()`` function provides
access to a single distribution by name.

1 change: 1 addition & 0 deletions newsfragments/526.bugfix.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
Document the legacy ``top_level.txt`` dependency and fallback behavior of ``packages_distributions()``.