def get_and_update_package_metadata():
global setup_arguments<EOL>global METADATA_FILENAME<EOL>if not os.path.exists('<STR_LIT>') and os.path.exists(METADATA_FILENAME):<EOL><INDENT>with open(METADATA_FILENAME) as fh:<EOL><INDENT>metadata = json.load(fh)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>git = Git(version=setup_arguments['<STR_LIT:version>'])<EOL>metadata = {<EOL>'<STR_LIT:version>': git.version,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': git.hash,<EOL>'<STR_LIT>': git.origin,<EOL>'<STR_LIT>': git.branch<EOL>}<EOL>for readme_file in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if os.path.exists(readme_file):<EOL><INDENT>with open(readme_file) as file_handle:<EOL><INDENT>metadata['<STR_LIT>'] = file_handle.read()<EOL><DEDENT>break<EOL><DEDENT><DEDENT>with open(METADATA_FILENAME, '<STR_LIT:w>') as fh:<EOL><INDENT>json.dump(metadata, fh)<EOL><DEDENT><DEDENT>return metadata<EOL>
Update the package metadata for this package if we are building the package.
:return:metadata - Dictionary of metadata information