Your IP : 18.118.164.100


Current Path : /lib/python3.8/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //lib/python3.8/site-packages/setuptools/command/__pycache__/egg_info.cpython-38.pyc

U

�Qab�c�@s�dZddlmZddlmZddlmZddlm	Z	ddlZddlZddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'm(Z(ddl)m*Z*ddlm+Z+ddlm,Z,dd�Z-Gdd�d�Z.Gdd�de.e�Z/Gdd�de�ZGdd�de�Z0dd�Z1dd�Z2d d!�Z3d"d#�Z4d$d%�Z5d&d'�Z6d(d)�Z7d*d+�Z8d5d-d.�Z9d/d0�Z:d1d2�Z;Gd3d4�d4e,�Z<dS)6zUsetuptools.command.egg_info

Create a distribution's .egg-info directory and contents�)�FileList)�DistutilsInternalError)�convert_path)�logN)�six)�map)�Command)�sdist)�walk_revctrl)�edit_config)�	bdist_egg)�parse_requirements�	safe_name�
parse_version�safe_version�yield_lines�
EntryPoint�iter_entry_points�to_filename)�glob)�	packaging)�SetuptoolsDeprecationWarningcCs�d}|�tjj�}t�tj�}d|f}t|�D�]�\}}|t|�dk}|dkrr|r`|d7}q0|d||f7}q0d}t|�}	||	k�r�||}
|
dkr�||d7}�n|
d	kr�||7}n�|
d
k�r�|d}||	kr�||dkr�|d}||	k�r||dk�r|d}||	k�r,||dk�r,|d}�q||	k�rF|t�|
�7}nR||d|�}d}
|ddk�rxd
}
|dd�}|
t�|�7}
|d|
f7}|}n|t�|
�7}|d7}q~|s0||7}q0|d7}tj|tj	tj
Bd�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)rZpatZchunksr%Z
valid_char�c�chunkZ
last_chunk�iZ	chunk_len�charZinner_i�innerZ
char_class�r2�?/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py�translate_pattern$sV







r4c@s8eZdZdZdZedd��Zdd�Zdd�Zee�Z	dS)�
InfoCommonNcCst|j���S�N)r�distributionZget_name��selfr2r2r3�name{szInfoCommon.namecCs2|j��}|jr$|�|j�r$t|�St||j�Sr6)r7Zget_version�vtags�endswithr�r9�versionr2r2r3�tagged_versions
zInfoCommon.tagged_versioncCs,d}|jr||j7}|jr(|t�d�7}|S)Nrz-%Y%m%d)�	tag_build�tag_date�time�strftimer=r2r2r3�tags�s
zInfoCommon.tags)
�__name__�
__module__�__qualname__r@rA�propertyr:r?rDr;r2r2r2r3r5ws
r5c@s�eZdZdZddddgZdgZddiZdd	�Zed
d��Z	e	j
dd��Z	d
d�Zdd�Zddd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS) �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]rKrNcCs"d|_d|_d|_d|_d|_dS)NF)�egg_base�egg_namerI�egg_version�broken_egg_infor8r2r2r3�initialize_options�s
zegg_info.initialize_optionscCsdSr6r2r8r2r2r3�tag_svn_revision�szegg_info.tag_svn_revisioncCsdSr6r2)r9�valuer2r2r3rU�scCs0t��}|��|d<d|d<t|t|d��dS)z�
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        r@rrA)rIN)�collections�OrderedDictrDr�dict)r9�filenamerIr2r2r3�save_version_info�szegg_info.save_version_infocCsB|j|_|��|_t|j�}z6t|tjj�}|r4dnd}t	t
||j|jf��Wn,tk
r~tj
�d|j|jf��YnX|jdkr�|jj}|p�i�dtj�|_|�d�t|j�d|_|jtjkr�tj�|j|j�|_d|jkr�|��|j|jj_|jj}|dk	�r>|j|j��k�r>|j|_t|j�|_ d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrP�	.egg-info�-)!r:rQr?rRr�
isinstancerr>ZVersion�listr
�
ValueError�	distutils�errorsZDistutilsOptionErrorrPr7Zpackage_dir�getr#�curdirZensure_dirnamerrIr$�join�check_broken_egg_info�metadataZ
_patched_dist�key�lowerZ_versionZ_parsed_version)r9Zparsed_versionZ
is_version�spec�dirsZpdr2r2r3�finalize_options�s>


��
��



zegg_info.finalize_optionsFcCsL|r|�|||�n4tj�|�rH|dkr>|s>t�d||�dS|�|�dS)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)r9�whatrZ�data�forcer2r2r3�write_or_delete_file�s	�zegg_info.write_or_delete_filecCsDt�d||�tjr|�d�}|js@t|d�}|�|�|��dS)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.
        zwriting %s to %s�utf-8�wbN)	r�inforZPY3�encode�dry_run�open�write�close)r9rqrZrr�fr2r2r3rms


zegg_info.write_filecCs t�d|�|jst�|�dS)z8Delete `filename` (if not a dry run) after announcing itzdeleting %sN)rrwryr#�unlink)r9rZr2r2r3rpszegg_info.delete_filecCs�|�|j�t�|jd�|jj}td�D]4}|j|d�|��}|||j	tj
�|j|j	��q*tj
�|jd�}tj
�|�r�|�
|�|��dS)Nzegg_info.writers)�	installerznative_libs.txt)ZmkpathrIr#�utimer7Zfetch_build_eggrZrequireZresolver:r$rernrp�find_sources)r9r�ep�writer�nlr2r2r3�runs
zegg_info.runcCs4tj�|jd�}t|j�}||_|��|j|_dS)z"Generate SOURCES.txt manifest filezSOURCES.txtN)	r#r$rerI�manifest_makerr7�manifestr��filelist)r9Zmanifest_filenameZmmr2r2r3r�*s

zegg_info.find_sourcescCsT|jd}|jtjkr&tj�|j|�}tj�|�rPt�d||j	�|j	|_
||_	dS)Nr\aB------------------------------------------------------------------------------
Note: Your current .egg-info directory has a '-' in its name;
this will not work correctly with "setup.py develop".

Please rename %s to %s to correct this problem.
------------------------------------------------------------------------------)rQrPr#rdr$rernrrorIrS)r9Zbeir2r2r3rf2s
�zegg_info.check_broken_egg_infoN)F)rErFrG�descriptionZuser_optionsZboolean_optionsZnegative_optrTrHrU�setterr[rlrtrmrpr�r�rfr2r2r2r3rI�s.��



1
rIc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)rcCs |�|�\}}}}|dkrR|�dd�|��|D]}|�|�s2t�d|�q2�n�|dkr�|�dd�|��|D]}|�|�srt�d|�qr�n�|dkr�|�d	d�|��|D]}|�|�s�t�d
|�q��nJ|dk�r|�dd�|��|D]}|�|�s�t�d
|�q�n|dk�r`|�d|d�|�f�|D]"}|�	||��s:t�d||��q:n�|dk�r�|�d|d�|�f�|D]"}|�
||��s�t�d||��q�np|dk�r�|�d|�|�|��st�d|�n>|dk�r|�d|�|�|��st�d|�nt
d|��dS)N�includezinclude � z%warning: no files found matching '%s'�excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'�graftzgraft z+warning: no directories found matching '%s'�prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_line�debug_printrer�rror��global_include�global_exclude�recursive_include�recursive_excluder�r�r)r9�line�actionZpatterns�dirZdir_pattern�patternr2r2r3�process_template_lineEs|

