Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyo


t_c@sPdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZmZmZmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&e&rddl'm(Z(ddl)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl#m8Z8m9Z9nej:e;Z<de
fdYZ=dee=fdYZ>e$j?e$j@e$jAgZBdZCd e>fd!YZDdS("sContains the Command base classes that depend on PipSession.

The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
iN(tpartial(t
cmdoptions(tCommand(tCommandContextMixIn(tCommandErrortPreviousBuildDirError(t
LinkCollector(t
PackageFinder(tSelectionPreferences(t
Downloader(t
PipSession(tRequirementPreparer(tinstall_req_from_editabletinstall_req_from_linet#install_req_from_parsed_requirementtinstall_req_from_req_string(tparse_requirements(tpip_self_version_check(t
tempdir_kinds(tMYPY_CHECK_RUNNING(tValues(tAnytListtOptionaltTuple(t
WheelCache(tTargetPython(tInstallRequirement(tRequirementTracker(tBaseResolver(t
TempDirectorytTempDirectoryTypeRegistrytSessionCommandMixincBs>eZdZdZedZdZdddZRS(sE
    A class mixin for command classes needing _build_session().
    cCs tt|jd|_dS(N(tsuperR t__init__tNonet_session(tself((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyR"8scCsug}t|dtsCt|dd}|rC|j|qCnt|dd}|rk|j|n|ptdS(s7Return a list of index urls from user-provided options.tno_indext	index_urltextra_index_urlsN(tgetattrtFalseR#tappendtextend(tclstoptionst
index_urlsturlturls((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyt_get_index_urls=scCs4|jdkr-|j|j||_n|jS(sGet a default-managed session.N(R$R#t
enter_contextt_build_session(R%R.((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pytget_default_sessionLsc
Cstd|jr'tjj|jdndd|dk	r?|n|jd|jd|j|}|j	r{|j	|_
n|jr|j|_	n|js|r|dk	r|n|j|_n|j
ri|j
d6|j
d6|_n|j|j_|S(Ntcachethttptretriest
trusted_hostsR/thttps(R
t	cache_dirtostpathtjoinR#R8R9R2tcerttverifytclient_certttimeouttproxytproxiestno_inputtautht	prompting(R%R.R8RBtsession((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyR4Ws"'			!	
N(	t__name__t
__module__t__doc__R"tclassmethodR2R5R#R4(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyR 3s
		tIndexGroupCommandcBseZdZdZRS(s
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.
    c	Cs[|js|jrdS|j|dddtd|j}|t||WdQXdS(s
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        NR8iRBi(tdisable_pip_version_checkR&R4tminRBR(R%R.RH((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pythandle_pip_version_checks
(RIRJRKRP(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyRMscsdfd}|S(sNDecorator for common logic related to managing temporary
    directories.
    cSs%xtD]}|j|tqWdS(N(tKEEPABLE_TEMPDIR_TYPESt
set_deleteR*(tregistrytt((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pytconfigure_tempdir_registrys
csU|jr|jny|||SWn!tk
rP|jnXdS(N(tno_cleanttempdir_registryR(R%R.targs(RUtfunc(sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pytwrappers	

((RYRZ((RURYsN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pytwith_cleanups	tRequirementCommandc
BsteZdZedddZedeeeeddddZdZ	edZ
dddZRS(cOs3tt|j|||jjtjdS(N(R!R\R"tcmd_optst
add_optionRRV(R%RXtkw((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyR"sc
Csjt|d|j}|j}	td|	d|jd|d|d|jd|d|d	|d
|jd|
S(sQ
        Create a RequirementPreparer instance for the given parameters.
        tprogress_bart	build_dirtsrc_dirtdownload_dirtwheel_download_dirtbuild_isolationtreq_trackert
downloadertfindertrequire_hashest
use_user_site(R	R`R=RRbReRi(
ttemp_build_dirR.RfRHRhRjRcRdRgttemp_build_dir_path((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pytmake_requirement_preparers				sto-satisfy-onlyc
Csttd|jd|	}d|jkrddl}|jjjjj	d|d|d|d	|d
|d|j
d|d
|d|d|d|
dd|jkSddl}|jjjjj	d|d|d|d	|d
|d|j
d|d
|d|d|d|
S(sF
        Create a Resolver instance for the given parameters.
        tisolatedt
use_pep517s
2020-resolveriNtpreparerRhtwheel_cachetmake_install_reqRjtignore_dependenciestignore_installedtignore_requires_pythontforce_reinstalltupgrade_strategytpy_version_infot
lazy_wheels	fast-deps(
RRt
isolated_modetfeatures_enabledt,pip._internal.resolution.resolvelib.resolvert	_internalt
resolutiont
resolvelibtresolvertResolverRst(pip._internal.resolution.legacy.resolvertlegacy(
RpRhR.RqRjRtRuRvRwRoRxRrtpip((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyt
make_resolvers@				cCsg}xh|jD]]}xTt|dtd|d|d|D].}t|d|jdt}|j|q;WqWxB|D]:}	t|	dd|jd|j	dt}|j|qxWxB|j
D]7}	t|	dtd|jd|j	}|j|qWxk|jD]`}xWt|d|d|d|D]7}t|d|jd|j	dt}|j|q*WqWt
d|Drt|_n|p|j
p|jsi|jd	6}
|jrtd
jt|
ddj|jqtd
j|
n|S(sS
        Parse command-line arguments into the corresponding requirements.
        t
constraintRhR.RHRnt
user_suppliedRocss|]}|jVqdS(N(thas_hash_options(t.0treq((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pys	<genexpr>ZstnamesXYou must give at least one requirement to {name} (maybe you meant "pip {name} {links}"?)tlinkst sHYou must give at least one requirement to {name} (see "pip help {name}")N(tconstraintsRtTrueRRzR*R+R
R#Rot	editablesRtrequirementstanyRiRt
find_linksRtformattdictR>(R%RXR.RhRHRtfilenamet
parsed_reqt
req_to_addRtopts((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pytget_requirements#s\
		
							'cCs/|j}|j}|r+tj|ndS(sE
        Trace basic information about the provided objects.
        N(tsearch_scopetget_formatted_locationstloggertinfo(RhRt	locations((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyttrace_basic_infoks	cCsatj|d|}tdtd|jd|jd|jd|}tjd|d|d	|S(
s
        Create a package finder appropriate to this requirement command.

        :param ignore_requires_python: Whether to ignore incompatible
            "Requires-Python" values in links. Defaults to False.
        R.tallow_yankedtformat_controltallow_all_prereleasest
prefer_binaryRutlink_collectortselection_prefst
target_python(RtcreateRRRtpreRR(R%R.RHRRuRR((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyt_build_package_finderws					N(RIRJR"tstaticmethodR#RmR*RRRRR(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyR\s"	-	H(ERKtloggingR<t	functoolsRtpip._internal.cliRtpip._internal.cli.base_commandRt!pip._internal.cli.command_contextRtpip._internal.exceptionsRRtpip._internal.index.collectorRt"pip._internal.index.package_finderRt$pip._internal.models.selection_prefsRtpip._internal.network.downloadR	tpip._internal.network.sessionR
t pip._internal.operations.prepareRtpip._internal.req.constructorsRR
RRtpip._internal.req.req_fileRt!pip._internal.self_outdated_checkRtpip._internal.utils.temp_dirRtpip._internal.utils.typingRtoptparseRttypingRRRRtpip._internal.cacheRt"pip._internal.models.target_pythonRtpip._internal.req.req_installRtpip._internal.req.req_trackerRtpip._internal.resolution.baseRRRt	getLoggerRIRR RMt	BUILD_ENVtEPHEM_WHEEL_CACHEt	REQ_BUILDRQR[R\(((sN/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/req_command.pyt<module>sF""L 	
Back to Directory File Manager