MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / main

Function main

scripts/prepare_release.py:432–466  ·  view source on GitHub ↗

Run the release preparation workflow. Args: argv: Optional command-line arguments for tests or programmatic calls. Returns: Process exit code.

(argv: list[str] | None = None)

Source from the content-addressed store, hash-verified

430
431
432def main(argv: list[str] | None = None) -> int:
433 """Run the release preparation workflow.
434
435 Args:
436 argv: Optional command-line arguments for tests or programmatic calls.
437
438 Returns:
439 Process exit code.
440 """
441 try:
442 args = parse_args(sys.argv[1:] if argv is None else argv)
443 version = validate_version(args.version)
444 ensure_clean_worktree()
445
446 branch = create_release_branch(version, args.base_branch, args.remote)
447 tag = latest_tag()
448 if tag:
449 print(f"Latest tag: {tag}")
450 else:
451 print("No existing tags found; changelog will use all reachable commits.")
452
453 commits = release_commits(tag)
454 update_pyproject_version(version)
455 update_package_version(version)
456 changelog_path = write_changelog(version, commits)
457 run_validation(args)
458
459 if args.commit:
460 commit_and_maybe_push(version, branch, changelog_path, args)
461
462 print_next_steps(version, branch, changelog_path, args)
463 return 0
464 except ReleaseError as exc:
465 print(f"prepare-release: {exc}", file=sys.stderr)
466 return 1
467
468
469if __name__ == "__main__":

Callers 1

prepare_release.pyFile · 0.70

Calls 12

validate_versionFunction · 0.85
ensure_clean_worktreeFunction · 0.85
create_release_branchFunction · 0.85
latest_tagFunction · 0.85
release_commitsFunction · 0.85
update_pyproject_versionFunction · 0.85
update_package_versionFunction · 0.85
write_changelogFunction · 0.85
run_validationFunction · 0.85
commit_and_maybe_pushFunction · 0.85
print_next_stepsFunction · 0.85
parse_argsFunction · 0.70

Tested by

no test coverage detected