????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_vendor/pep517/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.pyc

�
}�\]c@sFdZddlmZddlmZddlZddlmZddlZddl	Z	ddl
Z
ddlZdefd��YZ
d�Zd	�Zd
�ZdZd�Zd
�Zd�Zdd�Zd�Zdefd��YZdefd��YZd�ZdddddhZd�ZedkrBe�ndS(s$This is invoked in a subprocess to call the build backend hooks.

It expects:
- Command line args: hook_name, control_dir
- Environment variable: PEP517_BUILD_BACKEND=entry.point:spec
- control_dir/input.json:
  - {"kwargs": {...}}

Results:
- control_dir/output.json
  - {"return_val": ...}
i����(tglob(t
import_moduleN(tjointBackendUnavailablecBseZdZRS(s&Raised if we cannot import the backend(t__name__t
__module__t__doc__(((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyRscCs�tjd}|jd�\}}}yt|�}Wntk
rNt�nX|r�x)|jd�D]}t||�}qeWn|S(sFind and load the build backendtPEP517_BUILD_BACKENDt:t.(tostenviront	partitionRtImportErrorRtsplittgetattr(teptmod_patht_tobj_pathtobjt	path_part((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyt_build_backends


cCs9t�}y
|j}Wntk
r*gSX||�SdS(sfInvoke the optional get_requires_for_build_wheel hook

    Returns [] if the hook is not defined.
    N(Rtget_requires_for_build_wheeltAttributeError(tconfig_settingstbackendthook((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyR+s	

cCsHt�}y
|j}Wntk
r6t|||�SX|||�SdS(sInvoke optional prepare_metadata_for_build_wheel

    Implements a fallback by building a wheel if the hook isn't defined.
    N(Rt prepare_metadata_for_build_wheelRt_get_wheel_metadata_from_wheel(tmetadata_directoryRRR((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyR9s	

	tPEP517_ALREADY_BUILT_WHEELcCs_g}x<|j�D].}tjd|�}|r|j|�qqW|rO|Std��dS(s6Identify the .dist-info folder inside a wheel ZipFile.s[^/\\]+-[^/\\]+\.dist-info/s#No .dist-info folder found in wheelN(tnamelisttretmatchtappendt	Exception(twhl_ziptrestpathtm((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyt_dist_info_filesKsc
Cs�ddlm}|j||�}ttjj|t�d��WdQXtjj||�}||��)}t|�}|j	d|d|�WdQX|dj
d�dS(	s�Build a wheel and extract the metadata from it.

    Fallback for when the build backend does not
    define the 'get_wheel_metadata' hook.
    i����(tZipFiletwbNR'tmembersit/(tzipfileR*tbuild_wheeltopenR
R'RtWHEEL_BUILT_MARKERR)t
extractallR(RRRR*twhl_basenametwhl_filetzipft	dist_info((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyRWscCs�|s
dStjj|�}tjjt|t��s;dSttjj|d��}|sedGHdSt	|�dkr�dGHdS|dS(sHCheck for a wheel already built during the get_wheel_metadata hook.
    s*.whls+Found wheel built marker, but no .whl filesisHFound multiple .whl files; unspecified behaviour. Will call build_wheel.iN(
tNoneR
R'tdirnametisfiletpjoinR1RRtlen(Rtmetadata_parentt	whl_files((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyt_find_already_built_wheeljscCsHt|�}|r2tj||�tjj|�St�j|||�S(s�Invoke the mandatory build_wheel hook.

    If a wheel was already built in the
    prepare_metadata_for_build_wheel fallback, this
    will copy it rather than rebuilding the wheel.
    (R>tshutiltcopy2R
R'tbasenameRR/(twheel_directoryRRtprebuilt_whl((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyR/�scCs9t�}y
|j}Wntk
r*gSX||�SdS(sfInvoke the optional get_requires_for_build_wheel hook

    Returns [] if the hook is not defined.
    N(Rtget_requires_for_build_sdistR(RRR((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyRD�s	

t_DummyExceptioncBseZdZRS(s(Nothing should ever raise this exception(RRR(((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyRE�stGotUnsupportedOperationcBseZdZRS(s9For internal use when backend raises UnsupportedOperation(RRR(((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyRF�scCsGt�}y|j||�SWn#t|dt�k
rBt�nXdS(s&Invoke the mandatory build_sdist hook.tUnsupportedOperationN(Rtbuild_sdistRRERF(tsdist_directoryRR((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyRH�s
	RRR/RDRHcCsttj�dkr%tjd�ntjd}tjd}|tkr_tjd|�nt�|}tjt|d��}it	d6dd6}y||d	�|d<Wn5tk
r�t|d
<nt
k
r�t|d<nXtj|t|d�dd�dS(
Nis"Needs args: hook_name, control_diriisUnknown hook: %ss
input.jsontunsupportedt
return_valtkwargst
no_backendsoutput.jsontindent(R;tsystargvtexitt
HOOK_NAMEStglobalstcompatt	read_jsonR:tFalseR7RtTrueRFt
write_json(t	hook_nametcontrol_dirRt
hook_inputtjson_out((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pytmain�s 





t__main__(RRt	importlibRR
tos.pathRR:R!R?RORTR$RRRRR1R)RR>R7R/RDRERFRHRRR]R(((s=/tmp/pip-install-ewDPok/pip/pip/_vendor/pep517/_in_process.pyt<module>s: