python / python/importlib_metadata

`packages_distributions` relies on setuptools implementation detail

Open Beginner friendly
#526 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation help wanted
Dominant language
Python
Stars
142
Forks
97
PR merge metrics
No merged PRs in 30d

Description

This is a follow-up to https://github.com/python/importlib_metadata/issues/402.

packages_distributions reads top_level.txt to determine the names. This file isn't part of any PEP and to my knowledge only implemented by setuptools, as a historical artifact from eggs. This leads users to believe that build backends not supporting this function have a bug (https://github.com/astral-sh/uv/issues/16423).

Would it be possible to update the documentation to accurately reflect that this is not a problem with some PEP 660 build backends not supplying top-level names, but that this function is generally not expected to work with editable installs at all, with the historical exception of setuptools?

(This may change with PEP 794)

https://github.com/python/importlib_metadata/blob/95ecf2aa573a68d4624506f801ca70992a337f41/importlib_metadata/__init__.py#L1133-L1134

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the documentation for packages_distributions and the linked section of importlib_metadata/init.py. Update the documentation to explain that editable installs generally are not expected to provide top-level names, with setuptools as the historical exception, while noting the possible future impact of PEP 794.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.