File "sdist.cpython-37.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python37/lib64/python3.7/distutils/command/__pycache__/sdist.cpython-37.pyc
File size: 14.17 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

B

 f7J@sdZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZddZGdddeZdS)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)DistutilsTemplateErrorDistutilsOptionErrorcCsdddlm}ddlm}g}x,|D] }|d|d||dfq&W|||ddS)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)rrformatsformatr</opt/alt/python37/lib64/python3.7/distutils/command/sdist.pyshow_formatssrc@s"eZdZdZddZdddddd	d
ddd
ddddgZddddddgZdddefgZdddZ	defgZ
dZddZd d!Z
d"d#Zd$d%Zd&d'Zd(d)Zed*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zd<d=Zd>d?Zd@dAZdBdCZdDdEZ dFdGZ!dHdIZ"dS)Jsdistz6create 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)z	template=tz5name of manifest template file [default: MANIFEST.in])z	manifest=mz)name of manifest file [default: MANIFEST])zuse-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])zno-defaultsNz"don't include the default file set)pruneNzspecifically 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-onlyozEjust regenerate the manifest and then stop (implies --force-manifest))zforce-manifestfzkforcibly 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-tempkz@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]zuse-defaultsrz
manifest-onlyzforce-manifestz	keep-tempzmetadata-checkzhelp-formatsNz#list available distribution formats)zno-defaultszno-prunecheck)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)NrZgztar)
templatemanifestuse_defaultsr
manifest_onlyZforce_manifestr	keep_tempdist_dir
archive_filesrownergroup)rrrrinitialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|dt|j}|rFtd||jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r)r(Zensure_string_listrZcheck_archive_formatsrr
r-)rZ
bad_formatrrrfinalize_options|s




zsdist.finalize_optionscCsBt|_x|D]}||qW||jr6dS|dS)N)r	filelistZget_sub_commandsZrun_command
get_file_listr+make_distribution)rZcmd_namerrrrunsz	sdist.runcCs*tdt|jd}||dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr&N)rPendingDeprecationWarningdistributionZget_command_objZensure_finalizedr6)rr&rrrcheck_metadatas
zsdist.check_metadatacCstj|j}|s:|r:||j|jdS|sN|	d|j|j
|jrf||rr|
|jr||j|j|dS)aCFigure 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))ospathisfiler(_manifest_is_not_generated
read_manifestr3rZremove_duplicatesrfindallr*add_defaults
read_templaterprune_file_listwrite_manifest)rZtemplate_existsrrrr4s&





zsdist.get_file_listcCs<|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)rrrrr@szsdist.add_defaultscCs:tj|sdStj|}tj|\}}|t|kS)z
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)r:r;existsabspathsplitlistdir)fspathrLZ	directoryfilenamerrr_cs_path_existss

zsdist._cs_path_existscCs|j|jjg}x|D]}t|trn|}d}x(|D] }||r0d}|j|Pq0W|s|dd	|q||r|j|q|d|qWdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
READMESr8Zscript_name
isinstancetuplerQr3rrjoin)rZ	standardsfnZaltsZgot_itrrrrDs 




zsdist._add_defaults_standardscCs8ddg}x*|D]"}ttjjt|}|j|qWdS)Nz
test/test*.pyz	setup.cfg)filterr:r;r<rr3extend)rZoptionalpatternfilesrrrrEs
zsdist._add_defaults_optionalcCsd|d}|jr$|j|x:|jD]0\}}}}x"|D]}|jtj	
||q>Wq,WdS)Nbuild_py)get_finalized_commandr8Zhas_pure_modulesr3rXget_source_files
data_filesrr:r;rU)rr[ZpkgZsrc_dirZ	build_dir	filenamesrPrrrrFs


zsdist._add_defaults_pythoncCs|jr~xr|jjD]f}t|trDt|}tj|rz|j	
|q|\}}x,|D]$}t|}tj|rR|j	
|qRWqWdS)N)r8Zhas_data_filesr^rSstrrr:r;r<r3r)ritemdirnamer_r!rrrrG$s


zsdist._add_defaults_data_filescCs(|jr$|d}|j|dS)N	build_ext)r8Zhas_ext_modulesr\r3rXr])rrcrrrrH5s

zsdist._add_defaults_extcCs(|jr$|d}|j|dS)N
build_clib)r8Zhas_c_librariesr\r3rXr])rrdrrrrI:s

zsdist._add_defaults_c_libscCs(|jr$|d}|j|dS)N
build_scripts)r8Zhas_scriptsr\r3rXr])rrerrrrJ?s

zsdist._add_defaults_scriptsc
Cstd|jt|jddddddd}zlxf|}|dkr<Py|j|Wq*ttfk
r}z|	d|j
|j|fWdd}~XYq*Xq*WWd|XdS)zRead and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r')Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinNz%s, line %d: %s)
r
infor(rreadliner3Zprocess_template_liner
ValueErrorrrPZcurrent_lineclose)rr(linemsgrrrrADs 

$zsdist.read_templatecCs|d}|j}|jjd|jd|jjd|dtjdkrFd}nd}ddd	d
ddd
g}d|d||f}|jj|dddS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        buildN)prefixZwin32z/|\\/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*|r')Zis_regex)	r\r8get_fullnamer3Zexclude_patternZ
build_basesysplatformrU)rrlbase_dirZsepsZvcs_dirsZvcs_ptrnrrrrBas


zsdist.prune_file_listcCsX|rtd|jdS|jjdd}|dd|tj	|j|fd|jdS)zWrite the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
r=r
rfr)r3rZinsertZexecuterZ
write_file)rZcontentrrrrCys
zsdist.write_manifestcCs<tj|jsdSt|j}z|}Wd|X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)r:r;r<r)openrgri)rfpZ
first_linerrrr=s

z sdist._manifest_is_not_generatedcCsVtd|jt|j}x0|D](}|}|ds|s:q|j|qW|dS)zRead the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'#N)	r
rfr)rustrip
startswithr3rri)rr)rjrrrr>s

zsdist.read_manifestcCs||tj|||jdttdr4d}d|}nd}d|}|sPtdn
t|xD|D]<}tj	
|s~td|q`tj	||}|j|||d	q`W|j
j|dS)
aCreate the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        )dry_runlinkZhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r{)ZmkpathrZcreate_treerzhasattrr:r
rrfr;r<rUZ	copy_filer8ZmetadataZwrite_pkg_info)rrsrZr{rkfiledestrrrmake_release_trees 
	



zsdist.make_release_treecCs|j}tj|j|}|||jjg}d|j	krT|j	
|j	|j	dxD|j	D]:}|j
||||j|jd}|
||jj
dd|fq\W||_|jstj||jddS)aCreate the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        Ztar)rsr/r0r)rzN)r8rpr:r;rUr-rr3rZrrpopindexZmake_archiver/r0Z
dist_filesr.r,rZremove_treerz)rrsZ	base_namer.Zfmtr}rrrr5s




zsdist.make_distributioncCs|jS)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r.)rrrrget_archive_filesszsdist.get_archive_files)#__name__
__module____qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsrRr1r2r6r9r4r@staticmethodrQrDrErFrGrHrIrJrArBrCr=r>rr5rrrrrr$s^

(*r)__doc__r:rqrwarningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr<module>s