Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyc

ó
“tÆ_c@sÍdZddlmZddlmZddlZddlZddlZddlmZddl	Z	ddl
Z
ddlZddlZej
ddkr²d„Zd	„Znd
„Zd„Zdefd
„ƒYZdefd„ƒYZdefd„ƒYZd„Zd„Zd„Zd„ZdZd„Zd„Zd„Zdd„Zd„Zdefd„ƒYZdefd„ƒYZ d „Z!d!d"d#d$d%hZ"d&„Z#e$d'krÉe#ƒndS((sgThis is invoked in a subprocess to call the build backend hooks.

It expects:
- Command line args: hook_name, control_dir
- Environment variables:
      PEP517_BUILD_BACKEND=entry.point:spec
      PEP517_BACKEND_PATH=paths (separated with os.pathsep)
- control_dir/input.json:
  - {"kwargs": {...}}

Results:
- control_dir/output.json
  - {"return_val": ...}
iÿÿÿÿ(tglob(t
import_moduleN(tjoiniicKs5t|dddƒ}tj|||WdQXdS(Ntwtencodingsutf-8(topentjsontdump(tobjtpathtkwargstf((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt
write_json!scCs/t|dddƒ}tj|ƒSWdQXdS(NtrRsutf-8(RRtload(R	R((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt	read_json%sc
Ks5t|dƒ }tj||dd|WdQXdS(NtwbRsutf-8(RRR(RR	R
R((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR+scCs)t|dƒ}tj|ƒSWdQXdS(Ntrb(RRR(R	R((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR/stBackendUnavailablecBseZdZd„ZRS(s&Raised if we cannot import the backendcCs
||_dS(N(t	traceback(tselfR((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt__init__6s(t__name__t
__module__t__doc__R(((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR4stBackendInvalidcBseZdZd„ZRS(s Raised if the backend is invalidcCs
||_dS(N(tmessage(RR((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR<s(RRRR(((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR:stHookMissingcBseZdZRS(sARaised if a hook is missing and we are not executing the fallback(RRR(((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR@scCsXtjjtjj|ƒƒ}tjjtjj|ƒƒ}tjj||gƒ|kS(s5Test if a file is located within the given directory.(tosR	tnormcasetabspathtcommonprefix(tfilenamet	directory((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pytcontained_inDscsÿtjjdƒ}|r:|jtjƒ}|tjd*ntjd}|jdƒ\}}}yt|ƒ‰Wn#t	k
r”t
tjƒƒ‚nX|rÉt
‡fd†|DƒƒsÉtdƒ‚qÉn|rûx)|jdƒD]}tˆ|ƒ‰qßWnˆS(sFind and load the build backendtPEP517_BACKEND_PATHitPEP517_BUILD_BACKENDt:c3s!|]}tˆj|ƒVqdS(N(R"t__file__(t.0R	(R(sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pys	<genexpr>\ss(Backend was not loaded from backend-patht.(RtenvirontgettsplittpathseptsysR	t	partitionRtImportErrorRRt
format_exctanyRtgetattr(tbackend_pathtextra_pathitemsteptmod_patht_tobj_patht	path_part((RsO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt_build_backendKs&

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

    Returns [] if the hook is not defined.
    N(R:tget_requires_for_build_wheeltAttributeError(tconfig_settingstbackendthook((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR;gs	

cCsZtƒ}y
|j}Wn0tk
rH|s8tƒ‚nt|||ƒSX|||ƒSdS(sÈInvoke optional prepare_metadata_for_build_wheel

    Implements a fallback by building a wheel if the hook isn't defined,
    unless _allow_fallback is False in which case HookMissing is raised.
    N(R:t prepare_metadata_for_build_wheelR<Rt_get_wheel_metadata_from_wheel(tmetadata_directoryR=t_allow_fallbackR>R?((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyR@us	

	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_ziptresR	tm((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt_dist_info_files‹sc
Cs¨ddlm}|j||ƒ}ttjj|tƒdƒWdQXtjj||ƒ}||ƒ)}t|ƒ}|j	d|d|ƒWdQX|dj
dƒdS(	sBuild a wheel and extract the metadata from it.

    Fallback for when the build backend does not
    define the 'get_wheel_metadata' hook.
    iÿÿÿÿ(tZipFileRNR	tmembersit/(tzipfileRNtbuild_wheelRRR	RtWHEEL_BUILT_MARKERRMt
extractallR+(R>RBR=RNtwhl_basenametwhl_filetzipft	dist_info((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRA—s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(
tNoneRR	tdirnametisfiletpjoinRSRRtlen(RBtmetadata_parentt	whl_files((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt_find_already_built_wheelªscCsHt|ƒ}|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`tshutiltcopy2RR	tbasenameR:RR(twheel_directoryR=RBtprebuilt_whl((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRRÀ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(R:tget_requires_for_build_sdistR<(R=R>R?((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRfÐs	

t_DummyExceptioncBseZdZRS(s(Nothing should ever raise this exception(RRR(((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRgÞstGotUnsupportedOperationcBseZdZd„ZRS(s9For internal use when backend raises UnsupportedOperationcCs
||_dS(N(R(RR((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRäs(RRRR(((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRhâscCsStƒ}y|j||ƒSWn/t|dtƒk
rNttjƒƒ‚nXdS(s&Invoke the mandatory build_sdist hook.tUnsupportedOperationN(R:tbuild_sdistR2RgRhRR0(tsdist_directoryR=R>((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyRjès
	R;R@RRRfRjcCsfttjƒdkr%tjdƒntjd}tjd}|tkr_tjd|ƒntƒ|}tt|dƒƒ}itd6dd6}y||d	|d<Wn–t
k
rÙ}t|d
<|j|d<nmt
k
r}t|d<|j|d
<nDtk
r+}t|d<|j|d<ntk
rEt|d<nXt|t|dƒddƒdS(Nis"Needs args: hook_name, control_diriisUnknown hook: %ss
input.jsontunsupportedt
return_valR
t
no_backendRtbackend_invalidt
backend_errorthook_missingsoutput.jsontindent(R]R-targvtexitt
HOOK_NAMEStglobalsRR\tFalseRYRtTrueRRRRhRR(t	hook_nametcontrol_dirR?t
hook_inputtjson_outte((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pytmainús.






t__main__(%RRt	importlibRRRtos.pathRR\RFRaR-Rtversion_infoRRRIRRRR"R:R;R@RSRMRAR`RYRRRfRgRhRjRuR~R(((sO/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.pyt<module>sN												
		
Back to Directory File Manager