<!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

  \E                 @   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sortZ
print_help)r   r   formatsformat r   //usr/lib64/python3.6/distutils/command/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)rC   rB   Zensure_string_listr	   Zcheck_archive_formatsr   ZDistutilsOptionErrorrG   )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_listrE   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 insteadr@   )r   PendingDeprecationWarningdistributionZget_command_objZensure_finalizedrP   )r   r@   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isfilerB   _manifest_is_not_generatedread_manifestrM   r   Zremove_duplicatesr   findallrD   add_defaultsread_templater'   prune_file_listwrite_manifest)r   Ztemplate_existsr   r   r   rN      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_   )rR   Zscript_name
isinstancetuplerT   rU   existsrM   r   r   joinfilterrV   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filesr`   ZpkgZsrc_dirZ	build_dir	filenamesfilenameitemdirnamer/   ra   rb   rc   r   r   r   rZ      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'rA   )Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZcollapse_joinz%s, line %d: %s)r   inforB   r
   readlinerM   Zprocess_template_lineZDistutilsTemplateError
ValueErrorr   rp   Zcurrent_lineclose)r   rB   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)prefixZwin32z/|\\/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*|rA   )Zis_regex)	rj   rR   get_fullnamerM   Zexclude_patternZ
build_basesysplatformrg   )r   ry   base_dirZ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')
rW   r   rs   rC   rM   rn   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
)rT   rU   rV   rC   openrt   rv   )r   fpZ
first_liner   r   r   rW   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   rs   rC   r   strip
startswithrM   r   rv   )r   rC   rw   r   r   r   rX   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   hasattrrT   r   r   rs   rU   rV   rg   Z	copy_filerR   ZmetadataZwrite_pkg_info)r   r   rn   r   rx   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   rI   rJ   r    )r   )rR   r}   rT   rU   rg   rG   r   rM   rn   r   r   popindexZmake_archiverI   rJ   Z
dist_filesrH   rF   r   Zremove_treer   )r   r   Z	base_namerH   Zfmtr   r   r   r   rO     s    




zsdist.make_distributionc             C   s   | j S )N)rH   )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.   r/   r0   )r1   Nr2   @keep the distribution tree around after creating archive file(s))r3   r4   r   )r5   r6   r7   )r8   Nr9   )r:   r;   r<   )r=   r>   r?   )__name__
__module____qualname__Zdescriptionr   Zuser_optionsZboolean_optionsr   Zhelp_optionsZnegative_optZsub_commandsrK   rL   rP   rS   rN   rZ   r[   r\   r]   rW   rX   r   rO   r   r   r   r   r   r   !   sj                  

(P*r   )rT   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   