Return the parsed metadata for this Distribution. The returned object will have keys that name the various bits of metadata per the `Core metadata specifications `_. Custom providers
(self)
| 447 | |
| 448 | @property |
| 449 | def metadata(self) -> _meta.PackageMetadata: |
| 450 | """Return the parsed metadata for this Distribution. |
| 451 | |
| 452 | The returned object will have keys that name the various bits of |
| 453 | metadata per the |
| 454 | `Core metadata specifications <https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata>`_. |
| 455 | |
| 456 | Custom providers may provide the METADATA file or override this |
| 457 | property. |
| 458 | """ |
| 459 | # deferred for performance (python/cpython#109829) |
| 460 | from . import _adapters |
| 461 | |
| 462 | opt_text = ( |
| 463 | self.read_text('METADATA') |
| 464 | or self.read_text('PKG-INFO') |
| 465 | # This last clause is here to support old egg-info files. Its |
| 466 | # effect is to just end up using the PathDistribution's self._path |
| 467 | # (which points to the egg-info file) attribute unchanged. |
| 468 | or self.read_text('') |
| 469 | ) |
| 470 | text = cast(str, opt_text) |
| 471 | return _adapters.Message(email.message_from_string(text)) |
| 472 | |
| 473 | @property |
| 474 | def name(self) -> str: |
no test coverage detected