Skip to content

Description not available through PackageMetadata protocol #275

@jaraco

Description

@jaraco

While investigating the details of Python packaging metadata for a Setuptools issue, I learned that PEP 566 allows the Description to be indicated as a field or as the payload of the metadata and in fact the latter approach is what is seen in dist-info metadata as produced by today's tools.

That means that the PackageMetadata Protocol does not expose that information. For example:

draft $ pip-run -q setuptools
>>> import importlib.metadata
>>> dist = importlib.metadata.distribution('setuptools')
>>> dist.metadata['Description'] or 'missing'
'missing'

But the content is there:

>>> dist.metadata.get_payload()[:10]
'.. image::'

Probably importlib.metadata could copy that payload into the Description field, but it probably needs to first encode the content according to this spec (yuck).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions