MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / bump

Function bump

lib/devtools/src/crewai_devtools/cli.py:1916–2024  ·  view source on GitHub ↗

Bump version across all packages in lib/. Args: version: New version to set (e.g., 1.0.0, 1.0.0a1). dry_run: Show what would be done without making changes. no_push: Don't push changes to remote. no_commit: Don't commit changes (just update files).

(version: str, dry_run: bool, no_push: bool, no_commit: bool)

Source from the content-addressed store, hash-verified

1914 "--no-commit", is_flag=True, help="Don't commit changes (just update files)"
1915)
1916def bump(version: str, dry_run: bool, no_push: bool, no_commit: bool) -> None:
1917 """Bump version across all packages in lib/.
1918
1919 Args:
1920 version: New version to set (e.g., 1.0.0, 1.0.0a1).
1921 dry_run: Show what would be done without making changes.
1922 no_push: Don't push changes to remote.
1923 no_commit: Don't commit changes (just update files).
1924 """
1925 console.print(
1926 f"\n[yellow]Note:[/yellow] [bold]devtools bump[/bold] only bumps versions "
1927 f"in this repo. It will not tag, publish to PyPI, or release enterprise.\n"
1928 f"If you want a full end-to-end release, run "
1929 f"[bold]devtools release {version}[/bold] instead."
1930 )
1931 if not Confirm.ask("Continue with bump only?", default=True):
1932 sys.exit(0)
1933
1934 try:
1935 check_gh_installed()
1936
1937 cwd = Path.cwd()
1938 lib_dir = cwd / "lib"
1939
1940 if not dry_run:
1941 console.print("Checking git status...")
1942 check_git_clean()
1943 console.print("[green]✓[/green] Working directory is clean")
1944 else:
1945 console.print("[dim][DRY RUN][/dim] Would check git status")
1946
1947 packages = get_packages(lib_dir)
1948
1949 console.print(f"\nFound {len(packages)} package(s) to update:")
1950 for pkg in packages:
1951 console.print(f" - {pkg.name}")
1952
1953 if no_commit:
1954 console.print(f"\nUpdating version to {version}...")
1955 _update_all_versions(cwd, lib_dir, version, packages, dry_run)
1956 console.print("\nSkipping git operations (--no-commit flag set)")
1957 else:
1958 branch_name = f"feat/bump-version-{version}"
1959 if not dry_run:
1960 console.print(f"\nCreating branch {branch_name}...")
1961 create_or_reset_branch(branch_name)
1962 console.print("[green]✓[/green] Branch created")
1963
1964 console.print(f"\nUpdating version to {version}...")
1965 _update_all_versions(cwd, lib_dir, version, packages, dry_run)
1966
1967 console.print("\nCommitting changes...")
1968 run_command(["git", "add", "."])
1969 run_command(
1970 ["git", "commit", "-m", f"feat: bump versions to {version}"]
1971 )
1972 console.print("[green]✓[/green] Changes committed")
1973

Callers

nothing calls this directly

Calls 8

check_gh_installedFunction · 0.85
check_git_cleanFunction · 0.85
get_packagesFunction · 0.85
_update_all_versionsFunction · 0.85
create_or_reset_branchFunction · 0.85
askMethod · 0.80
run_commandFunction · 0.70
printMethod · 0.45

Tested by

no test coverage detected