a
    ÅydŽj  ã                   @   sÔ  d Z ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZ dd	lmZmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( dj)ej*Ž Z+dd„ Z,G dd„ dƒZ-G dd„ de-eƒZ.G dd„ deƒZG dd„ deƒZ/dd„ Z0d d!„ Z1d"d#„ Z2d$d%„ Z3d&d'„ Z4d(d)„ Z5d*d+„ Z6d,d-„ Z7d7d/d0„Z8d1d2„ Z9d8d3d4„Z:G d5d6„ d6e(ƒZ;dS )9zUsetuptools.command.egg_info

Create a distribution's .egg-info directory and contentsé    )ÚFileList)ÚDistutilsInternalError)Úconvert_path)ÚlogNé   )Úmetadata)Ú_entry_pointsÚ_normalization)ÚCommand)Úsdist)Úwalk_revctrl)Úedit_config)Ú	bdist_egg)Úglob)Ú	packaging)Úyield_lines)ÚSetuptoolsDeprecationWarningz{}.{}c                 C   sÞ  d}|   tjj¡}t tj¡}d|f }t|ƒD ]Œ\}}|t|ƒd k}|dkrr|r`|d7 }q0|d||f 7 }q0d}t|ƒ}	||	k r²|| }
|
dkr¨||d 7 }n |
d	krº||7 }nî|
d
krš|d }||	k rè|| dkrè|d }||	k r|| dkr|d }||	k r,|| dkr,|d }q||	krF|t |
¡7 }nR||d |… }d}|d dkrxd}|dd… }|t |¡7 }|d|f 7 }|}n|t |
¡7 }|d7 }q~|s0||7 }q0|d7 }tj|tj	tj
B dS )zö
    Translate a file path glob like '*.txt' in to a regular expression.
    This differs from fnmatch.translate which allows wildcards to match
    directory separators. It also knows about '**/' which matches any number of
    directories.
    Ú z[^%s]é   ú**z.*z
(?:%s+%s)*r   Ú*ú?ú[ú!ú]ú^Nz[%s]z\Z)Úflags)ÚsplitÚosÚpathÚsepÚreÚescapeÚ	enumerateÚlenÚcompileÚ	MULTILINEÚDOTALL)r   ÚpatZchunksr    Z
valid_charÚcÚchunkZ
last_chunkÚiZ	chunk_lenÚcharZinner_iÚinnerZ
char_class© r.   ú:lib/python3.9/site-packages/setuptools/command/egg_info.pyÚtranslate_pattern&   sV    







r0   c                   @   sd   e Zd ZdZdZedd„ ƒZdd„ Zdd„ Ze	e
dœd	d
„Ze	dœdd„Ze	dœdd„ZeeƒZdS )Ú
InfoCommonNc                 C   s   t  | j ¡ ¡S ©N)r	   Z	safe_nameÚdistributionZget_name©Úselfr.   r.   r/   Úname}   s    zInfoCommon.namec                 C   s   |   | j ¡ ¡}t |¡S r2   )Ú
_maybe_tagr3   Zget_versionr	   Úbest_effort_version)r5   Ztaggedr.   r.   r/   Útagged_version   s    zInfoCommon.tagged_versionc                 C   s   | j r|  |¡r|S || j  S )z
        egg_info may be called more than once for a distribution,
        in which case the version string already contains all tags.
        )ÚvtagsÚ_already_tagged©r5   Úversionr.   r.   r/   r7   …   s    þzInfoCommon._maybe_tag)r=   Úreturnc                 C   s   |  | j¡p|  |  ¡ ¡S r2   )Úendswithr:   Ú
_safe_tagsr<   r.   r.   r/   r;      s    zInfoCommon._already_tagged)r>   c                 C   s   t  d| j› ¡dd … S )NÚ0r   )r	   r8   r:   r4   r.   r.   r/   r@   ”   s    zInfoCommon._safe_tagsc                 C   s,   d}| j r|| j 7 }| jr(|t d¡7 }|S )Nr   z%Y%m%d)Ú	tag_buildÚtag_dateÚtimeÚstrftimer<   r.   r.   r/   Útags™   s    
zInfoCommon.tags)Ú__name__Ú
__module__Ú__qualname__rB   rC   Úpropertyr6   r9   r7   ÚstrÚboolr;   r@   rF   r:   r.   r.   r.   r/   r1   y   s   

r1   c                   @   s   e Zd ZdZg d¢ZdgZddiZdd„ Zedd„ ƒZ	e	j
d	d„ ƒZ	d
d„ Zdd„ Zedfdd„Zddd„Zdd„ Zdd„ Zdd„ Zdd„ ZdS )Úegg_infoz+create a distribution's .egg-info directory))z	egg-base=ÚezLdirectory containing .egg-info directories (default: top of the source tree))útag-dateÚdz0Add date stamp (e.g. 20050528) to version number)z
tag-build=Úbz-Specify explicit tag to add to version number)úno-dateÚDz"Don't include date stamp [default]rO   rR   c                 C   s"   d | _ d | _d | _d | _d| _d S )NF)Úegg_baseÚegg_namerM   Úegg_versionÚignore_egg_info_in_manifestr4   r.   r.   r/   Úinitialize_options³   s
    zegg_info.initialize_optionsc                 C   s   d S r2   r.   r4   r.   r.   r/   Útag_svn_revision½   s    zegg_info.tag_svn_revisionc                 C   s   d S r2   r.   )r5   Úvaluer.   r.   r/   rY   Á   s    c                 C   s0   t  ¡ }|  ¡ |d< d|d< t|t|dƒ dS )z³
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        rB   r   rC   )rM   N)ÚcollectionsÚOrderedDictrF   r   Údict)r5   ÚfilenamerM   r.   r.   r/   Úsave_version_infoÆ   s    zegg_info.save_version_infoc              
   C   sd  | j | _|  ¡ | _tj | j¡}z6t|tjjƒ}|r8dnd}tj 	|| j| jf ¡ W n> t
y” } z&tj d| j| jf ¡|‚W Y d }~n
d }~0 0 | jd u r¼| jj}|p®i  dtj¡| _|  d¡ t | j¡d | _| jtjkrøtj | j| j¡| _| j| jj_| jj}t|dd ƒp$t|dd ƒ}|d ur`|| j ¡ kr`| j|_tj | j¡|_d | j_d S )	Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%sr   rT   ú	.egg-infoÚkeyr6   ) r6   rU   r9   rV   r   r=   ZVersionÚ
isinstanceÚrequirementsZRequirementÚ
ValueErrorÚ	distutilsÚerrorsZDistutilsOptionErrorrT   r3   Zpackage_dirÚgetr   ÚcurdirZensure_dirnamer	   Úfilename_componentrM   r   Újoinr   Z_patched_distÚgetattrÚlowerZ_versionZ_parsed_version)r5   Zparsed_versionZ
is_versionÚspecrN   ÚdirsZpdra   r.   r.   r/   Úfinalize_optionsÓ   s:    

ÿÿý

zegg_info.finalize_optionsNc                 C   s   t | j| j||ƒS )ú0Compute filename of the output egg. Private API.)Ú_egg_basenamerU   rV   )r5   Ú
py_versionÚplatformr.   r.   r/   Ú_get_egg_basenameÿ   s    zegg_info._get_egg_basenameFc                 C   sL   |r|   |||¡ n4tj |¡rH|du r>|s>t d||¡ dS |  |¡ dS )a¹  Write `data` to `filename` or delete if empty

        If `data` is non-empty, this routine is the same as ``write_file()``.
        If `data` is empty but not ``None``, this is the same as calling
        ``delete_file(filename)`.  If `data` is ``None``, then this is a no-op
        unless `filename` exists, in which case a warning is issued about the
        orphaned file (if `force` is false), or deleted (if `force` is true).
        Nz$%s not set in setup(), but %s exists)Ú
write_filer   r   Úexistsr   ÚwarnÚdelete_file)r5   Úwhatr^   ÚdataÚforcer.   r.   r/   Úwrite_or_delete_file  s    	ÿzegg_info.write_or_delete_filec                 C   s>   t  d||¡ | d¡}| js:t|dƒ}| |¡ | ¡  dS )zªWrite `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.
        zwriting %s to %súutf-8ÚwbN)r   ÚinfoÚencodeÚdry_runÚopenÚwriteÚclose)r5   ry   r^   rz   Úfr.   r.   r/   ru     s    


