This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -105,6 +105,13 @@ You can also get a :ref:`distribution's version number <version>`, list its
current Python environment.
.. exception:: MetadataNotFound
Subclass of :class:`FileNotFoundError` raised when attempting to load metadata
from a distribution folder that is empty or otherwise does not contain a
metadata file.
Functional API
==============
Expand Down
Expand Up
@@ -224,6 +231,9 @@ Distribution metadata
Raises :exc:`PackageNotFoundError` if the named distribution
package is not installed in the current Python environment.
Raises :exc:`MetadataNotFound` if a distribution package is
present but no METADATA file is present.
.. class:: PackageMetadata
A concrete implementation of the
Expand Down
Expand Up
@@ -252,6 +262,12 @@ all the metadata in a JSON-compatible form per :PEP:`566`::
The full set of available metadata is not described here.
See the PyPA `Core metadata specification <https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata>`_ for additional details.
.. versionchanged:: 3.15
Previously and incidentally, if a METADATA file was missing from a distribution, an
empty ``PackageMetadata`` would be returned, indistinguishable from
an empty METADATA file. Now, a missing METADATA file triggers a
``MetadataNotFound`` exception.
.. versionchanged:: 3.10
The ``Description`` is now included in the metadata when presented
through the payload. Line continuation characters have been removed.
Expand Down
Expand Up
@@ -465,6 +481,9 @@ The same applies for :func:`entry_points` and :func:`files`.
.. attribute:: metadata
:type: PackageMetadata
Raises :exc:`MetadataNotFound` if the METADATA file is not present in
the distribution.
There are all kinds of additional metadata available on :class:`!Distribution`
instances as a :class:`PackageMetadata` instance::
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gh-143387: Update docs to reflect the behavior and note the changed version. #150095
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
gh-143387: Update docs to reflect the behavior and note the changed version. #150095
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.