????

Your IP : 216.73.216.152


Current Path : /usr/lib/python2.7/site-packages/wheel/
Upload File :
Current File : //usr/lib/python2.7/site-packages/wheel/bdist_wheel.pyc

�
��]c@s�dZddlZddlZddlZddlZddlZddlZddlZddlZyddl	Z	Wn e
k
r�ddlj	Z	nXddlZej
Z
ejZddlmZddlmZddlmZddlmZddlmZddlmZd	d
lmZmZmZd	dlmZm Z d	dl!m"Z"d	d
l#m$Z$m%Z%d	dl&m'Z'd	dl(mZm&Z&d�Z)d�Z*defd��YZ+dS(sI
Create a wheel (.whl) distribution.

A wheel is a built archive format.
i����N(trmtree(t	Generator(tget_platform(tCommand(tget_python_version(tlogi(t
get_abbr_impltget_impl_vertget_abi_tag(tnativetopen_for_csv(tarchive_wheelfile(t
read_pkg_infotwrite_pkg_info(tpkginfo_to_dict(t
pep425tagstmetadatacCst|�jdd�S(Nt-t_(t	safe_nametreplace(tname((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyt
safer_name+scCst|�jdd�S(NRR(tsafe_versionR(tversion((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyt
safer_version.stbdist_wheelcBseZdZd-ddde�fddd	d
fd.d0d1d2d3d4dd/de�dfg
ZddddgZd�Zd�Z	e
d��Zd �Zd!�Z
d"�Zd#ejd$d%�Zd&�Zd'�Zd(�Zd)�Zd*�Zd+�Zd,�ZRS(5screate a wheel distributions
bdist-dir=tbs1temporary directory for creating the distributions
plat-name=tps;platform name to embed in generated filenames (default: %s)s	keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archives	dist-dir=tds-directory to put final built distributions ins
skip-builds2skip rebuilding everything (for testing/debugging)trelatives6build the archive using relative paths(default: false)sowner=tus@Owner name used when creating a tar file [default: current user]sgroup=tgsAGroup name used when creating a tar file [default: current group]t	universals'make a universal wheel (default: false)spython-tag=s7Python implementation compatibility tag (default: py%s)icCs�d|_d|_d|_d|_d|_t|_d|_d|_	d|_
d|_d|_t|_
d|_d|_t|_dt�d|_t|_dS(Ntziptpyi(tNonet	bdist_dirtdata_dirt	plat_nametplat_tagtformattFalset	keep_temptdist_dirtdistinfo_dirtegginfo_dirtroot_is_puret
skip_buildRtownertgroupR"Rt
python_tagtplat_name_supplied(tself((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytinitialize_optionsTs"															cCs�|jdkr<|jd�j}tjj|d�|_n|jd|_|j	dk	|_
d}|jdt||��|j
j�p�|j
j�|_|j
jd�}d|kr�|ddj�}|j�d
kr�t|_q�ndS(Ntbdisttwheels.dataR-R(R1R"it1ttruetyes(sdist_dirs	plat_names
skip_build(R:struesyes(R&R%tget_finalized_commandt
bdist_basetostpathtjointwheel_dist_nameR'R(R5tset_undefined_optionsR#tdistributionthas_ext_modulesthas_c_librariesR0tget_option_dicttstriptlowertTrueR"(R6R>tneed_optionsR9tval((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytfinalize_optionsgs	cCs1djt|jj��t|jj��f�S(s4Return distribution full name with - replaced with _R(RARRDtget_nameRtget_version(R6((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyRBscCs|jr|j}n$|jr'd}n|jp6t�}|jdd�jdd�}|jr�|jrrd}n	|j}|d|f}nqt�}t�}t	t
��j�}||||f}tj
d|jr�|nd�}||dks�t�|S(	NtanyRRt.spy2.py3tnonetsupplied_platformi(R5R(R0RRR"R4RRtstrRRIRt
get_supportedR%tAssertionError(R6R(timplttagt	impl_nametimpl_vertabi_tagtsupported_tags((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytget_tag�s&										cCs2|j�\}}}d|j|||f}|S(s%Return archive name without extensions%s-%s-%s-%s(R]RB(R6timpl_tagR[R)tarchive_basename((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytget_archive_basename�s
c
Cs�|jd�}d|_|js1|jd�n|jddt�}|j|_t|_|j|_t|_	|jd�}t|_
x4dD],}t|d|tj
j|j|��q�Wd
}tjdkrtj
jtj
j|jd��}||_|_nt||jr dnd|�tjd|j�|jd�|j�}tj
j|j|�}|js�|j}n$tj
j|j|j|j��}|jdd�tj
j|jd|j�|_|j|j |j�|j!|j�|j"|j|j�tj
j#|j�s=tj$|j�nt%||�}	dtj&kr{t'j(tj&dd|	g�nt)|j*dg�j+dt,�|	f�|j-s�|j.r�tjd|j�q�t/|j�ndS(Nt
build_scriptstpythontbuildtinstalltreinit_subcommandstinstall_scriptstheaderstscriptstdatatpurelibtplatlibtinstall_ttnts..tinstall_purelibtinstall_platlibsinstalling to %stinstall_egg_infottargetR/s%s.dist-infot
WHEEL_TOOLtsignt
dist_filesRsremoving %s(sheaderssscriptssdataspurelibsplatlib(stargetsegginfo_dir(0treinitialize_commandt
executableR1trun_commandRJR&trootR+tcompiletwarn_dirtno_eptsetattrR?R@RAR'Rtnormpathtinstall_libbasetinstall_libR0tloggertinfoR`R-Rt_ensure_relativetinstall_baseRCRBR.tegg2distR/twrite_wheelfiletwrite_recordtexiststmakedirsRtenviront
subprocesstcalltgetattrRDtappendRR,tdry_runR(
R6RaRdRftkeytbasedir_observedR_tpseudoinstall_roottarchive_roott
wheel_name((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytrun�sf						
$
		

 		s
bdist_wheel (t)c
Csddlm}|�}d|d<||d<t|j�j�|d<|j�\}}}xg|jd�D]V}xM|jd�D]<}	x3|jd�D]"}
dj||	|
f�|d	<q�Wq�WqkWtj	j|d
�}t
jd|�t|d�� }t
|d
d�j|�WdQXdS(Ni����(tMessages1.0s
Wheel-VersionRsRoot-Is-PurelibRQRtTagtWHEELscreating %stwtmaxheaderleni(t
email.messageR�RTR0RIR]tsplitRAR?R@R�R�topenRtflatten(
R6twheelfile_baset	generatorR�tmsgR^R[R)RWtabitplattwheelfile_pathtf((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR�s	

(cCsCtjj|�\}}|dd!tjkr?||d}n|S(Nii(R?R@t
splitdrivetsep(R6R@tdrive((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR�scCstj||�S(N(Rtpkginfo_to_metadata(R6t
egg_info_pathtpkginfo_path((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyt_pkginfo_to_metadatascCs.|jjd�}d|kr"dS|ddS(sFReturn license filename from a license-file key in setup.cfg, or None.Rtlicense_fileiN(RDRGR%(R6R((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR�sccs�|jjd�}xtdd	fD]f\}}||kr=qn||}x;|dj�D])}|j�}|svqXn||fVqXWqWdS(
s5Generate requirements from setup.cfg as
        ('Requires-Dist', 'requirement; qualifier') tuples. From a metadata
        section in setup.cfg:

        [metadata]
        provides-extra = extra1
            extra2
        requires-dist = requirement; qualifier
            another; qualifier2
            unqualified

        Yields

        ('Provides-Extra', 'extra1'),
        ('Provides-Extra', 'extra2'),
        ('Requires-Dist', 'requirement; qualifier'),
        ('Requires-Dist', 'another; qualifier2'),
        ('Requires-Dist', 'unqualified')
        Rtprovides_extrasProvides-Extrat
requires_dists
Requires-DistiN(R�sProvides-Extra(s
requires_dists
Requires-Dist(RDRGt
splitlinesRH(R6RR�ttitletfieldtline((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytsetupcfg_requirements%s
cCs�t|j��}|sdSt|�}d|ks@d|kr^tjd�|d=|d=nx|D]\}}|||<qeWt||�dS(s@Add additional requirements from setup.cfg to file metadata_pathNsProvides-Extras
Requires-Dists5setup.cfg requirements overwrite values from setup.py(tlistR�RtwarningstwarnR
(R6t
metadata_patht
additionaltpkg_infoRtv((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytadd_requirementsGs

cCs�d�}||�tjj|�s�ddl}tjjtjj|�d�}|j|�}d|f}|r�tjj|d�}|d|f7}nt|��ntjj|�r�|}	|j	||�}
tj
|�n�tjj|d�}	|j	||	�}
tj||d	d
��tjj|d�}t
|d��}|j�j�}
WdQX|
sy||�nttjj|d
�|
�tjj|d
�}|j|�tjj|d�}t|d|j�}d|kr^d}|jd�}tjj||�}t
|d��}|j|jd��WdQX||dddd<n|j�}|r�d}tj|tjj|j|��||dddd<nt
|d��}tj||dt�WdQX||�dS(s:Convert an .egg-info directory into a .dist-info directorycSsmtjj|�rGtjj|�rGtjj|�rGtj|�n"tjj|�ritj|�ndS(s-Appropriately delete directory, file or link.N(R?R@R�tislinktisdirtshutilRtunlink(R((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytadiosVs7i����Ns
*.egg-infos)Egg metadata expected at %s but not foundis- (%s found - possible misnamed archive file?)sPKG-INFOtignorecSs
td�S(NsPKG-INFOsrequires.txtsSOURCES.txtsnot-zip-safe(sPKG-INFOsrequires.txtsSOURCES.txtsnot-zip-safe(tset(txty((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyt<lambda>zssdependency_links.txttrtMETADATAs
metadata.jsonRDtdescriptionsDESCRIPTION.rsttwbsutf-8t
extensionsspython.detailstdocument_namessLICENSE.txttlicenseR�t	sort_keys(R?R@R�tglobRAtdirnametbasenamet
ValueErrortisfileR�tmkdirR�tcopytreeR�treadRHR
R�RRDtpoptwritetencodeR�tcopyR.tjsontdumpRJ(R6tegginfo_patht
distinfo_pathR�R�tpattpossibleterrtaltR�R�tdependency_links_pathtdependency_links_filetdependency_linksR�tmetadata_json_pathtpymetatdescription_filenametdescription_texttdescription_pathtdescription_fileR�tlicense_filenamet
metadata_json((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR�Ts\	
!



		"c
s_ddlm}tjj|d�}tjj|����fd�}�fd�}t|d���}tj|�}x�|�D]�}	tjj|	��}
||
�r�d}d}n[t	|	d��}
|
j
�}WdQXtj|�j
�}d	t||��}t|�}tjj|	��jtjjd
�}|j|||f�q�WWdQXdS(Ni����(turlsafe_b64encodetRECORDc3s\xUtj��D]D\}}}|j�x(t|�D]}tjj||�Vq6WqWdS(N(R?twalktsorttsortedR@RA(tdirtdirstfilesR�(R&(s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR��s
cs
|�kS(s!Wheel hashes every possible file.((R@(trecord_relpath(s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pytskip�ssw+Rmtrbssha256=t/(t
wheel.utilR�R?R@RAtrelpathR
tcsvtwriterR�R�thashlibtsha256tdigestR	tlenRR�twriterow(R6R&R.R�trecord_pathR�R�trecord_fileR�R@R�thashtsizeR�RiR((R&R�s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR��s(		(s
bdist-dir=Rs1temporary directory for creating the distribution(s	dist-dir=Rs-directory to put final built distributions inN(s
skip-buildNs2skip rebuilding everything (for testing/debugging)(srelativeNs6build the archive using relative paths(default: false)(sowner=R s@Owner name used when creating a tar file [default: current user](sgroup=R!sAGroup name used when creating a tar file [default: current group](s	universalNs'make a universal wheel (default: false)(t__name__t
__module__R�RR%Rtuser_optionstboolean_optionsR7RMtpropertyRBR]R`R�R9t__version__R�R�R�R�R�R�R�R�(((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyR1sN
					S				"	
	R(,t__doc__R�R�R?R�R�R�R�R9t	sysconfigtImportErrortdistutils.sysconfigt
pkg_resourcesRRRtemail.generatorRtdistutils.utilRtdistutils.coreRRt	distutilsRR�RRRRtutilR	R
tarchiveRtpkginfoRR
RRRmRRR(((s0/tmp/pip-build-tmgNo5/wheel/wheel/bdist_wheel.pyt<module>s<