MINI MINI MANI MO
3
\+
@ sd d Z ddlmZ ddlmZmZ ddlZddlZddlZG dd deZ dd Z
d d
Zdd ZdS )
zdistutils.command.install_egg_info
Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata. )Command)logdir_utilNc @ s: e Zd ZdZdZdgZdd Zdd Zd
d Zdd
Z dS )install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info fileinstall-dir=ddirectory to install toc C s
d | _ d S )N)install_dir)self r :/usr/lib64/python3.6/distutils/command/install_egg_info.pyinitialize_options s z#install_egg_info.initialize_optionsc C sb | j dd dtt| jj tt| jj ftjd d }t j
j| j|| _
| j
g| _d S )NZinstall_libr z%s-%s-py%d.%d.egg-info )r r )Zset_undefined_optionsto_filename safe_namedistributionZget_namesafe_versionZget_versionsysversion_infoospathjoinr targetoutputs)r
basenamer r r finalize_options s z!install_egg_info.finalize_optionsc C s | j }tjj|r2tjj| r2tj|| jd nNtjj|rX| j tj
| j fd| n(tjj| js| j tj| jfd| j t
jd| | jst|ddd}| jjj| W d Q R X d S )N)dry_runz Removing z Creating z
Writing %swzUTF-8)encoding)r r r isdirislinkr Zremove_treer existsZexecuteunlinkr makedirsr infoopenr ZmetadataZwrite_pkg_file)r
r fr r r run s zinstall_egg_info.runc C s | j S )N)r )r
r r r get_outputs. s zinstall_egg_info.get_outputsN)r r r )
__name__
__module____qualname____doc__ZdescriptionZuser_optionsr
r r' r( r r r r r s
r c C s t jdd| S )zConvert an arbitrary string to a standard distribution name
Any runs of non-alphanumeric/. characters are replaced with a single '-'.
z[^A-Za-z0-9.]+-)resub)namer r r r 6 s r c C s | j dd} tjdd| S )zConvert 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.
.z[^A-Za-z0-9.]+r- )replacer. r/ )versionr r r r >