import re


def find_version(filename):
    """Reads the version number from a file."""
    version = ''
    with open(filename, 'r') as f:
        regex = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
        for line in f:
            match = regex.match(line)
            if match:
                version = match.group(1)
                break
    if not version:
        raise RuntimeError('Cannot find version information')
    return version