Viewing File: /opt/alt/python35/lib/python3.5/site-packages/setuptools/command/__pycache__/sdist.cpython-35.pyc



\@sddlmZddljjZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZeZdddZGd	d
d
e
ejZdS))logN)six)sdist_add_defaultsccs@x9tjdD](}x|j|D]}|Vq)WqWdS)z%Find all files under revision controlzsetuptools.file_findersN)
pkg_resourcesZiter_entry_pointsload)dirnameZepitemr	/sdist.pywalk_revctrlsr
cs<eZdZdZd-ddddfd.gZiZd/ZddZddZddZ	ddZ
eej
ddZddZejd0kpd1ejkod2knpd3ejkod4knZereZd!d"Zfd#d$Zd%d&Zd'd(Zd)d*Zd+d,ZS)5sdistz=Smart sdist that finds anything supported by revision controlformats=N6formats 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]README
README.rst
README.txtcCs|jd|jd}|j|_|jjtjj|jd|jx!|j	D]}|j|qaWddl
}d|jjkr|j
|jt|jdg}x9|jD].}dd|f}||kr|j|qWdS)Negg_infozSOURCES.txtrcheck
dist_filesrr)Zrun_commandget_finalized_commandfilelistappendospathjoinrcheck_readmeZget_sub_commandsZdistutils.commandcommand__all__Zcheck_metadatamake_distributiongetattrdistributionZ
archive_files)selfZei_cmdZcmd_name	distutilsrfiledatarrrrun*s 
"


z	sdist.runcCstjj||jdS)N)origrinitialize_options_default_to_gztar)r'rrrr-Dszsdist.initialize_optionscCs#tjdkrdSdg|_dS)Nrbetargztar)r/r0rr1r)sysversion_infoformats)r'rrrr.Iszsdist._default_to_gztarc	Cs(|jtjj|WdQRXdS)z%
        Workaround for #516
        N)_remove_os_linkr,rr$)r'rrrr$Os
zsdist.make_distributionccsqGddd}ttd|}y
t`Wntk
rCYnXz	dVWd||k	rlttd|XdS)zG
        In a context, remove and restore os.link if it exists
        c@seZdZdS)z&sdist._remove_os_link.<locals>.NoValueN)__name__
__module____qualname__rrrrNoValue]sr:linkN)r%rr;	Exceptionsetattr)r:Zorig_valrrrr6Vs

	zsdist._remove_os_linkcCs\ytjj|WnAtk
rWtj\}}}|jjjdj	YnXdS)Ntemplate)
r,r
read_templater<r3exc_infotb_nexttb_framef_localsclose)r'_tbrrrZ__read_template_hackks
zsdist.__read_template_hackr/rrcs|jjr|jd}|jj|j|jjsx@|jD]5\}}}|jjfdd|DqJWdS)zgetting python filesbuild_pycs%g|]}tjj|qSr)rrr ).0filename)src_dirrr
<listcomp>s	z.sdist._add_defaults_python.<locals>.<listcomp>N)r&Zhas_pure_modulesrrextendZget_source_filesZinclude_package_dataZ
data_files)r'rJrE	filenamesr)rMr_add_defaults_pythonszsdist._add_defaults_pythoncsPy*tjrtj|n
tjWntk
rKtjdYnXdS)Nz&data_files contains unexpected objects)rZPY2r_add_defaults_data_filessuper	TypeErrorrwarn)r')	__class__rrrRs	
zsdist._add_defaults_data_filescCsKxD|jD]}tjj|r
dSq
W|jddj|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrUr )r'frrrr!szsdist.check_readmecCstjj|||tjj|d}ttdritjj|ritj||j	d||j
dj|dS)Nz	setup.cfgr;r)r,rmake_release_treerrr hasattrrXunlinkZ	copy_filerZsave_version_info)r'base_dirfilesdestrrrrZs!
zsdist.make_release_treec	CsTtjj|jsdStj|jd}|j}WdQRX|djkS)NFrbz+# file GENERATED by distutils, do NOT edit
)rrisfilemanifestioopenreadlineencode)r'fpZ
first_linerrr_manifest_is_not_generatedsz sdist._manifest_is_not_generatedcCstjd|jt|jd}x|D]}tjrwy|jd}Wn&tk
rvtjd|w,YnX|j	}|j
ds,|rq,|jj|q,W|j
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'r`zUTF-8z"%r not UTF-8 decodable -- skipping#N)rinforbrdrZPY3decodeUnicodeDecodeErrorrUstrip
startswithrrrD)r'rblinerrr
read_manifests
	
zsdist.read_manifest)rNr)rrr)rrr)rGrHrG)r/r)r/rrI)r/rG)r/rGr)r7r8r9__doc__Zuser_optionsZnegative_optrWr+r-r.r$staticmethod
contextlibcontextmanagerr6Z_sdist__read_template_hackr3r4Zhas_leaky_handler?rQrRr!rZrhrprr)rVrrs8		


r)r(rZdistutils.command.sdistr"rr,rr3rcrsZsetuptools.externrZ
py36compatrrlistZ_default_revctrlr
rrrr<module>s
Back to Directory File Manager