<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
2aE                 @   s   d dl Z d dlZd dlT d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZmZ d dlmZ d dlT d dlmZ d d	lmZ d d
lmZ dd ZG dd deZdS )    N)*)glob)warn)Command)dir_utildep_util	file_utilarchive_util)TextFile)FileList)log)convert_pathc              C   sd   ddl m}  ddlm} g }x,|j D ] }|jd| d || d f q&W |j  | |jd d S )Nr   )FancyGetopt)ARCHIVE_FORMATSzformats=   z.List of available source distribution formats:)Zdistutils.fancy_getoptr   Zdistutils.archive_utilr   keysappendsort
print_help)r   r   formatsformat r   */opt/alt/python36/lib64/python3.6/sdist.pyshow_formats   s    r   c               @   s   e Zd ZdZdd ZdJdKdLdMdNdOdPdQdRdTdUdVdWdXgZd
ddddd"gZd*dd+efgZd
dd,Z	d-efgZ
d.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8d9 Zd:d; Zd<d= Zd>d? Zd@dA ZdBdC ZdDdE ZdFdG ZdHdI ZdS )Ysdistz6create a source distribution (tarball, zip file, etc.)c             C   s   | j S )N)metadata_check)selfr   r   r   checking_metadata%   s    zsdist.checking_metadata	template=t5name of manifest template file [default: MANIFEST.in]	manifest=m)name of manifest file [default: MANIFEST]use-defaultsNRinclude the default file set in the manifest [default; disable with --no-defaults]no-defaults"don't include the default file setprunespecifically 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oEjust regenerate the manifest and then stop (implies --force-manifest)force-manifestfkforcibly 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 zarchive file(s)	dist-dir=dFdirectory 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=gAGroup name used when creating a tar file [default: current group]zhelp-formatsz#list available distribution formats)zno-defaultszno-prunecheckc             C   sT   d | _ d | _d| _d| _d| _d| _dg| _d| _d | _d | _	d| _
d | _d | _d S )N   r   Zgztar)templatemanifestuse_defaultsr(   manifest_onlyZforce_manifestr   	keep_tempdist_dirarchive_filesr   ownergroup)r   r   r   r   initialize_options`   s    zsdist.initialize_optionsc             C   sZ   | j d krd| _ | jd kr d| _| jd tj| j}|rFtd| | jd krVd| _d S )NZMANIFESTzMANIFEST.inr   zunknown archive format '%s'Zdist)rD   rC   Zensure_string_listr	   Zcheck_archive_formatsr   ZDistutilsOptionErrorrH   )r   Z
bad_formatr   r   r   finalize_optionsw   s    




zsdist.finalize_optionsc             C   sB   t  | _x| j D ]}| j| qW | j  | jr6d S | j  d S )N)r   filelistZget_sub_commandsZrun_commandget_file_listrF   make_distribution)r   Zcmd_namer   r   r   run   s    z	sdist.runc             C   s*   t dt | jjd}|j  |j  d S )Nzadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadrA   )r   PendingDeprecationWarningdistributionZget_command_objZensure_finalizedrQ   )r   rA   r   r   r   check_metadata   s
    zsdist.check_metadatac             C   s   t jj| j}| r<| j r<| j  | jj  | jj  d S |sP| j	d| j  | jj
  | jrh| j  |rt| j  | jr| j  | jj  | jj  | j  d S )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_manifestrN   r   Zremove_duplicatesr   findallrE   add_defaultsread_templater(   prune_file_listwrite_manifest)r   Ztemplate_existsr   r   r   rO      s(    





zsdist.get_file_listc             C   s2  d| j jg}x|D ]}t|trn|}d}x*|D ]"}tjj|r.d}| jj| P q.W |s| j	ddj
|  qtjj|r| jj| q| j	d|  qW dd	g}x*|D ]"}ttjjt|}| jj| qW | jd
}| j j r| jj|j  x>|jD ]4\}	}
}}x$|D ]}| jjtjj
|
| qW  qW | j j rx|| j jD ]p}t|tr|t|}tjj|r| jj| n:|\}}x0|D ](}t|}tjj|r| jj| qW qHW | j j r| jd}| jj|j  | j j r| jd}| jj|j  | j j r.| jd}| jj|j  d S )NREADME
README.txtFTz,standard file not found: should have one of z, zstandard file '%s' not foundztest/test*.pyz	setup.cfgbuild_py	build_ext
build_clibbuild_scripts)r_   r`   )rS   Zscript_name
isinstancetuplerU   rV   existsrN   r   r   joinfilterrW   r   extendget_finalized_commandZhas_pure_modulesZget_source_filesZ
data_filesZhas_data_filesstrr   Zhas_ext_modulesZhas_c_librariesZhas_scripts)r   Z	standardsfnZaltsZgot_itZoptionalpatternfilesra   ZpkgZsrc_dirZ	build_dir	filenamesfilenameitemdirnamer0   rb   rc   rd   r   r   r   r[      s\    






"



zsdist.add_defaultsc             C   s   t jd| j t| jddddddd}zlxf|j }|d kr<P y| jj| W q* ttfk
r } z| j	d|j
|j|f  W Y d d }~X q*X q*W W d |j  X d S )Nzreading manifest template '%s'rB   )Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZcollapse_joinz%s, line %d: %s)r   inforC   r
   readlinerN   Zprocess_template_lineZDistutilsTemplateError
