gh-132947: Apply changes from importlib_metadata 8.7 (#137885)

* Copied files from python/importlib_metadata@b67ac80c49.
This commit is contained in:
Jason R. Coombs 2025-08-18 10:54:10 -07:00 committed by GitHub
parent 918e3ba6c0
commit 5292fc00f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 294 additions and 122 deletions

View file

@ -0,0 +1,15 @@
import functools
import typing
from ._meta import PackageMetadata
md_none = functools.partial(typing.cast, PackageMetadata)
"""
Suppress type errors for optional metadata.
Although Distribution.metadata can return None when metadata is corrupt
and thus None, allow callers to assume it's not None and crash if
that's the case.
# python/importlib_metadata#493
"""