本文整理汇总了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)
示例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)
示例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__
示例4: version_bump_minor
# 需要导入模块: import semver [as 别名]
# 或者: from semver import bump_minor [as 别名]
def version_bump_minor(value):
return semver.bump_minor(value)
示例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
示例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))