def get_edi_version():
"""
Get the version of the current edi installation or the version derived from git.
:return: full edi version string
"""
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
git_dir = os.path.join(project_root, ".git")
if os.path.isdir(git_dir):
# do import locally so that we do not depend on setuptools_scm for the released version
from setuptools_scm import get_version
return get_version(root=project_root)
else:
try:
return pkg_resources.get_distribution('edi').version
except pkg_resources.DistributionNotFound:
return edi_fallback_version
评论列表
文章目录