Yf-G@sdZddlZddlZddlZddlTddlmZddlmZddlm Z ddl m Z m Z m Z mZddlmZddlTdd lmZdd l mZdd lmZd d ZGddde ZdS)zadistutils.command.sdist Implements the Distutils 'sdist' command (create a source distribution).N)*)glob)warn)Command)dir_utildep_util file_util archive_util)TextFile)FileList)log) convert_pathcCsddlm}ddlm}g}x6|jD](}|jd|d||dfq3W|j||jddS)zoPrint all possible values for the 'formats' option (used by the "--help-formats" command-line option). r) FancyGetopt)ARCHIVE_FORMATSzformats=Nz.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilrkeysappendsortZ print_help)rrformatsformatrZd?d@ZdAdBZdCdDZdEdFZdGdHZdIdJZdKdLZd S)Zsdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command. Placed here so user_options can view it)metadata_check)selfrrrchecking_metadata&szsdist.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 setprunespecifically 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-onlyoEjust regenerate the manifest and then stop (implies --force-manifest)force-manifestfkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.formats=6formats for source distribution (comma-separated list)z keep-tempkz1keep the distribution tree around after creating zarchive 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 formatsposixZgztarntzipcheckcCsyd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ dS)Nr) templatemanifest use_defaultsr' manifest_onlyZforce_manifestr keep_tempdist_dir archive_filesrownergroup)rrrrinitialize_optionsds            zsdist.initialize_optionsc Cs|jdkrd|_|jdkr0d|_|jd|jdkry|jtjg|_Wn%tk rtdtjYnXt j |j}|rt d||j dkrd|_ dS)NZMANIFESTz MANIFEST.inrz)__name__ __module__ __qualname__Z descriptionrZ user_optionsZboolean_optionsrZ help_optionsZ negative_optrNZ sub_commandsrMrRrVrYrTr_r`rarbr\r]rrUrrrrrr"sn           ( P     * r)__doc__rOstringrtypesrwarningsrZdistutils.corerZ distutilsrrrr Zdistutils.text_filer Zdistutils.errorsZdistutils.filelistr r Zdistutils.utilr rrrrrrs    "