zegg_info.write_filec                 C   s    t  d|¡ | jst |¡ dS )z8Delete `filename` (if not a dry run) after announcing itzdeleting %sN)r   r   r   r   Úunlink)r5   r^   r.   r.   r/   rx   $  s    zegg_info.delete_filec              
   C   sÈ   |   | j¡ zt | jd ¡ W n@ ty^ } z(d| j› d}tj |¡|‚W Y d }~n
d }~0 0 tj	ddD ](}| 
¡ }|| |jtj | j|j¡ƒ qltj | jd¡}tj |¡r¼|  |¡ |  ¡  d S )Nz'Cannot update time stamp of directory 'ú'zegg_info.writers)Úgroupznative_libs.txt)ZmkpathrM   r   ÚutimeÚOSErrorre   rf   ZDistutilsFileErrorr   Úentry_pointsÚloadr6   r   rj   rv   rx   Úfind_sources)r5   rN   ÚmsgZepÚwriterÚnlr.   r.   r/   Úrun*  s    $
zegg_info.runc                 C   s<   t j | jd¡}t| jƒ}| j|_||_| 	¡  |j
| _
dS )z"Generate SOURCES.txt manifest filezSOURCES.txtN)r   r   rj   rM   Úmanifest_makerr3   rW   Úignore_egg_info_dirÚmanifestr‘   Úfilelist)r5   Zmanifest_filenameZmmr.   r.   r/   r   <  s    
zegg_info.find_sources)F)rG   rH   rI   ZdescriptionZuser_optionsZboolean_optionsZnegative_optrX   rJ   rY   Úsetterr_   ro   ÚPY_MAJORrt   r|   ru   rx   r‘   r   r.   r.   r.   r/   rM   £   s$   ÿ


,
rM   c                       sŽ   e Zd Zd!‡ fdd„	Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Z‡  ZS )"r   NFc                    s   t ƒ  ||¡ || _d S r2   )ÚsuperÚ__init__r“   )r5   rw   Údebug_printr“   ©Ú	__class__r.   r/   r™   I  s    zFileList.__init__c              	   C   s
  |   |¡\}}}}| j| j| j| jt | j|¡t | j|¡| j	| j
