def validate_version_str(version_str: str):
    """
    Check the version string is of the form x.y.z.

    If the version string is not valid raise a ValueError.
    """
    is_str = isinstance(version_str, str)
    if not (is_str and len(version_str.split('.')) == 3):
        msg = f'version must be a string of the form x.y.z, not {version_str}'
        raise ValueError(msg)
