def load_config_from_setup(app):
<EOL>root = os.path.join(app.confdir, '<STR_LIT:..>')<EOL>setup_script = os.path.join(root, '<STR_LIT>')<EOL>fields = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>dist_info_cmd = [sys.executable, setup_script] + fields<EOL>output = subprocess.check_output(<EOL>dist_info_cmd,<EOL>cwd=root,<EOL>universal_newlines=True,<EOL>)<EOL>outputs = output.strip().split('<STR_LIT:\n>')<EOL>project, version, url, author = outputs<EOL>app.config.project = project<EOL>app.config.version = app.config.release = version<EOL>app.config.package_url = url<EOL>app.config.author = app.config.copyright = author<EOL>
Replace values in app.config from package metadata