def bump_version(current_version: str, bump_type: BumpType) -> str:
    """Bump a version string according to semver rules."""
    v = Version(current_version)

    # Parse the version components
    release = v.release
    major = release[0] if len(release) > 0 else 0
    minor = release[1] if len(release) > 1 else 0
    micro = release[2] if len(release) > 2 else 0

    version_str = ""
    if bump_type == BumpType.MAJOR:
        version_str = f"{major + 1}.0.0"
    elif bump_type == BumpType.MINOR:
        version_str = f"{major}.{minor + 1}.0"
    elif bump_type == BumpType.PATCH:
        version_str = f"{major}.{minor}.{micro + 1}"

    return version_str
Bump a version string according to semver rules.
llama-dev/llama_dev/pkg/bump.py