def read_file(file_path):
    """Reads in a Python requirements file.
    Ignore empty lines, comments and editable requirements

    :param str file_path: path to requirements file

    :returns: mapping from a project to its pinned version
    :rtype: dict

    """
    data = {}
    with open(file_path) as file_h:
        for line in file_h:
            line = line.strip()
            if line and not line.startswith('#') and not line.startswith('-e'):
                project, version = line.split('==')
                if not version:
                    raise ValueError("Unexpected syntax '{0}'".format(line))
                data[project] = version
    return data