__version__.py 文件源码

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

项目:EMFT 作者: 132nd-etcher 项目源码 文件源码
def get_gitversion() -> dict:
    """
    Runs the gitversion executable and returns a dictionary of values

    Example "gitversion" output::

        "Major":0,
        "Minor":4,
        "Patch":4,
        "PreReleaseTag":"dev.11",
        "PreReleaseTagWithDash":"-dev.11",
        "PreReleaseLabel":"dev",
        "PreReleaseNumber":11,
        "BuildMetaData":"",
        "BuildMetaDataPadded":"",
        "FullBuildMetaData":"Branch.develop.Sha.b22387288a19ac67641fac2711b940c4cab6d021",
        "MajorMinorPatch":"0.4.4",
        "SemVer":"0.4.4-dev.11",
        "LegacySemVer":"0.4.4-dev11",
        "LegacySemVerPadded":"0.4.4-dev0011",
        "AssemblySemVer":"0.4.4.0",
        "FullSemVer":"0.4.4-dev.11",
        "InformationalVersion":"0.4.4-dev.11+Branch.develop.Sha.b22387288a19ac67641fac2711b940c4cab6d021",
        "BranchName":"develop",
        "Sha":"b22387288a19ac67641fac2711b940c4cab6d021",
        "NuGetVersionV2":"0.4.4-dev0011",
        "NuGetVersion":"0.4.4-dev0011",
        "NuGetPreReleaseTagV2":"dev0011",
        "NuGetPreReleaseTag":"dev0011",
        "CommitsSinceVersionSource":11,
        "CommitsSinceVersionSourcePadded":"0011",
        "CommitDate":"2017-07-18"
    """
    # This is a potential security breach, but I'm leaving it as is as it should only be running either from a dev
    # machine or on Appveyor
    cmd = r'C:\ProgramData\chocolatey\bin\gitversion.exe' if os.environ.get('APPVEYOR') else 'gitversion'
    return loads(subprocess.getoutput([cmd]).rstrip())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号