def compute_semver(current_version, release="normal", compute_dev=True):
    """Compute and return the next version number, given a the current
    version and the release type ('normal', 'minor' or 'major'), as well
    as the next dev version (if `compute_dev` is 'True').

    """
    if current_version.endswith("dev"):
        dev_version = current_version.replace("dev", "")
        dev_version_parts = list(map(int, dev_version.split(".")))
        current_version_parts = dev_version_parts
        current_version_parts[2] -= 1
    else:
        current_version_parts = list(map(int, current_version.split(".")))

    release_version_parts = current_version_parts
    if release == "minor":
        release_version_parts[2] += 1
    elif release == "normal":
        release_version_parts[1] += 1
        release_version_parts[2] = 0
    elif release == "major":
        release_version_parts[0] += 1
        release_version_parts[1] = 0
        release_version_parts[2] = 0

    release_version = ".".join(map(str, release_version_parts))

    next_dev_version = None
    if compute_dev:
        next_dev_version, _ = compute_semver(release_version, release="minor", compute_dev=False)
        next_dev_version = "{}dev".format(next_dev_version)

    return release_version, next_dev_version