dœ}dddddddd	dœ}z|| }W n" tyŒ   td
j|dƒ‚Y n0 | d¡}	|dv r¦|g}|	r°|fnd}
|| }|  d |g|	rÒ|gng  | ¡¡ |D ] }||ƒsätj||g|
¢R Ž  qäd S )N)ÚincludeÚexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludeÚgraftÚprunez%warning: no files found matching '%s'z9warning: no previously-included files found matching '%s'z>warning: no files found matching '%s' anywhere in distributionzRwarning: no previously-included files matching '%s' found anywhere in distributionz:warning: no files found matching '%s' under directory '%s'zNwarning: no previously-included files matching '%s' found under directory '%s'z+warning: no directories found matching '%s'z6no previously-included directories found matching '%s'z/this cannot happen: invalid action '{action!s}')Úactionz
recursive->   rŸ   r    r.   ú )Z_parse_template_liner   rž   Úglobal_includeÚglobal_excludeÚ	functoolsÚpartialÚrecursive_includeÚrecursive_excluderŸ   r    ÚKeyErrorr   ÚformatÚ
startswithrš   rj   r   rw   )r5   Úliner¡   ÚpatternsÚdirZdir_patternZ
action_mapZlog_mapZprocess_actionZaction_is_recursiveZextra_log_argsZlog_tmplÚpatternr.   r.   r/   Úprocess_template_lineM  s`    ÿÿôéÿÿ
	
ÿþÿÿzFileList.process_template_linec                 C   sR   d}t t| jƒd ddƒD ]2}|| j| ƒr|  d| j|  ¡ | j|= d}q|S )z†
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        Fr   éÿÿÿÿz
 removing T)Úranger$   Úfilesrš   )r5   Z	predicateÚfoundr+   r.   r.   r/   Ú_remove_filesš  s    zFileList._remove_filesc                 C   s$   dd„ t |ƒD ƒ}|  |¡ t|ƒS )z#Include files that match 'pattern'.c                 S   s   g | ]}t j |¡s|‘qS r.   ©r   r   Úisdir©Ú.0r…   r.   r.   r/   Ú
<listcomp>©  ó    z$FileList.include.<locals>.<listcomp>©r   ÚextendrL   ©r5   r¯   r´   r.   r.   r/   r   §  s    
zFileList.includec                 C   s   t |ƒ}|  |j¡S )z#Exclude files that match 'pattern'.)r0   rµ   Úmatch©r5   r¯   r¿   r.   r.   r/   rž   ­  s    zFileList.excludec                 C   s8   t j |d|¡}dd„ t|ddD ƒ}|  |¡ t|ƒS )zN
        Include all files anywhere in 'dir/' that match the pattern.
        r   c                 S   s   g | ]}t j |¡s|‘qS r.   r¶   r¸   r.   r.   r/   rº   ·  s   ÿz.FileList.recursive_include.<locals>.<listcomp>T)Ú	recursive)r   r   rj   r   r½   rL   )r5   r®   r¯   Zfull_patternr´   r.   r.   r/   r§   ²  s    
zFileList.recursive_includec                 C   s    t tj |d|¡ƒ}|  |j¡S )zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        r   ©r0   r   r   rj   rµ   r¿   )r5   r®   r¯   r¿   r.   r.   r/   r¨   ¼  s    zFileList.recursive_excludec                 C   s$   dd„ t |ƒD ƒ}|  |¡ t|ƒS )zInclude all files from 'dir/'.c                 S   s"   g | ]}t j |¡D ]}|‘qqS r.   )re   r•   Úfindall)r¹   Z	match_dirÚitemr.   r.   r/   rº   Å  s   þz"FileList.graft.<locals>.<listcomp>r¼   )r5   r®   r´   r.   r.   r/   rŸ   Ã  s
    þ
zFileList.graftc                 C   s   t tj |d¡ƒ}|  |j¡S )zFilter out files from 'dir/'.r   rÂ   )r5   r®   r¿   r.   r.   r/   r    Í  s    zFileList.prunec                    sJ   | j du r|  ¡  ttj d|¡ƒ‰ ‡ fdd„| j D ƒ}|  |¡ t|ƒS )z“
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nr   c                    s   g | ]}ˆ   |¡r|‘qS r.   ©r¿   r¸   rÅ   r.   r/   rº   Ú  r»   z+FileList.global_include.<locals>.<listcomp>)ZallfilesrÃ   r0   r   r   rj   r½   rL   r¾   r.   rÅ   r/   r£   Ò  s    

zFileList.global_includec                 C   s   t tj d|¡ƒ}|  |j¡S )zD
        Exclude all files anywhere that match the pattern.
        r   rÂ   rÀ   r.   r.   r/   r¤   Þ  s    zFileList.global_excludec                 C   s8   |  d¡r|d d… }t|ƒ}|  |¡r4| j |¡ d S )Núr±   )r?   r   Ú
_safe_pathr³   Úappend)r5   rÄ   r   r.   r.   r/   rÈ   å  s
    

zFileList.appendc                 C   s   | j  t| j|ƒ¡ d S r2   )r³   r½   ÚfilterrÇ   )r5   Úpathsr.   r.   r/   r½   í  s    zFileList.extendc                 C   s   t t| j| jƒƒ| _dS )zÜ
        Replace self.files with only safe paths

        Because some owners of FileList manipulate the underlying
        ``files`` attribute directly, this method must be called to
        repair those paths.
        N)ÚlistrÉ   rÇ   r³   r4   r.   r.   r/   Ú_repairð  s    zFileList._repairc              	   C   sº   d}t  |¡}|d u r(t d| ¡ dS t  |d¡}|d u rNt ||d¡ dS zBd|v p^d|v }| jrp|rpW dS tj |¡sˆtj |¡rŽW dS W n$ t	y´   t ||t
 ¡ ¡ Y n0 d S )Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFr}   r`   s	   .egg-infoT)Úunicode_utilsÚfilesys_decoder   rw   Z
