Skip to content

Type hint for Distribution.metadata is incorrect #513

@mpurnell1

Description

@mpurnell1

I encountered this while trying to help sentry-python prepare for the changes mentioned in #371. Their linter errored with "PackageMetadata" has no attribute "get", since metadata is advertised to return _meta.PackageMetadata, but actually returns _adapters.Message.

Is this intended, and if so what is the workaroud for the linter?

Reproduction steps:

  1. git clone [email protected]:mpurnell1/sentry-python.git
  2. pip install tox
  3. tox -e linters

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions