Skip to content

Add importlib.metadata as an approach in "Single-sourcing the package version" #616

@chrahunt

Description

@chrahunt

The current version of "Single-sourcing the package version" has an example using pkg_resources. It would probably make sense to include an item using importlib.metadata since it will be standard in 3.8+ with a backport as importlib_metadata and can serve the same purpose. That may look like

from importlib_metadata import version

__version__ = version(__package__)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions