Skip to content

Commit

Permalink
update RE_GIT_DESCRIBE
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaojieqiu committed Apr 14, 2022
1 parent 0938cd2 commit 6ffe3fa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
12 changes: 6 additions & 6 deletions dynamo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"""Mapping Vector Field of Single Cells
"""

# from .get_version import get_version, get_dynamo_version
#
# __version__ = get_version(__file__)
# del get_version
from .get_version import get_version, get_dynamo_version

from .get_version import get_dynamo_version
__version__ = get_version(__file__)
del get_version

__version__ = get_dynamo_version()
# from .get_version import get_dynamo_version
#
# __version__ = get_dynamo_version()

from . import pp
from . import est
Expand Down
16 changes: 11 additions & 5 deletions dynamo/get_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from typing import List, NamedTuple, Optional, Union

RE_VERSION = r"([\d.]+?)(?:\.dev(\d+))?(?:[_+-]([0-9a-zA-Z.]+))?"
RE_GIT_DESCRIBE = r"v?(?:([\d.]+)-(\d+)-g)?([0-9a-f]{7})(-dirty)?"
# RE_GIT_DESCRIBE = r"v?(?:([\d.]+)-(\d+)-g)?([0-9a-f]{7})(-dirty)?"
RE_GIT_DESCRIBE = r"v?(?:([\d.]+)-(.+)-g)?([0-9a-f]{7})(-dirty)?"
ON_RTD = os.environ.get("READTHEDOCS") == "True"


Expand Down Expand Up @@ -85,7 +86,7 @@ def get_version_from_git(parent):
check=True,
)

release, dev, hex_, dirty = match_groups(f"{RE_GIT_DESCRIBE}$", p.stdout.rstrip("\r\n"))
release, dev, hex_, dirty = match_groups(f"{RE_GIT_DESCRIBE}", p.stdout.rstrip("\r\n"))

labels = []
if dev == "0":
Expand Down Expand Up @@ -165,9 +166,14 @@ def get_version(package: Union[Path, str]) -> str:
def get_dynamo_version():
import pkg_resources

_package_name = "dynamo-release"
_package = pkg_resources.working_set.by_key[_package_name]
return _package.version
try:
_package_name = "dynamo-release"
_package = pkg_resources.working_set.by_key[_package_name]
version = _package.version
except KeyError:
version = "1.0.9"

return version


def get_all_dependencies_version(display=True):
Expand Down

0 comments on commit 6ffe3fa

Please sign in to comment.