Viewing File: /usr/lib/python3.6/site-packages/setuptools/command/__pycache__/sdist.cpython-36.pyc

3

Xoh7@s~ddlmZddljjZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZeZdddZGd	d
d
e
ejZdS))logN)six)sdist_add_defaultsccs4x.tjdD] }x|j|D]
}|VqWqWdS)z%Find all files under revision controlzsetuptools.file_findersN)
pkg_resourcesZiter_entry_pointsload)dirnameZepitemr/usr/lib/python3.6/sdist.pywalk_revctrlsr
cseZdZdZd0d2d3gZiZdd
ddgZeddeDZddZ	ddZ
ddZddZe
ejddZddZejd4kpd5ejkod6knpd7ejkod8knZereZd$d%Zfd&d'Zd(d)Zd*d+Zd,d-Zd.d/ZZS)9sdistz=Smart sdist that finds anything supported by revision controlformats=N6formats for source distribution (comma-separated list)	keep-tempkz1keep the distribution tree around after creating zarchive file(s)	dist-dir=dFdirectory to put the source distribution archive(s) in [default: dist]rz.rstz.txtz.mdccs|]}dj|VqdS)z	README{0}N)format).0Zextrrr	<genexpr>)szsdist.<genexpr>cCs|jd|jd}|j|_|jjtjj|jd|jx|j	D]}|j|qFW|j
t|jdg}x*|j
D] }dd|f}||krv|j|qvWdS)Negg_infozSOURCES.txt
dist_filesrr)Zrun_commandget_finalized_commandfilelistappendospathjoinrcheck_readmeZget_sub_commandsmake_distributiongetattrdistributionZ
archive_files)selfZei_cmdZcmd_namerfiledatarrrrun+s


z	sdist.runcCstjj||jdS)N)origrinitialize_options_default_to_gztar)r%rrrr*>szsdist.initialize_optionscCstjdkrdSdg|_dS)NrbetarZgztar)r,r-rr.r)sysversion_infoZformats)r%rrrr+Cs
zsdist._default_to_gztarc	Cs$|jtjj|WdQRXdS)z%
        Workaround for #516
        N)_remove_os_linkr)rr")r%rrrr"Is
zsdist.make_distributionccs^Gddd}ttd|}yt`Wntk
r6YnXz
dVWd||k	rXttd|XdS)zG
        In a context, remove and restore os.link if it exists
        c@seZdZdS)z&sdist._remove_os_link.<locals>.NoValueN)__name__
__module____qualname__rrrrNoValueWsr5linkN)r#rr6	Exceptionsetattr)r5Zorig_valrrrr1Ps
zsdist._remove_os_linkcCsLytjj|Wn6tk
rFtj\}}}|jjjdj	YnXdS)Ntemplate)
r)r
read_templater7r/exc_infotb_nexttb_framef_localsclose)r%_tbrrrZ__read_template_hackeszsdist.__read_template_hackr,rrcsb|jjr^|jd}|jj|j|jjs^x0|jD]&\}}}|jjfdd|Dq4WdS)zgetting python filesbuild_pycsg|]}tjj|qSr)rrr )rfilename)src_dirrr
<listcomp>sz.sdist._add_defaults_python.<locals>.<listcomp>N)r$Zhas_pure_modulesrrextendZget_source_filesZinclude_package_dataZ
data_files)r%rEr@	filenamesr)rGr_add_defaults_python|s

zsdist._add_defaults_pythoncsDy tjrtj|n
tjWntk
r>tjdYnXdS)Nz&data_files contains unexpected objects)rZPY2r_add_defaults_data_filessuper	TypeErrorrwarn)r%)	__class__rrrLszsdist._add_defaults_data_filescCs:x4|jD]}tjj|rdSqW|jddj|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrOr )r%frrrr!szsdist.check_readmecCs^tjj|||tjj|d}ttdrJtjj|rJtj||j	d||j
dj|dS)Nz	setup.cfgr6r)r)rmake_release_treerrr hasattrrRunlinkZ	copy_filerZsave_version_info)r%Zbase_dirfilesdestrrrrTs
zsdist.make_release_treec	Cs@tjj|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}xl|D]d}tjr^y|jd}Wn$tk
r\tjd|w YnX|j	}|j
ds |rxq |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'rYzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinfor[r]rZPY3decodeUnicodeDecodeErrorrOstrip
startswithrrr?)r%r[linerrr
read_manifests
zsdist.read_manifest)rNr@keep the distribution tree around after creating archive file(s))rrrj)rrr)rBrCrB)r,r)r,rrD)r,rB)r,rBr)r2r3r4__doc__Zuser_optionsZnegative_optZREADME_EXTENSIONStuplerQr(r*r+r"staticmethod
contextlibcontextmanagerr1Z_sdist__read_template_hackr/r0Zhas_leaky_handler:rKrLr!rTrari
__classcell__rr)rPrrs:
	


r)r)Z	distutilsrZdistutils.command.sdistZcommandrr)rr/r\rnZsetuptools.externrZ
py36compatrrlistZ_default_revctrlr
rrrr<module>s

Back to Directory File Manager