setup.py 文件源码

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

项目:backrefs 作者: facelessuser 项目源码 文件源码
def get_version():
    """Get version and version_info without importing the entire module."""

    devstatus = {
        'alpha': '3 - Alpha',
        'beta': '4 - Beta',
        'candidate': '4 - Beta',
        'final': '5 - Production/Stable'
    }
    path = os.path.join(os.path.dirname(__file__), 'backrefs')
    fp, pathname, desc = imp.find_module('__init__', [path])
    try:
        v = imp.load_module('__init__', fp, pathname, desc)
        return v.version, devstatus[v.version_info[3]]
    except Exception:
        print(traceback.format_exc())
    finally:
        fp.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号