import re


def get_version(version_file):
    """
    Grabs the version from the version_file str path. Expected to be formatted
    as `__version__ = (#,#,#)`.

    PARAMETERS
    ----------
    version_file
        The path to the file the version is located in.

    RETURNS
    -------
    -
        The version as a period separated string. For example, '1.2.3'.
    """
    # Inspired by https://stackoverflow.com/a/7071358
    ver_str_line = open(version_file, 'rt').read()
    vsre = r'__version_info__ *= *\( *(\d+) *, *(\d+) *, *(\d+) *\)'
    mo = re.search(vsre, ver_str_line, re.M)
    if mo:
        vertup = mo.group(1), mo.group(2), mo.group(3)
    else:
        raise RuntimeError('Unable to find version string in %s.' %
                           (version_file,))
    ver_str = '.'.join(vertup)
    return ver_str