import re


def get_version(file_path):
    """
    Return the project version tag.

    Parameters
    ----------
    file_path : str
        The path to the project __init__.py file.

    Returns
    -------
    version : str
        The project version tag.

    """

    with open(file_path, mode='r') as init_file:
        init_cont = init_file.read()

    # PEP 440: [N:]N(.N)*[{a|b|c|rc}N][.postN][.devN]
    ver_spec = (r'__version__ = ["\'](\d+:)?\d+(\.\d+){1,2}' +
                r'((a|b|c|rc)\d+)?(\.post\d+)?(\.dev\d+)?["\']')
    ver_match = re.search(ver_spec, init_cont)

    if not ver_match:
        raise RuntimeError('Unable to find (valid) version specifier in {0!r}'
                           .format(file_path))

    return ver_match.group(0)[15:-1]