diff --git a/dynamo/__init__.py b/dynamo/__init__.py index 1e14f23a9..a5fecf935 100755 --- a/dynamo/__init__.py +++ b/dynamo/__init__.py @@ -1,10 +1,14 @@ """Mapping Vector Field of Single Cells """ -from .get_version import get_version +# from .get_version import get_version, get_dynamo_version +# +# __version__ = get_version(__file__) +# del get_version -__version__ = get_version(__file__) -del get_version +from .get_version import get_dynamo_version + +__version__ = get_dynamo_version() from . import pp from . import est diff --git a/dynamo/get_version.py b/dynamo/get_version.py index be8095082..96001abb2 100755 --- a/dynamo/get_version.py +++ b/dynamo/get_version.py @@ -158,10 +158,18 @@ def get_version(package: Union[Path, str]) -> str: get_version_from_dirname(name, parent) or get_version_from_git(parent) or get_version_from_metadata(name, parent) - or "0.0.0" + or get_dynamo_version() ) +def get_dynamo_version(): + import pkg_resources + + _package_name = "dynamo-release" + _package = pkg_resources.working_set.by_key[_package_name] + return _package.version + + def get_all_dependencies_version(display=True): """ Adapted from answer 2 in