AlkantarClanX12

Your IP : 13.59.234.182


Current Path : /opt/alt/python310/lib64/python3.10/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/command/__pycache__/sdist.cpython-310.opt-2.pyc

o

6��f=J�@s�	ddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZmZd
d�ZGdd�de�ZdS)�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCsb	ddlm}ddlm}g}|��D]}|�d|d||df�q|��||��d�dS)Nr)�FancyGetopt)�ARCHIVE_FORMATS�formats=�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�>/opt/alt/python310/lib64/python3.10/distutils/command/sdist.py�show_formatss
��rc@seZdZdZdd�Zgd�Zgd�ZdddefgZd	d
d�Z	defgZ
d
Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"dS):�sdistz6create a source distribution (tarball, zip file, etc.)cC�	|jS�N)�metadata_check��selfrrr�checking_metadata(�zsdist.checking_metadata))z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	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])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group])r$r&r(r*r,r/zhelp-formatsNz#list available distribution formatsr$r&)r%r'�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr&�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionses
zsdist.initialize_optionscCs^|jdurd|_|jdurd|_|�d�t�|j�}|r#td|��|jdur-d|_dSdS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r5r4Zensure_string_listrZcheck_archive_formatsrr
r9)rZ
bad_formatrrr�finalize_options|s


�

�zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jrdS|��dSr)r	�filelistZget_sub_commandsZrun_command�
get_file_listr7�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs,	tdt�|j�d�}|��|��dS)Nzadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr2)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedrB)rr2rrr�check_metadata�s�zsdist.check_metadatacCs�	tj�|j�}|s|��r|��|j��|j��dS|s(|�	d|j�|j�
�|jr4|��|r:|�
�|jrA|��|j��|j��|��dS)Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler4�_manifest_is_not_generated�
read_manifestr?rZremove_duplicatesr�findallr6�add_defaults�
read_templater&�prune_file_list�write_manifest)rZtemplate_existsrrrr@�s*


�


zsdist.get_file_listcCs>	|��|��|��|��|��|��|��dSr)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrL�s
zsdist.add_defaultscCs<	tj�|�s	dStj�|�}tj�|�\}}|t�|�vS)NF)rFrG�exists�abspath�split�listdir)�fspathrXZ	directory�filenamerrr�_cs_path_exists�szsdist._cs_path_existscCs�|j|jjg}|D]?}t|t�r5|}d}|D]}|�|�r'd}|j�|�nq|s4|�dd�	|��q	|�|�rA|j�|�q	|�d|�q	dS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrDZscript_name�
isinstance�tupler]r?rr�join)rZ	standards�fnZaltsZgot_itrrrrP�s(

���
�zsdist._add_defaults_standardscCs4ddg}|D]}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrFrGrHrr?�extend)rZoptional�pattern�filesrrrrQs
�zsdist._add_defaults_optionalcCs\|�d�}|j��r|j�|���|jD]\}}}}|D]
}|j�tj	�
||��qqdS)N�build_py)�get_finalized_commandrDZhas_pure_modulesr?rd�get_source_files�
data_filesrrFrGra)rrgZpkgZsrc_dirZ	build_dir�	filenamesr\rrrrRs

��zsdist._add_defaults_pythoncCs~|j��r;|jjD]3}t|t�r!t|�}tj�|�r |j	�
|�q	|\}}|D]}t|�}tj�|�r9|j	�
|�q'q	dSdSr)rDZhas_data_filesrjr_�strrrFrGrHr?r)r�item�dirnamerkr+rrrrS$s 

����zsdist._add_defaults_data_filescC�,|j��r|�d�}|j�|���dSdS)N�	build_ext)rDZhas_ext_modulesrhr?rdri)rrprrrrT5�

�zsdist._add_defaults_extcCro)N�
build_clib)rDZhas_c_librariesrhr?rdri)rrrrrrrU:rqzsdist._add_defaults_c_libscCro)N�
build_scripts)rDZhas_scriptsrhr?rdri)rrsrrrrV?rqzsdist._add_defaults_scriptsc
Cs�	t�d|j�t|jddddddd�}z;	|��}|durn*z|j�|�Wn ttfyG}z|�	d|j
|j|f�WYd}~nd}~wwqW|��dS|��w)Nzreading manifest template '%s'r3)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinTz%s, line %d: %s)
r
�infor4r�readliner?Zprocess_template_liner�
ValueErrorrr\Zcurrent_line�close)rr4�line�msgrrrrMDs.
�
����zsdist.read_templatecCs|	|�d�}|j��}|jjd|jd�|jjd|d�tjdkr$d}nd}gd�}d|d�|�|f}|jj|d	d
�dS)N�build)�prefixZwin32z/|\\�/)ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r3)Zis_regex)	rhrD�get_fullnamer?Zexclude_patternZ
build_base�sys�platformra)rrz�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrNas


zsdist.prune_file_listcCsZ	|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)Nz5not writing to manually maintained manifest file '%s'rz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rIr
rtr5r?rf�insertZexecuterZ
write_file)rZcontentrrrrOys��zsdist.write_manifestcCsBtj�|j�s	dSt|j�}z
|��}W|��|dkS|��w)NFz+# file GENERATED by distutils, do NOT edit
)rFrGrHr5�openrurw)r�fpZ
first_linerrrrI�s


�z sdist._manifest_is_not_generatedcCsn	t�d|j�t|j�� }|D]}|��}|�d�s|sq|j�|�qWd�dS1s0wYdS)Nzreading manifest file '%s'�#)r
rtr5r��strip�
startswithr?r)rr5rxrrrrJ�s�"�zsdist.read_manifestcCs�	|�|�tj|||jd�ttd�rd}d|}nd}d|}|s)t�d�nt�|�|D]}tj	�
|�s?t�d|�q0tj	�||�}|j|||d�q0|j
j�|�dS)	N��dry_run�linkZhardzmaking hard links in %s...zcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrFr
rrtrGrHraZ	copy_filerDZmetadataZwrite_pkg_info)rr�rfr�ry�file�destrrr�make_release_tree�s"

	

zsdist.make_release_treecCs�	|j��}tj�|j|�}|�||jj�g}d|j	vr+|j	�
|j	�|j	�d���|j	D]}|j
||||j|jd�}|�
|�|jj�
dd|f�q.||_|js\tj||jd�dSdS)NZtar)r�r;r<r�r�)rDr~rFrGrar9r�r?rfrr�pop�indexZmake_archiver;r<Z
dist_filesr:r8rZremove_treer�)rr�Z	base_namer:Zfmtr�rrrrA�s"
	


�
�zsdist.make_distributioncCrr)r:rrrr�get_archive_files�r!zsdist.get_archive_files)#�__name__�
__module__�__qualname__�descriptionr Zuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr^r=r>rBrEr@rL�staticmethodr]rPrQrRrSrTrUrVrMrNrOrIrJr�rAr�rrrrr$sJ'���
(
*r)rFrr�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>s