Skip to content

pkg_resources is deprecated #51

Closed
@timj

Description

@timj

The __init__.py has the following code:

__version__ = pkg_resources.get_distribution("firefly_client").version

This issues a deprecation warning now because pkg_resources is deprecated.

The modern equivalent is to use importlib.metadata.version:

from importlib.metadata import PackageNotFoundError, version

__version__: str

try:
    __version__ = version("firefly_client")
except PackageNotFoundError:
    # package is not installed
    __version__ = "0.0.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions