관리-도구
편집 파일: sdist.cpython-36.opt-2.pyc
3 ��2a�E � @ s� d dl Z d dlZd dlT d dlmZ d dlmZ d dlmZ d dlm Z m Z mZmZ d dl mZ d dlT d dlmZ d d lmZ d d lmZ dd� ZG d d� de�ZdS )� N)�*)�glob)�warn)�Command)�dir_util�dep_util� file_util�archive_util)�TextFile)�FileList)�log)�convert_pathc C sd ddl m} ddlm} g }x,|j� D ] }|jd| d || d f� q&W |j� | |�jd� d S )Nr )�FancyGetopt)�ARCHIVE_FORMATSzformats=� z.List of available source distribution formats:)Zdistutils.fancy_getoptr Zdistutils.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 Zd ZdZdd� ZdJdKdLdMdNdOdPdQdRdTdUdVdWdXgZd ddddd"gZd*dd+efgZd dd,�Z d-efgZ d.d/� Zd0d1� Zd2d3� 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.)c C s | j S )N)�metadata_check)�selfr r r �checking_metadata% s zsdist.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]zhelp-formatsz#list available distribution formats)zno-defaultszno-prune�checkc C sT d | _ d | _d| _d| _d| _d| _dg| _d| _d | _d | _ d| _ d | _d | _d S )N� r Zgztar) �template�manifest�use_defaultsr( � manifest_onlyZforce_manifestr � keep_temp�dist_dir� archive_filesr �owner�group)r r r r �initialize_options` s zsdist.initialize_optionsc C sZ | j d krd| _ | jd kr d| _| jd� tj| j�}|rFtd| ��| jd krVd| _d S )NZMANIFESTzMANIFEST.inr zunknown archive format '%s'Zdist)rD rC Zensure_string_listr Zcheck_archive_formatsr ZDistutilsOptionErrorrH )r Z bad_formatr r r �finalize_optionsw s zsdist.finalize_optionsc C sB t � | _x| j� D ]}| j|� qW | j� | jr6d S | j� d S )N)r �filelistZget_sub_commandsZrun_command� get_file_listrF �make_distribution)r Zcmd_namer r r �run� s z sdist.runc C s* t dt� | jjd�}|j� |j� d S )Nzadistutils.command.sdist.check_metadata is deprecated, use the check command insteadrA )r �PendingDeprecationWarning�distributionZget_command_objZensure_finalizedrQ )r rA r r r �check_metadata� s zsdist.check_metadatac C s� t jj| j�}| r<| j� r<| j� | jj� | jj� d S |sP| j d| j � | jj � | jrh| j� |rt| j � | jr�| j� | jj� | jj� | 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 Zremove_duplicatesr �findallrE �add_defaults� read_templater( �prune_file_list�write_manifest)r Ztemplate_existsr r r rO � s( zsdist.get_file_listc C s2 d| j jg}x�|D ]�}t|t�rn|}d}x*|D ]"}tjj|�r.d}| jj|� P q.W |s�| j ddj |� � qtjj|�r�| jj|� q| j d| � qW dd g}x*|D ]"}ttjjt |��}| jj|� q�W | jd �}| j j� r�| jj|j� � x>|jD ]4\} } }}x$|D ]} | jjtjj | | �� �qW � q�W | j j� �r�x|| j jD ]p}t|t��r|t|�}tjj|��r�| jj|� n:|\}}x0|D ](}t|�}tjj|��r�| jj|� �q�W �qHW | j j� �r�| jd�}| jj|j� � | j j� �r| jd�}| jj|j� � | j j� �r.| jd �}| jj|j� � d S )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` )rS Zscript_name� isinstance�tuplerU rV �existsrN r r �join�filterrW r �extend�get_finalized_commandZhas_pure_modulesZget_source_filesZ data_filesZhas_data_files�strr Zhas_ext_modulesZhas_c_librariesZhas_scripts)r Z standards�fnZaltsZgot_itZoptional�pattern�filesra ZpkgZsrc_dirZ build_dir� filenames�filename�item�dirnamer0 rb rc rd r r r r[ � s\ " zsdist.add_defaultsc C s� t jd| j� t| jddddddd�}zlxf|j� }|d kr<P y| jj|� W q* ttfk r� } z| j d|j |j|f � W Y d d }~X q*X q*W W d |j� X d S )Nzreading manifest template '%s'rB )Zstrip_commentsZskip_blanksZ join_linesZ lstrip_wsZ rstrip_wsZ collapse_joinz%s, line %d: %s) r �inforC r �readlinerN Zprocess_template_lineZDistutilsTemplateError� ValueErrorr rq Zcurrent_line�close)r rC �line�msgr r r r\ s $zsdist.read_templatec C s� | j d�}| jj� }| jjd |jd� | jjd |d� tjdkrFd}nd}dddd d ddg}d |dj|�|f }| jj|dd� d S )N�build)�prefix�win32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|rB )Zis_regex) rk rS �get_fullnamerN Zexclude_patternZ build_base�sys�platformrh )r rz �base_dir�sepsZvcs_dirsZvcs_ptrnr r r r] : s zsdist.prune_file_listc C sX | j � rtjd| j � d S | jjd d � }|jdd� | jtj | j|fd| j � d S )Nz5not writing to manually maintained manifest file '%s'r z*# file GENERATED by distutils, do NOT editzwriting manifest file '%s') rX r rt rD rN ro �insertZexecuter Z write_file)r Zcontentr r r r^ R s zsdist.write_manifestc C s<