build.py 文件源码

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

项目:EMFT 作者: 132nd-etcher 项目源码 文件源码
def get_gitversion() -> dict:
    """
    Uses GitVersion (https://github.com/GitTools/GitVersion) to infer project's current version

    Returns Gitversion JSON output as a dict
    """
    if os.environ.get('APPVEYOR'):
        exe = find_executable('gitversion', r'C:\ProgramData\chocolatey\bin')
    else:
        exe = find_executable('gitversion')
    if not exe:
        click.secho(
            '"gitversion.exe" not been found in your PATH.\n'
            'GitVersion is used to infer the current version from the Git repository.\n'
            'setuptools_scm plans on switching to using the Semver scheme in the future; when that happens, '
            'I\'ll remove the dependency to GitVersion.\n'
            'In the meantime, GitVersion can be obtained via Chocolatey (recommended): '
            'https://chocolatey.org/packages/GitVersion.Portable\n'
            'If you already have chocolatey installed, you can simply run the following command (as admin):\n\n'
            '\t\t"choco install gitversion.portable -pre -y"\n\n'
            'If you\'re not comfortable using the command line, there is a GUI tool for Chocolatey available at:\n\n'
            '\t\thttps://github.com/chocolatey/ChocolateyGUI/releases\n\n'
            'Or you can install directly from :\n\n'
            '\t\thttps://github.com/GitTools/GitVersion/releases',
            err=True,
        )
        exit(-1)
    return loads(subprocess.getoutput([exe]).rstrip())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号