Skip to content

Improve handling of get_version #294

@blink1073

Description

@blink1073

Problem

We are currently using either the deprecated python setup.py --version or the slow build-a-wheel-and-extract-metadata method to get the current version.

Proposed Solution

Use the approach recommended by setuptools_scm to get the version:

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("package-name")
except PackageNotFoundError:
    # package is not installed
    pass

We'd have to install the package in editable mode so that the version can remain dynamic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions