return version information from a git branch name

def version_from_branch(branch):
    """
    return version information from a git branch name
    """
    try:
        return tuple(
            map(
                int,
                re.match(r"^.*(?P<version>\d+(\.\d+)+).*$", branch)
                .groupdict()["version"]
                .split("."),
            )
        )
    except AttributeError as attr_err:
        raise ValueError(
            f"Branch {branch} seems to not have a version in its name."
        ) from attr_err