�

�


�

��

��

�
��zFileList.process_template_linecCsRd}tt|j�ddd�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�)r9Z	predicate�foundr/r2r2r3�
_remove_files�szFileList._remove_filescCs$dd�t|�D�}|�|�t|�S)z#Include files that match 'pattern'.cSsg|]}tj�|�s|�qSr2�r#r$�isdir��.0r}r2r2r3�
<listcomp>�sz$FileList.include.<locals>.<listcomp>�r�extend�bool�r9r�r�r2r2r3r��s
zFileList.includecCst|�}|�|j�S)z#Exclude files that match 'pattern'.)r4r��match�r9r�r�r2r2r3r��szFileList.excludecCs8tj�|d|�}dd�t|dd�D�}|�|�t|�S)zN
        Include all files anywhere in 'dir/' that match the pattern.
        rcSsg|]}tj�|�s|�qSr2r�r�r2r2r3r��s�z.FileList.recursive_include.<locals>.<listcomp>T)�	recursive)r#r$rerr�r�)r9r�r�Zfull_patternr�r2r2r3r��s
zFileList.recursive_includecCs ttj�|d|��}|�|j�S)zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        r�r4r#r$rer�r�)r9r�r�r�r2r2r3r��szFileList.recursive_excludecCs$dd�t|�D�}|�|�t|�S)zInclude all files from 'dir/'.cSs"g|]}tj�|�D]}|�qqSr2)rar��findall)r�Z	match_dir�itemr2r2r3r��s�z"FileList.graft.<locals>.<listcomp>r�)r9r�r�r2r2r3r��s
�
zFileList.graftcCsttj�|d��}|�|j�S)zFilter out files from 'dir/'.rr�)r9r�r�r2r2r3r��szFileList.prunecsJ|jdkr|��ttj�d|����fdd�|jD�}|�|�t|�S)z�
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nrcsg|]}��|�r|�qSr2�r�r�r�r2r3r��s
z+FileList.global_include.<locals>.<listcomp>)Zallfilesr�r4r#r$rer�r�r�r2r�r3r��s

