set the version in the projects root module

def set_version(version):
    """ set the version in the projects root module """

    with open(FILENAME) as pythonfile:
        content = pythonfile.read()

    output = re.sub(RE_VERSION, r"\1'{}'".format(version), content)

    if content == output:
        error('failed updating {}'.format(FILENAME))

    with open(FILENAME, 'w') as pythonfile:
        pythonfile.write(output)