Your IP : 18.117.94.221


Current Path : /opt/alt/python36/lib64/python3.6/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/distutils/command/__pycache__/sdist.cpython-36.opt-2.pyc

3

��2a�E�@s�ddlZddlZddlTddlmZddlmZddlmZddlm	Z	m
Z
mZmZddl
mZddlTddlmZdd	lmZdd
lmZdd�ZGd
d�de�ZdS)�N)�*)�glob)�warn)�Command)�dir_util�dep_util�	file_util�archive_util)�TextFile)�FileList)�log)�convert_pathcCsdddlm}ddlm}g}x,|j�D] }|jd|d||df�q&W|j�||�jd�dS)Nr)�FancyGetopt)�ARCHIVE_FORMATSzformats=�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sort�
print_help)rr�formats�format�r�*/opt/alt/python36/lib64/python3.6/sdist.py�show_formatssrc@s�eZdZdZdd�ZdJdKdLdMdNdOdPdQdRdTdUdVdWdXgZd
ddddd"gZd*dd+efgZd
dd,�Z	d-efgZ
d.d/�Zd0d1�Zd2d3�Z
d4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�ZdHdI�ZdS)Y�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)N)�metadata_check)�selfrrr�checking_metadata%szsdist.checking_metadata�	template=�t�5name of manifest template file [default: MANIFEST.in]�	manifest=�m�)name of manifest file [default: MANIFEST]�use-defaultsN�Rinclude the default file set in the manifest [default; disable with --no-defaults]�no-defaults�"don't include the default file set�prune��specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune]�no-prune�$don't automatically exclude anything�
manifest-only�o�Ejust regenerate the manifest and then stop (implies --force-manifest)�force-manifest�f�kforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.�formats=�6formats for source distribution (comma-separated list)�	keep-temp�kz1keep the distribution tree around after creating zarchive file(s)�	dist-dir=�d�Fdirectory to put the source distribution archive(s) in [default: dist]�metadata-check�[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default]�owner=�u�@Owner name used when creating a tar file [default: current user]�group=�g�AGroup name used when creating a tar file [default: current group]zhelp-formatsz#list available distribution formats)zno-defaultszno-prune�checkcCsTd|_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�group)rrrr�initialize_options`szsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|jd�tj|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)rDrCZensure_string_listr	Zcheck_archive_formatsrZDistutilsOptionErrorrH)rZ
bad_formatrrr�finalize_optionsws