try_encoder“   r   r   rv   ÚUnicodeEncodeErrorÚsysÚgetfilesystemencoding)r5   r   Zenc_warnZu_pathZ	utf8_pathZis_egg_infor.   r.   r/   rÇ   ú  s"    


zFileList._safe_path)NNF)rG   rH   rI   r™   r°   rµ   r   rž   r§   r¨   rŸ   r    r£   r¤   rÈ   r½   rÌ   rÇ   Ú__classcell__r.   r.   r›   r/   r   F  s   M


r   c                   @   st   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	e
dd„ ƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )r’   zMANIFEST.inc                 C   s"   d| _ d| _d| _d| _d| _d S )Nr   F)Zuse_defaultsr    Zmanifest_onlyZforce_manifestr“   r4   r.   r.   r/   rX     s
    z!manifest_maker.initialize_optionsc                 C   s   d S r2   r.   r4   r.   r.   r/   ro      s    zmanifest_maker.finalize_optionsc                 C   sz   t | jd| _tj | j¡s$|  ¡  |  ¡  tj | j	¡rB|  
¡  |  ¡  |  ¡  |  ¡  | j ¡  | j ¡  |  ¡  d S )N)r“   )r   r“   r•   r   r   rv   r”   Úwrite_manifestÚadd_defaultsÚtemplateZread_templateÚadd_license_filesÚ_add_referenced_filesÚprune_file_listÚsortZremove_duplicatesr4   r.   r.   r/   r‘   #  s    

zmanifest_maker.runc                 C   s   t  |¡}| tjd¡S )Nú/)rÍ   rÎ   Úreplacer   r    )r5   r   r.   r.   r/   Ú_manifest_normalize1  s    
z"manifest_maker._manifest_normalizec                    sB   ˆ j  ¡  ‡ fdd„ˆ j jD ƒ}dˆ j }ˆ  tˆ j|f|¡ dS )zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        c                    s   g | ]}ˆ   |¡‘qS r.   )rÜ   r¸   r4   r.   r/   rº   =  r»   z1manifest_maker.write_manifest.<locals>.<listcomp>zwriting manifest file '%s'N)r•   rÌ   r³   r”   Zexecuteru   )r5   r³   rŽ   r.   r4   r/   rÓ   5  s    

zmanifest_maker.write_manifestc                 C   s   |   |¡st | |¡ d S r2   )Ú_should_suppress_warningr   rw   )r5   rŽ   r.   r.   r/   rw   A  s    
zmanifest_maker.warnc                 C   s   t  d| ¡S )z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r!   r¿   )rŽ   r.   r.   r/   rÝ   E  s    z'manifest_maker._should_suppress_warningc                 C   sŒ   t  | ¡ | j | j¡ | j | j¡ ttƒ ƒ}|rB| j |¡ nt	j
 | j¡rX|  ¡  t	j
 d¡rp| j d¡ |  d¡}| j |j¡ d S )Nzsetup.pyrM   )r   rÔ   r•   rÈ   rÕ   r”   rË   r   r½   r   r   rv   Zread_manifestÚget_finalized_commandrŸ   rM   )r5   ZrcfilesZei_cmdr.   r.   r/   rÔ   L  s    