ValueErrorr   rq   Zcurrent_lineclose)r   rC   linemsgr   r   r   r\     s     

$zsdist.read_templatec             C   s   | j d}| jj }| jjd |jd | jjd |d tjdkrFd}nd}dddd	d
ddg}d|dj||f }| jj|dd d S )Nbuild)prefixwin32z/|\\/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*|rB   )Zis_regex)	rk   rS   get_fullnamerN   Zexclude_patternZ
build_basesysplatformrh   )r   rz   base_dirsepsZvcs_dirsZvcs_ptrnr   r   r   r]   :  s    


zsdist.prune_file_listc             C   sX   | j  rtjd| j  d S | jjd d  }|jdd | jtj	| j|fd| j  d S )Nz5not writing to manually maintained manifest file '%s'r   z*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rX   r   rt   rD   rN   ro   insertZexecuter   Z
write_file)r   Zcontentr   r   r   r^   R  s    
zsdist.write_manifestc          
   C   s<   t jj| jsdS t| j}z|j }W d |j  X |dkS )NFz+# file GENERATED by distutils, do NOT edit
)rU   rV   rW   rD   openru   rw   )r   fpZ
first_liner   r   r   rX   a  s    

z sdist._manifest_is_not_generatedc             C   sX   t jd| j t| j}x2|D ]*}|j }|jds| r<q| jj| qW |j  d S )Nzreading manifest file '%s'#)	r   rt   rD   r   strip
startswithrN   r   rw   )r   rD   rx   r   r   r   rY   m  s    

zsdist.read_manifestc             C   s   | j | tj||| jd ttdr4d}d| }nd }d| }|sPtjd n
tj| xD|D ]<}tj	j
|s~tjd| q`tj	j||}| j|||d q`W | jjj| d S )	N)dry_runlinkZhardzmaking hard links in %s...zcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r   )Zmkpathr   Zcreate_treer   hasattrrU   r   r   rt   rV   rW   rh   Z	copy_filerS   ZmetadataZwrite_pkg_info)r   r   ro   r   ry   filedestr   r   r   make_release_tree|  s     
	



zsdist.make_release_treec             C   s   | j j }tjj| j|}| j|| jj g }d| j	krT| j	j
| j	j| j	jd xD| j	D ]:}| j|||| j| jd}|j
| | j jj
dd|f q\W || _| jstj|| jd d S )NZtar)r   rJ   rK   r    )r   )rS   r   rU   rV   rh   rH   r   rN   ro   r   r   popindexZmake_archiverJ   rK   Z
dist_filesrI   rG   r   Zremove_treer   )r   r   Z	base_namerI   Zfmtr   r   r   r   rP     s    




zsdist.make_distributionc             C   s   | j S )N)rI   )r   r   r   r   get_archive_files  s    zsdist.get_archive_files)r   r   r    )r!   r"   r#   )r$   Nr%   )r&   Nr'   )r(   Nr)   )r*   Nr+   )r,   r-   r.   )r/   r0   r1   )r2   Nr3   @keep the distribution tree around after creating archive file(s))r4   r5   r   )r6   r7   r8   )r9   Nr:   )r;   r<   r=   )r>   r?   r@   )__name__
__module____qualname__descriptionr   Zuser_optionsZboolean_optionsr   Zhelp_optionsZnegative_optZsub_commandsrL   rM   rQ   rT   rO   r[   r\   r]   r^   rX   rY   r   rP   r   r   r   r   r   r   !   sj                  

(P*r   )rU   r   typesr   warningsr   Zdistutils.corer   Z	distutilsr   r   r   r	   Zdistutils.text_filer
   Zdistutils.errorsZdistutils.filelistr   r   Zdistutils.utilr   r   r   r   r   r   r   <module>   s   