zFileList.global_includecCsttj�d|��}|�|j�S)zD
        Exclude all files anywhere that match the pattern.
        rr�r�r2r2r3r��szFileList.global_excludecCs8|�d�r|dd�}t|�}|�|�r4|j�|�dS)N�
r�)r<r�
_safe_pathr��append)r9r�r$r2r2r3r��s


zFileList.appendcCs|j�t|j|��dSr6)r�r��filterr�)r9�pathsr2r2r3r��szFileList.extendcCstt|j|j��|_dS)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)r_r�r�r�r8r2r2r3�_repair�szFileList._repairc	Cs�d}t�|�}|dkr(t�d|�dSt�|d�}|dkrNt�||d�dSz"tj�|�shtj�|�rnWdSWn&tk
r�t�||t	�
��YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFruT)�
unicode_utils�filesys_decoderroZ
try_encoder#r$rn�UnicodeEncodeError�sys�getfilesystemencoding)r9r$Zenc_warnZu_pathZ	utf8_pathr2r2r3r��s

zFileList._safe_pathN)rErFrGr�r�r�r�r�r�r�r�r�r�r�r�r�r�r2r2r2r3rBsI



rc@s\eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
dd��Zdd�Zdd�Z
dS)r�zMANIFEST.incCsd|_d|_d|_d|_dS)Nr)Zuse_defaultsr�Z
manifest_onlyZforce_manifestr8r2r2r3rT	sz!manifest_maker.initialize_optionscCsdSr6r2r8r2r2r3rlszmanifest_maker.finalize_optionscCsdt�|_tj�|j�s|��|��tj�|j�r<|�	�|�
�|j��|j��|��dSr6)
rr�r#r$rnr��write_manifest�add_defaults�templateZ
read_template�prune_file_list�sortZremove_duplicatesr8r2r2r3r�s

zmanifest_maker.runcCst�|�}|�tjd�S)N�/)r�r��replacer#r%)r9r$r2r2r3�_manifest_normalizes
z"manifest_maker._manifest_normalizecsB�j���fdd��jjD�}d�j}��t�j|f|�dS)zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        csg|]}��|��qSr2)r�r�r8r2r3r�*sz1manifest_maker.write_manifest.<locals>.<listcomp>zwriting manifest file '%s'N)r�r�r�r�Zexecuterm)r9r��msgr2r8r3r�"s