zmanifest_maker.add_defaultsc                 C   s4   | j jjpg }|D ]}t d|¡ q| j |¡ d S )Nzadding license file '%s')r3   r   Úlicense_filesr   r   r•   r½   )r5   rß   Zlfr.   r.   r/   rÖ   ^  s    z manifest_maker.add_license_filesc                 C   s4   t | jdg ƒ}|D ]}t d|¡ q| j |¡ dS )zGAdd files referenced by the config (e.g. `file:` directive) to filelistZ_referenced_filesz%adding file referenced by config '%s'N)rk   r3   r   Údebugr•   r½   )r5   Z
referencedZrfr.   r.   r/   r×   d  s    z$manifest_maker._add_referenced_filesc                 C   sZ   |   d¡}| j ¡ }| j |j¡ | j |¡ t tj	¡}| jj
d| d | dd d S )NÚbuildz(^|z)(RCS|CVS|\.svn)r   )Zis_regex)rÞ   r3   Zget_fullnamer•   r    Z
build_baser!   r"   r   r    Zexclude_pattern)r5   rá   Zbase_dirr    r.   r.   r/   rØ   l  s    

ÿzmanifest_maker.prune_file_listc                 C   s*   t |dƒr| ¡ S tjdddd | ¡ S )a0  
        The parent class implementation of this method
        (``sdist``) will try to include data files, which
        might cause recursion problems when
        ``include_package_data=True``.

        Therefore, avoid triggering any attempt of
        analyzing/building the manifest again.
        Úget_data_files_without_manifestz@`build_py` command does not inherit from setuptools' `build_py`.z±
            Custom 'build_py' does not implement 'get_data_files_without_manifest'.
            Please extend command classes from setuptools instead of distutils.
            z!https://peps.python.org/pep-0632/)Zsee_url)Úhasattrrâ   r   ÚemitZget_data_files)r5   Zbuild_pyr.   r.   r/   Ú_safe_data_filesu  s    

ú	zmanifest_maker._safe_data_filesN)rG   rH   rI   rÕ   rX   ro   r‘   rÜ   rÓ   rw   ÚstaticmethodrÝ   rÔ   rÖ   r×   rØ   rå   r.   r.   r.   r/   r’     s   
	r’   c                 C   sL   d  |¡}| d¡}t| dƒ}| |¡ W d  ƒ n1 s>0    Y  dS )z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    Ú
r}   r~   N)rj   r€   r‚   rƒ   )r^   Úcontentsr…   r.   r.   r/   ru   Ž  s    

ru   c              	   C   sŠ   t  d|¡ | js†| jj}| j|j |_}| j|j |_}z| 	| j
¡ W || |_|_n|| |_|_0 t| jdd ƒ}t | j
|¡ d S )Nz
writing %sZzip_safe)r   r   r   r3   r   rV   r=   rU   r6   Úwrite_pkg_inforM   rk   r   Zwrite_safety_flag)ÚcmdÚbasenamer^   r   ZoldverZoldnameZsafer.   r.   r/   ré   ›  s     ré   c                 C   s   dS )aj  
    Unused: left to avoid errors when updating (from source) from <= 67.8.
    Old installations have a .dist-info directory with the entry-point
    ``depends.txt = setuptools.command.egg_info:warn_depends_obsolete``.
    This may trigger errors when running the first egg_info in build_meta.
    TODO: Remove this function in a version sufficiently > 68.
    Nr.   ©rê   rë   r^   r.   r.   r/   Úwarn_depends_obsolete®  s    rí   c                 C   s,   t |pdƒ}dd„ }t||ƒ}|  |¡ d S )Nr.   c                 S   s   | d S )Nrç   r.   )r¬   r.   r.   r/   Ú	append_cr»  s    z&_write_requirements.<locals>.append_cr)r   ÚmapÚ