zsdist.finalize_optionscCsBt�|_x|j�D]}|j|�qW|j�|jr6dS|j�dS)N)r�filelistZget_sub_commandsZrun_command�
get_file_listrF�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|jjd�}|j�|j�dS)Nzadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadrA)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedrQ)rrArrr�check_metadata�s
zsdist.check_metadatacCs�tjj|j�}|r<|j�r<|j�|jj�|jj�dS|sP|j	d|j�|jj
�|jrh|j�|rt|j
�|jr�|j�|jj�|jj�|j�dS)Nz&manifest template '%s' does not exist z(using default file list)z?manifest template '%s' does not exist (using default file list))�os�path�isfilerC�_manifest_is_not_generated�
read_manifestrNrZremove_duplicatesr�findallrE�add_defaults�
read_templater(�prune_file_list�write_manifest)rZtemplate_existsrrrrO�s(





zsdist.get_file_listcCs2d|jjg}x�|D]�}t|t�rn|}d}x*|D]"}tjj|�r.d}|jj|�Pq.W|s�|j	ddj
|��qtjj|�r�|jj|�q|j	d|�qWdd	g}x*|D]"}ttjjt
|��}|jj|�q�W|jd
�}|jj�r�|jj|j��x>|jD]4\}	}
}}x$|D]}
|jjtjj
|
|
���qW�q�W|jj��r�x||jjD]p}t|t��r|t|�}tjj|��r�|jj|�n:|\}}x0|D](}t|�}tjj|��r�|jj|��q�W�qHW|jj��r�|jd�}|jj|j��|jj��r|jd�}|jj|j��|jj��r.|jd
�}|jj|j��dS)N�README�
README.txtFTz,standard file not found: should have one of z, zstandard file '%s' not foundz
test/test*.pyz	setup.cfg�build_py�	build_ext�
build_clib�
build_scripts)r_r`)rSZscript_name�
isinstance�tuplerUrV�existsrNrr�join�filterrWr�extend�get_finalized_commandZhas_pure_modulesZget_source_filesZ
data_filesZhas_data_files�strr
Zhas_ext_modulesZhas_c_librariesZhas_scripts)rZ	standards�fnZaltsZgot_itZoptional�pattern�filesraZpkgZsrc_dirZ	build_dir�	filenames�filename�item�dirnamer0rbrcrdrrrr[�s\






"



zsdist.add_defaultscCs�tjd|j�t|jddddddd�}zlxf|j�}|dkr<Py|jj|�Wq*ttfk
r�}z|j	d|j
|j|f�WYdd}~Xq*Xq*WWd|j�XdS)Nzreading manifest template '%s'rB)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinz%s, line %d: %s)
r�inforCr
�readlinerNZprocess_template_lineZDistutilsTemplateError�
ValueErrorrrqZcurrent_line�close)rrC�line�msgrrrr\s 

$zsdist.read_templatecCs�|jd�}|jj�}|jjd|jd�|jjd|d�tjdkrFd}nd}dddd	d
ddg}d
|dj|�|f}|jj|dd�dS)N�build)�prefix�win32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|rB)Zis_regex)	rkrS�get_fullnamerNZexclude_patternZ
build_base�sys�platformrh)rrz�base_dir�sepsZvcs_dirsZvcs_ptrnrrrr]:s


zsdist.prune_file_listcCsX|j�rtjd|j�dS|jjdd�}|jdd�|jtj	|j|fd|j�dS)Nz5not writing to manually maintained manifest file '%s'rz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rXrrtrDrNro�insertZexecuterZ
write_file)rZcontentrrrr^Rs
zsdist.write_manifestc
Cs<tjj|j�sdSt|j�}z|j�}Wd|j�X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rUrVrWrD�openrurw)r�fpZ
first_linerrrrXas

z sdist._manifest_is_not_generatedcCsXtjd|j�t|j�}x2|D]*}|j�}|jd�s|r<q|jj|�qW|j�dS)Nzreading manifest file '%s'�#)	rrtrDr��strip�
startswithrNrrw)rrDrxrrrrYms

zsdist.read_manifestcCs�|j|�tj|||jd�ttd�r4d}d|}nd}d|}|sPtjd�n
tj|�xD|D]<}tj	j
|�s~tjd|�q`tj	j||�}|j|||d�q`W|j
jj|�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��hasattrrUrrrtrVrWrhZ	copy_filerSZmetadataZwrite_pkg_info)rr�ror�ry�file�destrrr�make_release_tree|s 
	



zsdist.make_release_treecCs�|jj�}tjj|j|�}|j||jj�g}d|j	krT|j	j
|j	j|j	jd���xD|j	D]:}|j
||||j|jd�}|j
|�|jjj
dd|f�q\W||_|js�tj||jd�dS)NZtar)r�rJrKr�)r�)rSrrUrVrhrHr�rNrorr�pop�indexZmake_archiverJrKZ
dist_filesrIrGrZremove_treer�)rr�Z	base_namerIZfmtr�rrrrP�s




zsdist.make_distributioncCs|jS)N)rI)rrrr�get_archive_files�szsdist.get_archive_files)rrr )r!r"r#)r$Nr%)r&Nr')r(Nr))r*Nr+)r,r-r.)r/r0r1)r2Nr3�@keep the distribution tree around after creating archive file(s))r4r5r�)r6r7r8)r9Nr:)r;r<r=)r>r?r@)�__name__�
__module__�__qualname__�descriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsrLrMrQrTrOr[r\r]r^rXrYr�rPr�rrrrr!sj

(P*r)rUr��typesr�warningsrZdistutils.corerZ	distutilsrrrr	Zdistutils.text_filer
Zdistutils.errorsZdistutils.filelistrrZdistutils.utilr
rrrrrr�<module>s

?>