U ËAš`Ç ã@sddZddlmZddlmZmZddlZddlZddlZGdd„deƒZ dd„Z d d „Z d d „Z dS) z†distutils.command.install_egg_info Implements the Distutils 'install_egg_info' command, for installing a package's PKG-INFO metadata.é)ÚCommand)ÚlogÚdir_utilNc@s<eZdZdZdZddgZdd„Zdd„Zd d „Zd d „Z d S)Úinstall_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)z install-dir=Údzdirectory to install to)zinstall-layoutNzcustom installation layoutcCsd|_d|_d|_dS©N)Ú install_dirÚinstall_layoutÚ prefix_option©Úself©r ú8/usr/lib/python3.8/distutils/command/install_egg_info.pyÚinitialize_optionssz#install_egg_info.initialize_optionscCsä| dd¡| dd¡| dd¡|jrP|j ¡dkr@tdƒ‚|j ¡dk}n|jr\d }nd }|rŽd tt|j ¡ƒƒtt |j  ¡ƒƒf}n6d tt|j ¡ƒƒtt |j  ¡ƒƒft j dd …˜}t j |j|¡|_|jg|_dS)NZ install_lib)rrZinstall)r r )r r )ÚdebZunixz"unknown value for --install-layoutrFTz%s-%s.egg-infoz%s-%s-py%d.%d.egg-infoé)Zset_undefined_optionsr ÚlowerZDistutilsOptionErrorr Ú to_filenameÚ safe_nameÚ distributionZget_nameÚ safe_versionZ get_versionÚsysÚ version_infoÚosÚpathÚjoinrÚtargetÚoutputs)r Zno_pyverÚbasenamer r rÚfinalize_optionss2   ÿþþ ýz!install_egg_info.finalize_optionsc Cs¼|j}tj |¡r0tj |¡s0tj||jdnNtj |¡rV|  tj |jfd|¡n(tj |j ¡s~|  tj |j fd|j ¡t  d|¡|js¸t|ddd}|jj |¡W5QRXdS)N)Údry_runz Removing z Creating z Writing %sÚwzUTF-8)Úencoding)rrrÚisdirÚislinkrZ remove_treer ÚexistsZexecuteÚunlinkrÚmakedirsrÚinfoÚopenrZmetadataZwrite_pkg_file)r rÚfr r rÚrun4s ÿ zinstall_egg_info.runcCs|jSr)rr r r rÚ get_outputsBszinstall_egg_info.get_outputsN) Ú__name__Ú __module__Ú __qualname__Ú__doc__Z descriptionZ user_optionsrrr+r,r r r rr sþrcCst dd|¡S)zConvert an arbitrary string to a standard distribution name Any runs of non-alphanumeric/. characters are replaced with a single '-'. ú[^A-Za-z0-9.]+ú-)ÚreÚsub©Únamer r rrJsrcCs| dd¡}t dd|¡S)zÌConvert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash. ú Ú.r1r2)Úreplacer3r4)Úversionr r rrRs rcCs | dd¡S)z|Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. r2Ú_)r9r5r r rr\sr) r0Z distutils.cmdrZ distutilsrrrrr3rrrrr r r rÚs ?