writelines)ÚstreamZreqsÚlinesrî   r.   r.   r/   Ú_write_requirements¸  s    
ró   c                 C   sn   | j }t ¡ }t||jƒ |jp"i }t|ƒD ]*}| djf i t	ƒ ¤Ž¡ t||| ƒ q,|  
d|| ¡ ¡ d S )Nz
[{extra}]
rc   )r3   ÚioÚStringIOró   Zinstall_requiresÚextras_requireÚsortedrƒ   rª   Úvarsr|   Úgetvalue)rê   rë   r^   Zdistrz   rö   Zextrar.   r.   r/   Úwrite_requirementsÁ  s    
rú   c                 C   s,   t  ¡ }t|| jjƒ |  d|| ¡ ¡ d S )Nzsetup-requirements)rô   rõ   ró   r3   Zsetup_requiresr|   rù   )rê   rë   r^   rz   r.   r.   r/   Úwrite_setup_requirementsÌ  s    rû   c                 C   s:   t  dd„ | j ¡ D ƒ¡}|  d|d t|ƒ¡d ¡ d S )Nc                 S   s   g | ]}|  d d¡d ‘qS )Ú.r   r   )r   )r¹   Úkr.   r.   r/   rº   Ô  s   ÿz(write_toplevel_names.<locals>.<listcomp>ztop-level namesrç   )r]   Úfromkeysr3   Ziter_distribution_namesru   rj   r÷   )rê   rë   r^   Zpkgsr.   r.   r/   Úwrite_toplevel_namesÒ  s    þÿrÿ   c                 C   s   t | ||dƒ d S )NT)Ú	write_argrì   r.   r.   r/   Úoverwrite_argÜ  s    r  Fc                 C   sH   t j |¡d }t| j|d ƒ}|d ur4d |¡d }|  ||||¡ d S )Nr   rç   )r   r   Úsplitextrk   r3   rj   r|   )rê   rë   r^   r{   ÚargnamerZ   r.   r.   r/   r   à  s
    r   c                 C   s,   t  | jj¡}t  |¡}|  d||d¡ d S )Nzentry pointsT)r   rŒ   r3   r‹   Zrenderr|   )rê   rë   r^   ZepsZdefnr.   r.   r/   Úwrite_entriesè  s    
r  c                 C   sB   t  | ¡}t  |¡}|› d|› d|p&t› }|r>|d|› 7 }|S )rp   ú-z-py)r	   ri   r—   )rU   rV   rr   rs   r6   r=   Zeggr.   r.   r/   rq   î  s    

rq   c                   @   s   e Zd ZdZdS )ÚEggInfoDeprecationWarningz?Deprecated behavior warning for EggInfo, bypassing suppression.N)rG   rH   rI   Ú__doc__r.   r.   r.   r/   r  ø  s   r  )F)NN)<r  Zdistutils.filelistr   Z	_FileListZdistutils.errorsr   Zdistutils.utilr   re   r   r¥   r   r!   rÐ   rô   rD   r[   Z
_importlibr   r   r   r	   Z
setuptoolsr
   Zsetuptools.command.sdistr   r   Zsetuptools.command.setoptr   Zsetuptools.commandr   Zsetuptools.unicode_utilsrÍ   Zsetuptools.globr   Zsetuptools.externr   Zsetuptools.extern.jaraco.textr   Úwarningsr   rª   Úversion_infor—   r0   r1   rM   r’   ru   ré   rí   ró   rú   rû   rÿ   r  r   r  rq   r  r.   r.   r.   r/   Ú<module>   sZ   S* $ Qx
	