zmanifest_maker.write_manifestcCs|�|�st�||�dSr6)�_should_suppress_warningr	ro)r9r�r2r2r3ro.s
zmanifest_maker.warncCst�d|�S)z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r&r�)r�r2r2r3r�2sz'manifest_maker._should_suppress_warningcCs�t�|�|��|j�|j�|j�|j�tt��}|rJ|j�	|�nt
j�|j�r`|�
�t
j�d�rx|j�d�|�d�}|j�|j�dS)Nzsetup.pyrI)r	r�Z
check_licenser�r�r�r�r_r
r�r#r$rnZ
read_manifest�get_finalized_commandr�rI)r9ZrcfilesZei_cmdr2r2r3r�9s


zmanifest_maker.add_defaultscCsZ|�d�}|j��}|j�|j�|j�|�t�tj	�}|jj
d|d|dd�dS)N�buildz(^|z)(RCS|CVS|\.svn)r)Zis_regex)r�r7Zget_fullnamer�r�Z
build_baser&r'r#r%Zexclude_pattern)r9r�Zbase_dirr%r2r2r3r�Ls

�zmanifest_maker.prune_file_listN)rErFrGr�rTrlr�r�r�ro�staticmethodr�r�r�r2r2r2r3r�s
r�c	Cs8d�|�}|�d�}t|d��}|�|�W5QRXdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    �
rurvN)rerxrzr{)rZ�contentsr}r2r2r3rmVs

rmc	Cs|t�d|�|jsx|jj}|j|j|_}|j|j|_}z|�	|j
�W5|||_|_Xt|jdd�}t�
|j
|�dS)Nz
writing %sZzip_safe)rrwryr7rgrRr>rQr:�write_pkg_inforI�getattrrZwrite_safety_flag)�cmd�basenamerZrgZoldverZoldnameZsafer2r2r3r�csr�cCstj�|�rt�d�dS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)r#r$rnrro�r�r�rZr2r2r3�warn_depends_obsoletevs�r�cCs,t|pd�}dd�}t||�}|�|�dS)Nr2cSs|dS)Nr�r2)r�r2r2r3�<lambda>��z%_write_requirements.<locals>.<lambda>)rr�
writelines)�streamZreqs�linesZ	append_crr2r2r3�_write_requirements~s
r�cCsj|j}t��}t||j�|jp"i}t|�D]&}|�djft	���t|||�q,|�
d||���dS)Nz
[{extra}]
Zrequirements)r7r�StringIOr�Zinstall_requires�extras_require�sortedr{�format�varsrt�getvalue)r�r�rZZdistrrr�Zextrar2r2r3�write_requirements�s
r�cCs,t��}t||jj�|�d||���dS)Nzsetup-requirements)�ior�r�r7Zsetup_requiresrtr�)r�r�rZrrr2r2r3�write_setup_requirements�sr�cCs:t�dd�|j��D��}|�d|d�t|��d�dS)NcSsg|]}|�dd�d�qS)�.rr)r")r��kr2r2r3r��s�z(write_toplevel_names.<locals>.<listcomp>ztop-level namesr�)rY�fromkeysr7Ziter_distribution_namesrmrer�)r�r�rZZpkgsr2r2r3�write_toplevel_names�s��r�cCst|||d�dS)NT)�	write_argr�r2r2r3�
overwrite_arg�sr�FcCsHtj�|�d}t|j|d�}|dk	r4d�|�d}|�||||�dS)Nrr�)r#r$�splitextr�r7rert)r�r�rZrs�argnamerVr2r2r3r��s
r�cCs�|jj}t|tj�s|dkr"|}nn|dk	r�g}t|���D]J\}}t|tj�srt�||�}d�	tt
t|�����}|�
d||f�q:d�	|�}|�d||d�dS)Nr�z	[%s]
%s

rzentry pointsT)r7Zentry_pointsr^rZstring_typesr��itemsrZparse_grouprer�str�valuesr�rt)r�r�rZr�rrZsectionr�r2r2r3�
write_entries�s
r�c
Csjt�dt�tj�d�rft�d��>}|D]2}t�	d|�}|r(t
|�d��W5QR�Sq(W5QRXdS)zd
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rr)�warningsro�EggInfoDeprecationWarningr#r$rnr�rzr&r��int�group)r}r�r�r2r2r3�get_pkg_info_revision�s*r�c@seZdZdZdS)r�zqClass for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.N)rErFrG�__doc__r2r2r2r3r��sr�)F)=r�Zdistutils.filelistrZ	_FileListZdistutils.errorsrZdistutils.utilrrarr#r&r�r�r�rBrWZsetuptools.externrZsetuptools.extern.six.movesrZ
setuptoolsrZsetuptools.command.sdistr	r
Zsetuptools.command.setoptrZsetuptools.commandrZ
pkg_resourcesr
rrrrrrrZsetuptools.unicode_utilsr�Zsetuptools.globrrrr4r5rIr�rmr�r�r�r�r�r�r�r�r�r�r�r2r2r2r3�<module>sX(S2EP




?>