관리-도구
편집 파일: sdist.cpython-37.pyc
B ��Re=J � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddlm Z ddlmZ dd lm Z dd lmZ ddlmZ ddlmZ dd lmZmZ dd� ZG dd� de�ZdS )zadistutils.command.sdist Implements the Distutils 'sdist' command (create a source distribution).� N)�glob)�warn)�Command)�dir_util)� file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorc C sd ddl m} ddlm} g }x,|�� D ] }|�d| d|| d f� q&W |�� | |��d� dS )zoPrint all possible values for the 'formats' option (used by the "--help-formats" command-line option). r )�FancyGetopt)�ARCHIVE_FORMATSzformats=N� z.List of available source distribution formats:)�distutils.fancy_getoptr Zdistutils.archive_utilr �keys�append�sort� print_help)r r �formats�format� r ��/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/sdist.py�show_formats s r c @ s" e Zd ZdZdd� Zdddddd d ddd ddddgZddddddgZdddefgZddd�Z defgZ dZdd� Zd d!� Z d"d#� Zd$d%� Zd&d'� Zd(d)� Zed*d+� �Zd,d-� Zd.d/� Zd0d1� Zd2d3� Zd4d5� Zd6d7� Zd8d9� Zd:d;� Zd<d=� Zd>d?� Zd@dA� ZdBdC� ZdDdE� Z dFdG� Z!dHdI� Z"dS )J�sdistz6create a source distribution (tarball, zip file, etc.)c C s | j S )zYCallable used for the check sub-command. Placed here so user_options can view it)�metadata_check)�selfr r r �checking_metadata( s zsdist.checking_metadata)z template=�tz5name of manifest template file [default: MANIFEST.in])z manifest=�mz)name of manifest file [default: MANIFEST])zuse-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])zno-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])zno-pruneNz$don't automatically exclude anything)z manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))zforce-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)zformats=Nz6formats for source distribution (comma-separated list))z 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])zmetadata-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]zuse-defaultsr! z manifest-onlyzforce-manifestz keep-tempzmetadata-checkzhelp-formatsNz#list available distribution formats)zno-defaultszno-prune�check)ZREADMEz README.txtz README.rstc C sT d | _ d | _d| _d| _d| _d| _dg| _d| _d | _d | _ d| _ d | _d | _d S )N� r �gztar) �template�manifest�use_defaultsr! � manifest_onlyZforce_manifestr � keep_temp�dist_dir� archive_filesr �owner�group)r r r r �initialize_optionse s zsdist.initialize_optionsc C sZ | j d krd| _ | jd kr d| _| �d� t�| j�}|rFtd| ��| jd krVd| _d S )NZMANIFESTzMANIFEST.inr zunknown archive format '%s'�dist)r, r+ �ensure_string_listr �check_archive_formatsr r r0 )r Z bad_formatr r r �finalize_options| s zsdist.finalize_optionsc C sB t � | _x| �� D ]}| �|� qW | �� | jr6d S | �� d S )N)r �filelist�get_sub_commands�run_command� get_file_listr. �make_distribution)r �cmd_namer r r �run� s z sdist.runc C s* t dt� | j�d�}|�� |�� dS )zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated, use the check command insteadr( N)r �PendingDeprecationWarning�distribution�get_command_obj�ensure_finalizedr? )r r( r r r �check_metadata� s zsdist.check_metadatac C s� t j�| j�}|s:| �� r:| �� | j�� | j�� dS |sN| � d| j � | j� � | jrf| �� |rr| � � | jr�| �� | j�� | j�� | �� dS )aC Figure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options. Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler+ �_manifest_is_not_generated� read_manifestr9 r Zremove_duplicatesr �findallr- �add_defaults� read_templater! �prune_file_list�write_manifest)r Ztemplate_existsr r r r<