Your IP : 18.118.33.239


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

U

�Qab��@s�ddlmZddlmmZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZeZddd�ZGd	d
�d
e
ej�ZdS)�)�logN)�six�)�sdist_add_defaults�ccs,t�d�D]}|��|�D]
}|Vqq
dS)z%Find all files under revision controlzsetuptools.file_findersN)�
pkg_resourcesZiter_entry_points�load)�dirnameZep�item�r�</usr/lib/python3.8/site-packages/setuptools/command/sdist.py�walk_revctrlsr
cs�eZdZdZdddgZiZddddgZed	d
�eD��Zdd�Z	d
d�Z
dd�Zdd�Ze
ejdd���Zdd�Zejdkp�dejko�dknp�dejko�dknZer�eZdd�Z�fdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z�ZS)*�sdistz=Smart sdist that finds anything supported by revision control)zformats=Nz6formats for source distribution (comma-separated list))z	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist]rz.rstz.txtz.mdccs|]}d�|�VqdS)z	README{0}N)�format)�.0Zextrrr�	<genexpr>)szsdist.<genexpr>cCs�|�d�|�d�}|j|_|j�tj�|jd��|��|�	�D]}|�|�qD|�
�t|jdg�}|j
D] }dd|f}||krp|�|�qpdS)N�egg_infozSOURCES.txt�
dist_filesrr)Zrun_command�get_finalized_command�filelist�append�os�path�joinr�check_readmeZget_sub_commands�make_distribution�getattr�distributionZ
archive_files)�selfZei_cmdZcmd_namer�file�datarrr�run+s



z	sdist.runcCstj�|�|��dS)N)�origr�initialize_options�_default_to_gztar�r rrrr%>szsdist.initialize_optionscCstjdkrdSdg|_dS)N)��rZbetarZgztar)�sys�version_infoZformatsr'rrrr&Cs
zsdist._default_to_gztarc	Cs$|���tj�|�W5QRXdS)z%
        Workaround for #516
        N)�_remove_os_linkr$rrr'rrrrIs
zsdist.make_distributionc
cs^Gdd�d�}ttd|�}zt`Wntk
r6YnXz
dVW5||k	rXttd|�XdS)zG
        In a context, remove and restore os.link if it exists
        c@seZdZdS)z&sdist._remove_os_link.<locals>.NoValueN)�__name__�
__module__�__qualname__rrrr�NoValueWsr0�linkN)rrr1�	Exception�setattr)r0Zorig_valrrrr,Ps
zsdist._remove_os_linkcCsLztj�|�Wn6tk
rFt��\}}}|jjjd�	��YnXdS)N�template)
r$r�
read_templater2r*�exc_info�tb_next�tb_frame�f_locals�close)r �_�tbrrrZ__read_template_hackeszsdist.__read_template_hack)��r=)r(r)r(r�)r(r=)r(r=rcs^|j��rZ|�d�}|j�|���|jjsZ|jD]&\}�}}|j��fdd�|D��q2dS)zgetting python files�build_pycsg|]}tj��|��qSr)rrr)r�filename�Zsrc_dirrr�
<listcomp>�s�z.sdist._add_defaults_python.<locals>.<listcomp>N)rZhas_pure_modulesrr�extendZget_source_filesZinclude_package_dataZ
data_files)r r@r;�	filenamesrrBr�_add_defaults_python|s

�zsdist._add_defaults_pythoncsDz tjrt�|�n
t���Wntk
r>t�d�YnXdS)Nz&data_files contains unexpected objects)rZPY2r�_add_defaults_data_files�super�	TypeErrorr�warnr'��	__class__rrrG�szsdist._add_defaults_data_filescCs8|jD]}tj�|�rdSq|�dd�|j��dS)Nz,standard file not found: should have one of z, )�READMESrr�existsrJr)r �frrrr�s

��zsdist.check_readmecCs^tj�|||�tj�|d�}ttd�rJtj�|�rJt�|�|�	d|�|�
d��|�dS)Nz	setup.cfgr1r)r$r�make_release_treerrr�hasattrrN�unlinkZ	copy_filerZsave_version_info)r Zbase_dir�files�destrrrrP�s
zsdist.make_release_treec	Cs@tj�|j�sdSt�|jd��}|��}W5QRX|d��kS)NF�rbz+# file GENERATED by distutils, do NOT edit
)rr�isfile�manifest�io�open�readline�encode)r �fpZ
first_linerrr�_manifest_is_not_generated�s�z sdist._manifest_is_not_generatedc	Cs�t�d|j�t|jd�}|D]d}tjr^z|�d�}Wn&tk
r\t�d|�YqYnX|�	�}|�
d�s|svq|j�|�q|�
�dS)z�Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'rUzUTF-8z"%r not UTF-8 decodable -- skipping�#N)r�inforWrYrZPY3�decode�UnicodeDecodeErrorrJ�strip�
startswithrrr:)r rW�linerrr�
read_manifest�s
zsdist.read_manifestcCs^|j�d�}|�dd�\}}|dkr2t�d�dStj�|�sNt�d|�dS|j	�
|�dS)zyChecks if license_file' is configured and adds it to
        'self.filelist' if the value contains a valid path.
        Zmetadata�license_file)NNNz''license_file' option was not specifiedz8warning: Failed to find the configured license file '%s')rZget_option_dict�getr�debugrrrNrJrr)r Zoptsr;rfrrr�
check_license�s
�zsdist.check_license)r-r.r/�__doc__Zuser_optionsZnegative_optZREADME_EXTENSIONS�tuplerMr#r%r&r�staticmethod�
contextlib�contextmanagerr,Z_sdist__read_template_hackr*r+Zhas_leaky_handler5rFrGrrPr]reri�
__classcell__rrrKrrs<�
��	


r)r)Z	distutilsrZdistutils.command.sdistZcommandrr$rr*rXrmZsetuptools.externrZ
py36compatrr�listZ_default_revctrlr
rrrr�<module>s


?>