Your IP : 216.73.217.17


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

�
��Eac@sPdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZmZmZmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&e&r�ddl'm(Z(ddl)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl#m8Z8m9Z9nej:e;�Z<defd��YZ=de
e=fd��YZ>e$j?e$j@e$jAgZBd�ZCd 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.
i����N(tpartial(tPY2(t
cmdoptions(tCommand(tCommandContextMixIn(tCommandErrortPreviousBuildDirError(t
LinkCollector(t
PackageFinder(tSelectionPreferences(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>eZdZd�Zed��Zd�Zddd�ZRS(sE
    A class mixin for command classes needing _build_session().
    cCs tt|�j�d|_dS(N(tsuperR t__init__tNonet_session(tself((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR"6scCsug}t|dt�sCt|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((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt_get_index_urls;scCsI|jdkrB|j|j|��|_|jdk	sBt�n|jS(sGet a default-managed session.N(R$R#t
enter_contextt_build_sessiontAssertionError(R%R.((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytget_default_sessionJscCs%|js%tjj|j�s%t�td|jrLtjj|jd�ndd|dk	rd|n|jd|j	d|j
|��}|jr�|j|_n|j
r�|j
|_n|js�|r�|dk	r�|n|j|_n|jri|jd6|jd6|_n|j|j_|S(Ntcachethttptretriest
trusted_hostsR/thttps(t	cache_dirtostpathtisabsR5R
tjoinR#R9R:R2tcerttverifytclient_certttimeouttproxytproxiestno_inputtautht	prompting(R%R.R9RDtsession((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR4Us$%'			!	
N(	t__name__t
__module__t__doc__R"tclassmethodR2R6R#R4(((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR 1s
		tIndexGroupCommandcBseZdZd�ZRS(s�
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.
    c	Cspt|d�st�|js'|jr+dS|j|dddtd|j��}|�t||�WdQXdS(s�
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        R&NR9iRDi(thasattrR5tdisable_pip_version_checkR&R4tminRDR(R%R.RJ((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pythandle_pip_version_check�s(RKRLRMRS(((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyRO}scsd����fd�}|S(sNDecorator for common logic related to managing temporary
    directories.
    cSs%xtD]}|j|t�qWdS(N(tKEEPABLE_TEMPDIR_TYPESt
set_deleteR*(tregistrytt((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytconfigure_tempdir_registry�s
csj|jdk	st�|jr.�|j�ny�|||�SWn!tk
re�|j��nXdS(N(ttempdir_registryR#R5tno_cleanR(R%R.targs(RXtfunc(sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytwrapper�s	

((R\R]((RXR\sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytwith_cleanup�s	tRequirementCommandc
Bs�eZd�Zed��Zedd��Zedee	eedddd��Z
d�Zed��Zddd�Z
RS(	cOs3tt|�j||�|jjtj��dS(N(R!R_R"tcmd_optst
add_optionRRZ(R%R[tkw((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR"�scCs7tr d|jkrdSdSnd|jkr3dSdS(sEDetermines which resolver should be used, based on the given options.s
2020-resolvertlegacyslegacy-resolver(Rtfeatures_enabledtdeprecated_features_enabled(R.((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytdetermine_resolver_variant�scCs�|j}|dk	st�|j|�}	|	dkr^d|jk}
|
r�tjd�q�n%t}
d|jkr�tjd�ntd|d|j	d|d|j
d	|d
|d|jd|d
|jd|d|
�S(sQ
        Create a RequirementPreparer instance for the given parameters.
        s
2020-resolvers	fast-depss�pip is using lazily downloaded wheels using HTTP range requests to obtain dependency information. This experimental feature is enabled through --use-feature=fast-deps and it is not ready for production.s;fast-deps has no effect when used with the legacy resolver.t	build_dirtsrc_dirtdownload_dirtbuild_isolationtreq_trackerRJtprogress_bartfindertrequire_hashest
use_user_sitet
lazy_wheelN(
R>R#R5RfRdtloggertwarningR*RRhRjRlRn(R-ttemp_build_dirR.RkRJRmRoRittemp_build_dir_pathtresolver_variantRp((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytmake_requirement_preparer�s0	

				sto-satisfy-onlycCsttd|jd|
�}|j|�}
|
dkr�ddl}|jjjjj	d|d|d|d	|d
|d|j
d|d
|d|d|	d|�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-resolveri����NtpreparerRmtwheel_cachetmake_install_reqRotignore_dependenciestignore_installedtignore_requires_pythontforce_reinstalltupgrade_strategytpy_version_info(
RRt
isolated_modeRft,pip._internal.resolution.resolvelib.resolvert	_internalt
resolutiont
resolvelibtresolvertResolverR|t(pip._internal.resolution.legacy.resolverRc(R-RyRmR.RzRoR}R~RR�RxR�R{Rutpip((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt
make_resolver
s@				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|�q�Wxk|jD]`}xWt|d|d|d|�D]7}t|d|jd|j	dt�}|j|�q*WqWt
d�|D��r�t|_n|p�|j
p�|jsi|jd	6}
|jr�td
jt|
ddj|j�����qtd
j|
���n|S(sS
        Parse command-line arguments into the corresponding requirements.
        t
constraintRmR.RJRwt
user_suppliedRxcss|]}|jVqdS(N(thas_hash_options(t.0treq((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pys	<genexpr>|stnamesXYou 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(tconstraintsRtTrueRR�R*R+R
R#Rxt	editablesRtrequirementstanyRnR�t
find_linksRtformattdictR@(R%R[R.RmRJR�tfilenamet
parsed_reqt
req_to_addR�topts((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pytget_requirementsEs\
		
							'cCs/|j}|j�}|r+tj|�ndS(sE
        Trace basic information about the provided objects.
        N(tsearch_scopetget_formatted_locationsRqtinfo(RmR�t	locations((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyttrace_basic_info�s	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_binaryR~tlink_collectortselection_prefst
target_python(RtcreateR	R�R�tpreR�R(R%R.RJR�R~R�R�((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt_build_package_finder�s					N(RKRLR"tstaticmethodRfRNR#RvR*R�R�R�R�R�(((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyR_�s"		).	H(ERMtloggingR=t	functoolsRtpip._vendor.sixRtpip._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_prefsR	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	getLoggerRKRqR ROt	BUILD_ENVtEPHEM_WHEEL_CACHEt	REQ_BUILDRTR^R_(((sA/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.pyt<module>sF""L