import re


def get_version(path):
    """Get the module version."""

    with open(path, 'r') as fid:
        m = re.search("version\s*=\s*'([\w.]+)'", fid.read())
        if m is None:
            raise RuntimeError("Could not find version string.")
        version = m.group(1)
        version = version.strip()

    return version