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

ó
“tÆ_c@s˜ddlZddlmZddlZddlmZmZmZddl	Z	ddl
mZmZm
Z
ddlZddlmZddlmZyddljZd„ZWn ek
rÖed	„ƒZnXed
„ƒZdefd„ƒYZd
efd„ƒYZdefd„ƒYZdefd„ƒYZddd„Zddd„Zd„Z de!fd„ƒYZ"dej#fd„ƒYZ$dS(iÿÿÿÿN(tcontextmanager(tdirnametabspathtjoin(t
check_calltcheck_outputtSTDOUT(tmkdtempi(tcompatcCstjtdƒS(Ns_in_process.py(t	resourcestpatht__package__(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyt_in_proc_script_pathsccsttttƒƒdƒVdS(Ns_in_process.py(tpjoinRRt__file__(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRsccs'tƒ}z	|VWdtj|ƒXdS(N(Rtshutiltrmtree(ttd((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyttempdirs		tBackendUnavailablecBseZdZd„ZRS(sEWill be raised if the backend cannot be imported in the hook process.cCs
||_dS(N(t	traceback(tselfR((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyt__init__#s(t__name__t
__module__t__doc__R(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR!stBackendInvalidcBseZdZd„ZRS(s)Will be raised if the backend is invalid.cCs||_||_||_dS(N(tbackend_nametbackend_pathtmessage(RRRR((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR)s		(RRRR(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR'stHookMissingcBseZdZd„ZRS(s Will be raised on missing hooks.cCs#tt|ƒj|ƒ||_dS(N(tsuperRRt	hook_name(RR ((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR1s(RRRR(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR/stUnsupportedOperationcBseZdZd„ZRS(sDMay be raised by build_sdist if the backend indicates that it can't.cCs
||_dS(N(R(RR((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR8s(RRRR(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR!6scCs?tjjƒ}|r%|j|ƒnt|d|d|ƒdS(s5The default method of calling the wrapper subprocess.tcwdtenvN(tostenvirontcopytupdateR(tcmdR"t
extra_environR#((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytdefault_subprocess_runner<scCsEtjjƒ}|r%|j|ƒnt|d|d|dtƒdS(sDA method of calling the wrapper subprocess while suppressing output.R"R#tstderrN(R$R%R&R'RR(R(R"R)R#((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytquiet_subprocess_runnerEscCs©tjj|ƒr!tdƒ‚ntjj|ƒ}tjjtjj||ƒƒ}tjj|ƒ}tjj|ƒ}tjj||gƒ|kr¥tdƒ‚n|S(sèNormalise and check a backend path.

    Ensure that the requested backend path is specified as a relative path,
    and resolves to a location under the given source tree.

    Return an absolute version of the requested path.
    spaths must be relatives paths must be inside source tree(	R$R
tisabst
ValueErrorRtnormpathRtnormcasetcommonprefix(tsource_treet	requestedt
abs_sourcet
abs_requestedtnorm_sourcetnorm_requested((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytnorm_and_checkNs!tPep517HookCallercBsweZdZd	d	d„Zed„ƒZd	d„Zd	ed„Z	d	d	d„Z
d	d„Zd	d„Zd„Z
RS(
seA wrapper around a source directory to be built with a PEP 517 backend.

    source_dir : The path to the source directory, containing pyproject.toml.
    build_backend : The build backend spec, as per PEP 517, from
        pyproject.toml.
    backend_path : The backend path, as per PEP 517, from pyproject.toml.
    runner : A callable that invokes the wrapper subprocess.

    The 'runner', if provided, must expect the following:
        cmd : a list of strings representing the command and arguments to
            execute, as would be passed to e.g. 'subprocess.check_call'.
        cwd : a string representing the working directory that must be
            used for the subprocess. Corresponds to the provided source_dir.
        extra_environ : a dict mapping environment variable names to values
            which must be set for the subprocess execution.
    cCsq|dkrt}nt|ƒ|_||_|r[g|D]}t|j|ƒ^q:}n||_||_dS(N(tNoneR*Rt
source_dirt
build_backendR8Rt_subprocess_runner(RR;R<Rtrunnertp((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRws		(	ccs,|j}||_z	dVWd||_XdS(s\A context manager for temporarily overriding the default subprocess
        runner.
        N(R=(RR>tprev((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytsubprocess_runnerŠs
			cCs|jdi|d6ƒS(sGIdentify packages required for building a wheel

        Returns a list of dependency specifications, e.g.:
            ["wheel >= 0.25", "setuptools"]

        This does not include requirements specified in pyproject.toml.
        It returns the result of calling the equivalently named hook in a
        subprocess.
        tget_requires_for_build_wheeltconfig_settings(t
_call_hook(RRC((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRB–s
cCs+|jdit|ƒd6|d6|d6ƒS(sqPrepare a *.dist-info folder with metadata for this project.

        Returns the name of the newly created folder.

        If the build backend defines a hook with this name, it will be called
        in a subprocess. If not, the backend will be asked to build a wheel,
        and the dist-info extracted from that (unless _allow_fallback is
        False).
        t prepare_metadata_for_build_wheeltmetadata_directoryRCt_allow_fallback(RDR(RRFRCRG((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRE¤s
cCsF|dk	rt|ƒ}n|jdit|ƒd6|d6|d6ƒS(svBuild a wheel from this project.

        Returns the name of the newly created file.

        In general, this will call the 'build_wheel' hook in the backend.
        However, if that was previously called by
        'prepare_metadata_for_build_wheel', and the same metadata_directory is
        used, the previously built wheel will be copied to wheel_directory.
        tbuild_wheeltwheel_directoryRCRFN(R:RRD(RRIRCRF((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRH¶s
cCs|jdi|d6ƒS(s<Identify packages required for building a wheel

        Returns a list of dependency specifications, e.g.:
            ["setuptools >= 26"]

        This does not include requirements specified in pyproject.toml.
        It returns the result of calling the equivalently named hook in a
        subprocess.
        tget_requires_for_build_sdistRC(RD(RRC((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRJÊs
cCs$|jdit|ƒd6|d6ƒS(s£Build an sdist from this project.

        Returns the name of the newly created file.

        This calls the 'build_sdist' backend hook in a subprocess.
        tbuild_sdisttsdist_directoryRC(RDR(RRLRC((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRKØs
c
Csêtjddkr(|jjdƒ}n	|j}i|d6}|jr”tjj|jƒ}tjddkr‡|jtjƒƒ}n||d<nt	ƒG}i|d6}t
j|t|dƒddƒt
ƒ8}|jtjt|ƒ||gd	|jd
|ƒWdQXt
jt|dƒƒ}	|	jdƒrQt|	jd
dƒƒ‚n|	jdƒr{t|	jd
dƒƒ‚n|	jdƒrºtd|jd|jd|	jddƒƒ‚n|	jdƒrØt|ƒ‚n|	dSWdQXdS(NiitASCIItPEP517_BUILD_BACKENDtPEP517_BACKEND_PATHtkwargss
input.jsontindentR"R)soutput.jsontunsupportedRtt
no_backendtbackend_invalidRRRt
backend_errorthook_missingt
return_val(tsystversion_infoR<tencodeRR$tpathsepRtgetfilesystemencodingRRt
write_jsonR
RR=t
executabletstrR;t	read_jsontgetR!RRR(
RR RPR<R)RRt
hook_inputtscripttdata((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRDäs>	
	

	
		N(RRRR:RRRARBtTrueRERHRJRKRD(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyR9fst
LoggerWrappercBsAeZdZd„Zd„Zed„ƒZd„Zd„ZRS(sd
    Read messages from a pipe and redirect them
    to a logger (see python's logging module).
    cCsftjj|ƒt|_||_||_tjƒ\|_	|_
tj|j	ƒ|_|j
ƒdS(N(t	threadingtThreadRRftdaemontloggertlevelR$tpipetfd_readtfd_writetfdopentreadertstart(RRkRl((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRs			cCs|jS(N(Ro(R((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytfileno(scCs|jtjƒr|d S|S(Niÿÿÿÿ(tendswithR$tlinesep(tmsg((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytremove_newline+scCs.x'|jD]}|j|j|ƒƒq
WdS(N(Rqt_writeRw(Rtline((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pytrun/scCs|jj|j|ƒdS(N(RktlogRl(RR((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRx3s(	RRRRRststaticmethodRwRzRx(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyRgs	
		(%Rht
contextlibRR$tos.pathRRRR
Rt
subprocessRRRRYttempfileRRSRtimportlib.resourcesR	RtImportErrorRt	ExceptionRRRR!R:R*R,R8tobjectR9RiRg(((sL/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/wrappers.pyt<module>s.

				¯
Back to Directory File Manager