????

Your IP : 216.73.216.152


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

�
}�\]c	@@sdZddlmZddlZddlZddlZddlZddlZddlZ	ddl
Z
ddlZddlZddl
Z
ddlZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlm Z m!Z!m"Z"dd
l#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:e8r�ddl;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEddlFmGZGddlHmIZIddlmJZJddlKmLZLmMZMddlNmOZOddlPmQZQddlRmSZSeAeTdfZUnddfZVejWeX�ZYd �ZZdd!>d"�Z[dd!>d#�Z\d$�Z]d%�Z^d&�Z_e
j`d'e
ja�Zbd(�Zcd)�Zdd*�Zed+�Zfd,�Zgeheieiejeieheiejd-�Zkd.�Zld/�Zmd0�Znd1eofd2��YZpe
j`d3e
jq�d4�Zrd5�Zsd6�Ztd7�Zud8eofd9��YZvdS(:sH
Support for installing and building the "wheel" binary package format.
i(tabsolute_importN(turlsafe_b64encode(tParser(t
pkg_resources(tScriptMaker(tcanonicalize_name(tStringIO(t
pep425tags(t
unpack_url(tInstallationErrortInvalidWheelFilenametUnsupportedWheel(tdistutils_scheme(tLink(t
indent_log(tPIP_DELETE_MARKER_FILENAME(tLOG_DIVIDERtcall_subprocesstcaptured_stdoutt
ensure_dirtformat_command_argstpath_to_urltread_chunks(tmake_setuptools_shim_args(t
TempDirectory(tMYPY_CHECK_RUNNING(topen_spinner(
tDicttListtOptionaltSequencetMappingtTupletIOtTexttAnytIterable(tRequirement(tInstallRequirement(t
PipSession(t
FormatControlt
PackageFinder(tRequirementPreparer(t
WheelCache(t	Pep425Tag.icC@s%tjj||�jtjjd�S(Nt/(tostpathtrelpathtreplacetsep(tsrctp((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytnormpathBsicC@sntj�}d}t|d��A}x7t|d|�D]#}|t|�7}|j|�q7WWdQX||fS(s5Return (hash, length) for path using hashlib.sha256()itrbtsizeN(thashlibtsha256topenRtlentupdate(R/t	blocksizethtlengthtftblock((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt	hash_fileFscC@sMt||�\}}dt|j��jd�jd�}|t|�fS(s?Return (encoded_digest, length) for path using hashlib.sha256()ssha256=tlatin1t=(RBRtdigesttdecodetrstriptstr(R/R=R>R?RE((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytrehashRs
cC@sItjddkr"i}d}nidd6}d}t||||�S(Niitbttnewline(tsystversion_infoR:(tnametmodetnltbin((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytopen_for_csv]s	
cC@s&|jd�}||d<dj|�S(sBReplace the Python tag in a wheel file name with a new value.
    t-i����(tsplittjoin(t	wheelnametnew_tagtparts((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytreplace_python_taghs
cC@s�tjj|�r�t|d��d}|j�}|jd�sCtStjj	tj
��}d|tjj	d�}|j�}WdQXt|d��!}|j
|�|j
|�WdQXtSdS(sLReplace #!python with #!/path/to/python
    Return True if file was changed.R6s#!pythons#!tasciiNtwb(R.R/tisfileR:treadlinet
startswithtFalseRMt
executabletencodetgetfilesystemencodingtlineseptreadtwritetTruetNone(R/tscriptt	firstlinetexenametrest((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt
fix_scriptqs
sX^(?P<namever>(?P<name>.+?)(-(?P<ver>.+?))?)
                                \.dist-info$c	C@s�|jdd�}x�tj|�D]�}tj|�}|r"|jd�|kr"ttjj||d���:}x0|D](}|j	�j
�}|dkrztSqzWWdQXq"q"WtS(sP
    Return True if the extracted wheel in wheeldir should go into purelib.
    RTt_ROtWHEELsroot-is-purelib: trueN(
R1R.tlistdirtdist_info_retmatchtgroupR:R/RVtlowerRGRgR`(ROtwheeldirtname_foldedtitemRrtwheeltline((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytroot_is_purelib�s!
c@stjj|�siifSt|��N}t�}x.|D]&}|j|j��|jd�q;W|jd�WdQXtj	j
|�}|jdi�}|jdi�}d��t�fd�|j
�D��}t�fd�|j
�D��}||fS(Ns
itconsole_scriptstgui_scriptscS@st|�jdd�jd�S(sRget the string representation of EntryPoint, remove space and split
        on '='t RKRD(RHR1RU(ts((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt	_split_ep�sc3@s|]}�|�VqdS(N((t.0tv(R(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys	<genexpr>�sc3@s|]}�|�VqdS(N((R�R�(R(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys	<genexpr>�s(R.R/texistsR:RRftstriptseekRt
EntryPointt	parse_maptgettdicttvalues(tfilenametfptdataRytentry_pointstconsoletgui((Rs2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytget_entrypoints�s
	
	""c@s�|s
dStjt�}xC|D];}tjj|�}tjj|�}||j|�q Wgtj	j
dd�jtj�D]$}tjj
|�jtj�^q���jtjj
tjjtj����fd�|j�D�}|s�dSg}x�|j�D]�\}}t|�}t|�dkrLdj|d�}	n(djdj|d	 �d
|d	�}	|jdj|	|��qWd}
t|�dkr�|j|
jd
��n|j|
jd��dj|�S(s�Determine if any scripts are not on PATH and format a warning.

    Returns a warning message if one or more scripts are not on PATH,
    otherwise None.
    tPATHRKc@s7i|]-\}}tjj|��kr||�qS((R.R/tnormcase(R�t
parent_dirtscripts(t
not_warn_dirs(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys
<dictcomp>�s		isscript {} isisscripts {} ares, i����s and s.The {} installed in '{}' which is not on PATH.seConsider adding {} to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.sthis directorysthese directoriess
N(RhtcollectionstdefaultdicttsetR.R/tdirnametbasenametaddtenvironR�RUtpathsepR�RGR2tappendRMRatitemstsortedR;tformatRV(R�tgrouped_by_dirtdestfileR�tscript_nametitwarn_fort	msg_linestsorted_scriptst
start_textt
last_line_fmt((R�s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt!message_about_scripts_not_on_PATH�s8
I("cC@st|dd��S(s;
    Return the given rows of a RECORD file in sorted order.

    Each row is a 3-tuple (path, hash, size) and corresponds to a record of
    a RECORD file (see PEP 376 and PEP 427 for details).  For the rows
    passed to this function, the size can be an integer as an int or string,
    or the empty string.
    tkeycS@std�|D��S(Ncs@s|]}t|�VqdS(N(RH(R�tx((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys	<genexpr>	s(ttuple(trow((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt<lambda>	s(R�(toutrows((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytsorted_outrows�scC@s3g}x�|D]�}t|�dkr>tjdj|��nt|�}|d}|j||�}||d<||kr�t|�\}	}
|	|d<|
|d<n|jt|��q
WxE|D]=}t|�\}	}
|jt	||�|	t
|
�f�q�Wx(|D] }|j||ddf�qW|S(s_
    :param installed: A map from archive RECORD path to installation RECORD
        path.
    is,RECORD line has more than three elements: {}iiiRK(R;tloggertwarningR�tlisttpopRIR�R�R5RH(told_csv_rowst	installedtchangedt	generatedtlib_dirtinstalled_rowsR�told_pathtnew_pathRER?R@((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytget_csv_rows_for_installeds(





)
c+@s||s3t|d|d|d|d|d|	�}nt|�
�rO|d�n
|d�g�g��
jtjj�tjj}i�t��g}|rt��@}
tj	��+tj
d�tj|d	t
d
t
�WdQXWdQXtj|
j��nt����
fd��dd����	fd
�}||�t
��s_td�	��tjj�dd�}t|�\����fd�}x��D]�}d}d}x�tjtjj�
|��D]e}d}|dkr�t}|}ntjj�
||�}||}|||td|d|�q�Wq�Wtd|d��t
�_dh�_t
�_��	fd�}|�_d�_�jdd�}|r�dtjkr�d|}|j �j!|��ntjj"dd�dkr+dt#j$d |f}|j �j!|��ndt#j$d |f}|j �j!|��g�D]}t%j&d|�r_|^q_}x|D]
}�|=q�Wn�jd d�}|r[dtjkr�d!|}|j �j!|��nd"t#j$d |f}|j �j!|��g�D]}t%j&d#|�r|^q}x|D]
}�|=qGWnt'��dkr��j(g�j)�D]}d$|^q��}|j |�|
r�t*|�}|dk	r�tj+|�q�q�nt'��dkr,|j �j(g�j)�D]}d$|^qit
d%6��ntjj�dd&�} tjj�dd'�}!t,|!d(��}"|"j-d)�WdQXt.j/|!| �|j0| �tjj�dd*�}#tjj�dd+�}$t1|#d,���}%t1|$d-��m}&t2j3|%�}'t4|'d.�d/�d0|d1��}(t2j5|&�})x!t6|(�D]}*|)j7|*�qEWWdQXWdQXt.j/|$|#�dS(2sInstall a wheeltuserthometroottisolatedtprefixtpurelibtplatlibtignoretforcetquietNc@sBt|��}t|��}|�|<|r>�j|�ndS(s6Map archive RECORD paths to installation RECORD paths.N(R5R�(tsrcfileR�tmodifiedtoldpathtnewpath(R�R�R�Ru(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytrecord_installedbs

c@s�t|�x�tj|�D]�\}}}|t|�jtjj�}tjj||�}	|r�|jtjjd�dj	d�r�qnx�|D]�}
tjj|||
�}|r�|dkr�|j	d�r��j
|
�q�q�|r�|
j	d�r�t|
�jt�j
��r��sBtd|ddj�����j
|�q�q�WxL|D]D}|r{||�r{q]ntjj||�}
tjj|||�}t|	�tjj|�r�tj|�ntj|
|�tj|
�}ttd�r!tj||j|jf�ntj|
tj�rvtj|
�}|jtjBtjBtjB}tj||�nt}|r�||�}n�|
||�q]WqWdS(	Niis.dataRKs
.dist-infos!Multiple .dist-info directories: s, tutime( RR.twalkR;tlstripR/R2RVRUtendswithR�RR_ROtAssertionErrorR�tunlinktshutiltcopyfiletstatthasattrR�tst_atimetst_mtimetaccesstX_OKtst_modetS_IXUSRtS_IXGRPtS_IXOTHtchmodR`(tsourcetdesttis_basetfixertfiltertdirtsubdirstfilestbasedirtdestdirR~t
destsubdirR@R�R�tsttpermissionsR�(t	data_dirstinfo_dirR�treq(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytclobberjsN
+
!




s!%s .dist-info directory not foundisentry_points.txtc@s�|j�jd�r"|d }nJ|j�jd�rD|d }n(|j�jd�rf|d }n|}|�kp�|�kS(Ns.exei����s
-script.pyi����s.pya(RtR�(ROt	matchname(R�R�(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytis_entrypoint_wrapper�s


R�R�R�RKc@s^|jdkr(td|�f��n�ji|jd6|jjd�dd6|jd6S(Ns�Invalid script entry point: %s for req: %s - A callable suffix is required. Cf https://packaging.python.org/en/latest/distributing.html#console-scripts for more information.tmodulet.itimport_nametfunc(tsuffixRhR	tscript_templateR�RU(tentry(tmakerR�(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt_get_script_text�s	
s�# -*- coding: utf-8 -*-
import re
import sys

from %(module)s import %(import_name)s

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
tpiptENSUREPIP_OPTIONSspip = t
altinstalls
pip%s = %siispip(\d(\.\d)?)?$teasy_installseasy_install = seasy_install-%s = %sseasy_install(-\d\.\d)?$s%s = %sR�t	INSTALLERs
INSTALLER.pipR\spip
tRECORDs
RECORD.piptrsw+R�R�R�R�(8RRzRGR.R/R2R�Rtwarningstcatch_warningstfilterwarningst
compilealltcompile_dirRgR�tdebugtgetvalueR`RhR�RVR�RpRmRR�tvariantstset_modeR�R�R�R�textendtmakeR�RMtversiontreRrR;t
make_multipleR�R�R�R:RfR�tmoveR�RStcsvtreaderR�twriterR�twriterow(+ROR�RuR�R�R�t	pycompiletschemeR�R�twarn_script_locationR�R�tstdoutR�tep_fileR�tdatadirR�R�tsubdirR�R�t
pip_scripttspectktpip_epteasy_install_scriptteasy_install_eptkvtgenerated_console_scriptstmsgt	installerttemp_installertinstaller_filetrecordttemp_recordt	record_int
record_outRR�RR�((R�R�R�R�R�R�R�R�R�R�Rus2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytmove_wheel_files0s�

	

%F
%	
$			
	#
+

+
&
 
cC@s�y�gtjd|�D]}|^qd}|jd�}t�j|�}|dj�}ttt	|j
d���}|SWntk
r�dSXdS(s�
    Return the Wheel-Version of an extracted wheel, if possible.

    Otherwise, return None if we couldn't parse / extract it.
    iRos
Wheel-VersionR�N(Rtfind_on_pathRhtget_metadataRtparsestrR�R�tmaptintRUt	Exception(t
source_dirtdtdistt
wheel_dataR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt
wheel_versionns)
cC@s�|std|��n|dtdkrXtd|djtt|��f��n1|tkr�tjddjtt|���ndS(s�
    Raises errors or warns if called with an incompatible Wheel-Version.

    Pip should refuse to install a Wheel-Version that's a major series
    ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
    installing a version only minor version ahead (e.g 1.2 > 1.1).

    version: a 2-tuple representing a Wheel-Version (Major, Minor)
    name: name of wheel or package to raise exception about

    :raises UnsupportedWheel: when an incompatible Wheel-Version is given
    s(%s is in an unsupported or invalid wheelisB%s's Wheel-Version (%s) is not compatible with this version of pipR�s*Installing from a newer Wheel-Version (%s)N(RtVERSION_COMPATIBLERVR3RHR�R�(RRO((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytcheck_compatibility�s%cC@s
dj|�S(s�
    Format three tags in the form "<python_tag>-<abi_tag>-<platform_tag>".

    :param file_tag: A 3-tuple of tags (python_tag, abi_tag, platform_tag).
    RT(RV(tfile_tag((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt
format_tag�stWheelcB@sMeZdZejdej�Zd�Zd�Zdd�Z
dd�ZRS(sA wheel files�^(?P<namever>(?P<name>.+?)-(?P<ver>.*?))
        ((-(?P<build>\d[^-]*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
        \.whl|\.dist-info)$c@s��jj|�}|s+td|��n|�_|jd�jdd��_|jd�jdd��_|jd��_|jd�j	d��_
|jd	�j	d��_|jd
�j	d��_�fd��j
D��_
dS(
sX
        :raises InvalidWheelFilename: when the filename is invalid for a wheel
        s!%s is not a valid wheel filename.RORnRTtvertbuildtpyverR�tabitplatc@s?h|]5}�jD]%}�jD]}|||f�q qqS((tabistplats(R�R�tytz(tself(s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys	<setcomp>�s	N(t
wheel_file_reRrR
R�RsR1RORt	build_tagRUt
pyversionsRERFt	file_tags(RIR�t
wheel_info((RIs2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt__init__�s	cC@std�|jD��S(sF
        Return the wheel's tags as a sorted list of strings.
        cs@s|]}t|�VqdS(N(R>(R�ttag((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys	<genexpr>�s(R�RM(RI((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytget_formatted_file_tags�scC@s`|dkrtj�}ng|jD]!}||kr%|j|�^q%}|r\t|�SdS(s"
        Return the lowest index that one of the wheel's file_tag combinations
        achieves in the supported_tags list e.g. if there are 8 supported tags,
        and one of the file tags is first in the list, then return 0.  Returns
        None is the wheel is not supported.
        N(RhRt
get_supportedRMtindextmin(RIttagstctindexes((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytsupport_index_min�s1cC@s7|dkrtj�}ntt|�j|j��S(s'Is this wheel supported on this system?N(RhRRRtboolR�tintersectionRM(RIRU((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt	supported�sN(t__name__t
__module__t__doc__RtcompiletVERBOSERJRORQRhRXR[(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyR?�s		
s([a-z0-9_.]+)-([a-z0-9_.!+-]+)cC@st|j|��S(sjDetermine whether the string looks like an egg_info.

    :param s: The string to parse. E.g. foo-2.1
    (RYtsearch(R~t_egg_info_re((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt_contains_egg_info�scC@s�|jr
dS|jr6|s2tjd|j�ndS|s@tS|jsS|jrWdSd|j	t
|j��kr�tjd|j�dS|jr�|jjr�t
S|j}|j�\}}|r�t|�r�tSt
S(sZ
    Return whether to build an InstallRequirement object using the
    ephemeral cache.

    :param cache_available: whether a cache directory is available for the
        autobuilding=True case.

    :return: True or False to build the requirement with ephem_cache=True
        or False, respectively; or None not to build the requirement.
    s(Skipping %s, due to already being wheel.tbinarysCSkipping bdist_wheel for %s, due to binaries being disabled for it.N(t
constraintRhtis_wheelR�tinfoROR`teditableR6tget_allowed_formatsRtlinktis_artifactRgtsplitextRc(R�tformat_controltautobuildingtcache_availableRjtbasetext((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytshould_use_ephemeral_cache�s0			
	cC@s�t|�}dj|�}|s.|d7}nTtj�tjkrP|d7}n2|jd�sl|d7}n|dj|t�7}|S(s1
    Format command information for logging.
    sCommand arguments: {}
sCommand output: Nones'Command output: [use --verbose to show]s
sCommand output:
{}{}(RR�R�tgetEffectiveLeveltloggingtDEBUGR�R(tcommand_argstcommand_outputtcommand_descttext((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytformat_command_result,s


cC@s�t|�}|sHdj|j�}|t||�7}tj|�dSt|�dkr�dj|j|�}|t||�7}tj|�ntj	j
||d�S(sH
    Return the path to the wheel in the temporary build directory.
    s1Legacy build of wheel for {!r} created no files.
isZLegacy build of wheel for {!r} created more than one file.
Filenames (choosing first): {}
iN(R�R�RORzR�R�RhR;R.R/RV(tnamesttemp_dirR�RvRwR'((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pytget_legacy_build_wheel_pathCs
tWheelBuildercB@sneZdZd	d	ed�Zd	d�Zd	d�Zd�Zd	d�Z	d	d�Z
d�Zed�ZRS(
s#Build wheels from a RequirementSet.cC@sR||_||_||_|j|_|p0g|_|p?g|_||_dS(N(tfindertpreparertwheel_cachetwheel_download_dirt
_wheel_dirt
build_optionstglobal_optionstno_clean(RIRR�R�R�R�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyROfs
			c	C@s*|j�|j||d|�SWdQXdS(siBuild one wheel.

        :return: The filename of the built wheel, or None if the build failed.
        t
python_tagN(t	build_envt_build_one_inside_env(RIR�t
output_dirR�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt
_build_onezs
c
C@s	tdd���}|jr'|j}n	|j}|||jd|�}|dk	r�tjj|�}tjj||�}y\t	|�\}	}
t
j||�tj
d|j||
|	j��tj
d|�|SWq�tk
r�q�Xn|j|�dSWdQXdS(NtkindRxR�s3Created wheel for %s: filename=%s size=%d sha256=%ssStored in directory: %s(Rt
use_pep517t_build_one_pep517t_build_one_legacyR/RhR.R�RVRBR�RR�RgROt	hexdigestR5t
_clean_one(RIR�R�R�R|tbuildert
wheel_patht
wheel_namet	dest_patht
wheel_hashR?((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyR��s(			


cC@s&t|jdt�}|t|j�S(Ntunbuffered_output(Rt
setup_py_pathRgR�R�(RIR�tbase_cmd((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt_base_setup_args�s	cC@s|jdk	st�|jr9tjd|jf�dSy�d|jf|_tjd|�|j	j
|d|j�}|r�t||�}tj
tjj||�tjj||��|}nWn%tk
r�tjd|j�dSXtjj||�S(s�Build one InstallRequirement using the PEP 517 build process.

        Returns path to wheel if successfully built. Otherwise, returns None.
        sGCannot build wheel for %s using PEP 517 when --build-options is presentsBuilding wheel for %s (PEP 517)sDestination directory: %stmetadata_directorysFailed building wheel for %sN(R�RhR�R�R�terrorROtspin_messageR
tpep517_backendtbuild_wheelRZR.trenameR/RVR5(RIR�ttempdR�R�tnew_name((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyR��s*			

cC@s|j|�}d|jf}t|���}tjd|�|dd|g|j}|dk	rw|d|g7}nyt|d|jd|�}Wn2t	k
r�|j
d�tjd	|j�dSXtj
|�}	td
|	d|d|d
|d|�}
|
SWdQXdS(s�Build one InstallRequirement using the "legacy" build process.

        Returns path to wheel if successfully built. Otherwise, returns None.
        s Building wheel for %s (setup.py)sDestination directory: %stbdist_wheels-ds--python-tagtcwdtspinnerR�sFailed building wheel for %sR{R|R�RvRwN(R�RORR�R
R�RhRtsetup_py_dirR5tfinishR�R.RpR}(RIR�R�R�t	base_argsR�R�t
wheel_argstoutputR{R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyR��s,


	cC@sy|j|�}tjd|j�|ddg}yt|d|j�tSWn%tk
rttjd|j�t	SXdS(NsRunning setup.py clean for %stcleans--allR�s Failed cleaning build dir for %s(
R�R�RgRORR6RgR5R�R`(RIR�R�t
clean_args((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyR��s
cC@s2g}|jj}t|jp'|jj�}xQ|D]I}t|d|d|d|�}|dkrjq4n|j||f�q4W|s�gSt	d�|D��r�|jp�|o�|jj}	|	s�t
�ntjddj
g|D]\}}
|j^q���|j}t���gg}}
x�|D]�\}}d}|r�tj}|rc|j|j�}n|j|j�}yt|�Wq�tk
r�}tjd|j|�|
j|�q'q�Xn	|j}|j||d|�}|r�|j|�|r�|jr9tjjtjj
|jt��r9t
d	��n|j�|j|j j!�|_t"t#|��|_|jj$s�t
�t%|j|jdt&d
|�q�q'|
j|�q'WWdQX|r�tjdd
j
g|D]}|j^q���n|
r.tjdd
j
g|
D]}|j^q��n|
S(s�Build wheels.

        :param unpack: If True, replace the sdist we built from with the
            newly built wheel, in preparation for installation.
        :return: True if all the wheels built correctly.
        RmRnRocs@s|]\}}|VqdS(N((R�Rntephem_cache((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pys	<genexpr>ss*Building wheels for collected packages: %ss, s Building wheel for %s failed: %sR�sbad source dir - missing markertsessionNsSuccessfully built %sR}sFailed to build %s('RRmRYR�R�t	cache_dirRrRhR�tanyR�R�RgRVRORRtimplementation_tagtget_ephem_path_for_linkRjtget_path_for_linkRtOSErrorR�R�R6R.R/R�Rtremove_temporary_sourcetbuild_locationR�t	build_dirR
RRfRR`(RItrequirementsR�RntbuildsetRmRoR�R�thave_directory_for_buildRnt_cachet
build_successt
build_failuretephemR�R�tet
wheel_file((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyRA�s�

		,	

		


			


))N(
R\R]R^RhR`ROR�R�R�R�R�R�RA(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyR~cs

		"!	(wR^t
__future__RR�RRR8Rttos.pathR.RR�R�RMRtbase64Rtemail.parserRtpip._vendorRtpip._vendor.distlib.scriptsRtpip._vendor.packaging.utilsRtpip._vendor.sixRt
pip._internalRtpip._internal.downloadRtpip._internal.exceptionsR	R
Rtpip._internal.locationsRtpip._internal.models.linkR
tpip._internal.utils.loggingRt pip._internal.utils.marker_filesRtpip._internal.utils.miscRRRRRRRt$pip._internal.utils.setuptools_buildRtpip._internal.utils.temp_dirRtpip._internal.utils.typingRtpip._internal.utils.uiRttypingRRRRRR R!R"R#R$t"pip._vendor.packaging.requirementsR%tpip._internal.req.req_installR&R'tpip._internal.indexR(R)t pip._internal.operations.prepareR*tpip._internal.cacheR+tpip._internal.pep425tagsR,RHtInstalledCSVRowR;t	getLoggerR\R�R5RBRIRSRZRmR_R`RqRzR�R�R�R�R`RhRgR/R:R<R>tobjectR?tIRcRrRzR}R~(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/wheel.pyt<module>s�4F							 	=		(�4			
D	6