def _build_egg(egg, archive_filename, to_dir):
with archive_context(archive_filename):<EOL><INDENT>log.warn('<STR_LIT>', to_dir)<EOL>_python_cmd('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', to_dir)<EOL><DEDENT>log.warn(egg)<EOL>if not os.path.exists(egg):<EOL><INDENT>raise IOError('<STR_LIT>')<EOL><DEDENT>
Build Setuptools egg.