当前位置: 首页>>代码示例>>Python>>正文


Python semver.bump_minor方法代码示例

本文整理汇总了Python中semver.bump_minor方法的典型用法代码示例。如果您正苦于以下问题:Python semver.bump_minor方法的具体用法?Python semver.bump_minor怎么用?Python semver.bump_minor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在semver的用法示例。


在下文中一共展示了semver.bump_minor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: bump

# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def bump(latest):

    minor_bump_label = os.environ.get("MINOR_BUMP_LABEL") or "bump-minor"
    major_bump_label = os.environ.get("MAJOR_BUMP_LABEL") or "bump-major"

    merge_request_id = extract_merge_request_id_from_commit()
    labels = retrieve_labels_from_merge_request(merge_request_id)



    if minor_bump_label in labels:
        return semver.bump_minor(latest)
    elif major_bump_label in labels:
        return semver.bump_major(latest)
    else:
        return semver.bump_patch(latest) 
开发者ID:mrooding,项目名称:gitlab-semantic-versioning,代码行数:18,代码来源:version-update.py

示例2: increment_version

# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def increment_version(version, release_type):
    if release_type == 'major':
        return semver.bump_major(version)
    elif release_type == 'minor':
        return semver.bump_minor(version)
    return semver.bump_patch(version) 
开发者ID:suned,项目名称:serum,代码行数:8,代码来源:release.py

示例3: test_version_is_newer

# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def test_version_is_newer(requests):
    version = __version__.replace("rc", "-rc")
    newer_version = semver.bump_minor(version)
    requests.get.return_value = FakeResponse(
        200,
        "http://someplace//usage/latest/",
        {"version": __version__, "up_to_date": False}
    )

    latest_version = check_newer_version(command="init")
    assert latest_version == __version__ 
开发者ID:chaostoolkit,项目名称:chaostoolkit,代码行数:13,代码来源:test_check.py

示例4: version_bump_minor

# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def version_bump_minor(value):
    return semver.bump_minor(value) 
开发者ID:StackStorm,项目名称:st2,代码行数:4,代码来源:version.py

示例5: get_bump_function

# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def get_bump_function(changelog_types):
    minor_bump = False

    for changelog_type in changelog_types:
        bump_function = VERSION_BUMP.get(changelog_type)
        if bump_function is semver.bump_major:
            return bump_function
        elif bump_function is semver.bump_minor:
            minor_bump = True

    return semver.bump_minor if minor_bump else semver.bump_patch 
开发者ID:DataDog,项目名称:integrations-core,代码行数:13,代码来源:utils.py

示例6: main

# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def main():
    if len(sys.argv) < 2:
        error("Pass in plugin type as the first argument. "
              "Choose from: {}".format(PLUGIN_TYPES))
    elif len(sys.argv) < 3:
        error("You must also pass in repository SHA as the argument")

    repo_type = sys.argv[1].lower()
    if repo_type == "sublime":
        repo_url = SUBLIME_REPO
    elif repo_type == "vim":
        repo_url = VIM_REPO
    elif repo_type == "nvim":
        repo_url = NVIM_REPO
    else:
        error("Please pass in one of {} as the plugin type"
              .format(PLUGIN_TYPES))

    master_SHA = sys.argv[2]

    bot_username = os.environ.get("RELEASE_BOT_USERNAME")
    bot_password = os.environ.get("RELEASE_BOT_PASSWORD")

    g = Github(bot_username, bot_password)

    release_repo = None
    for repo in g.get_organization(ORG_NAME).get_repos():
        if repo.html_url == repo_url:
            release_repo = repo
            break

    if release_repo is None:
        error("{} repo not found".format(repo_type))

    tags = release_repo.get_tags()
    last_tag = None
    for t in tags:
        last_tag = t
        break

    if (last_tag is None):
        last_tag = '0.0.0'
    else:
        if last_tag.commit.sha == master_SHA:
            error("Cannot create release with same SHA")
        last_tag = last_tag.name

    tag = semver.bump_minor(last_tag)

    release_repo.create_git_tag_and_release(
        tag,
        "Release version {}".format(tag),
        "v{}".format(tag),
        "Release version {}".format(tag),
        master_SHA,
        "commit",
    )

    print("Succesfully created release v{}".format(tag)) 
开发者ID:typeintandem,项目名称:tandem,代码行数:61,代码来源:release.py


注:本文中的semver.bump_minor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。