versionhelpers.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:edi 作者: lueschem 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号