????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_internal/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_internal/legacy_resolve.pyc

�
}�\]c@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZddlmZddlmZdd	lmZmZmZdd
lmZmZddlmZer�ddlmZmZmZm Z m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1nej2e3�Z4e5d�Z6de7fd��YZ8dS(syDependency Resolution

The dependency resolution in pip is performed as follows:

for top-level requirements:
    a. only one spec allowed per project, regardless of conflicts or not.
       otherwise a "double requirement" exception is raised
    b. they override sub-dependency requirements.
for sub-dependencies
    a. "first found, wins" (where the order is breadth first)
i����N(tdefaultdict(tchain(t
specifiers(tBestVersionAlreadyInstalledtDistributionNotFoundt	HashErrort
HashErrorstUnsupportedPythonVersion(tinstall_req_from_req_string(t
indent_log(tdist_in_usersitet
ensure_dirtnormalize_version_info(tcheck_requires_pythontget_requires_python(tMYPY_CHECK_RUNNING(tDefaultDicttListtOptionaltSettTuple(t
pkg_resources(t
WheelCache(tAbstractDistribution(t
PipSession(t
PackageFinder(tRequirementPreparer(tInstallRequirement(tRequirementSetcCs�t|�}yt|d|�}Wn-tjk
rQ}tjd|j|�dSX|r\dSdjtt	|��}|r�tj
d|j||�dStdj|j||���dS(s�
    Check whether the given Python version is compatible with a distribution's
    "Requires-Python" value.

    :param version_info: A 3-tuple of ints representing the Python
        major-minor-micro version to check.
    :param ignore_requires_python: Whether to ignore the "Requires-Python"
        value if the given Python version isn't compatible.

    :raises UnsupportedPythonVersion: When the given Python version isn't
        compatible.
    tversion_infos-Package %r has an invalid Requires-Python: %sNt.sBIgnoring failed Requires-Python check for package %r: %s not in %rs8Package {!r} requires a different Python: {} not in {!r}(
RR
RtInvalidSpecifiertloggertwarningtproject_nametjointmaptstrtdebugRtformat(tdistRtignore_requires_pythontrequires_pythont
is_compatibletexctversion((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyt_check_dist_requires_python1s(
tResolvercBskeZdZdddhZddd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�ZRS(
s�Resolves which packages need to be installed/uninstalled to perform     the requested operation without breaking the requirements of any package.
    teagersonly-if-neededsto-satisfy-onlycCs�tt|�j�||jks(t�|
dkrDtjd }
nt|
�}
|
|_	||_
||_||_||_
d|_||_|	|_|
|_||_||_||_||_||_tt�|_dS(Ni(tsuperR/t__init__t_allowed_strategiestAssertionErrortNonetsysRRt_py_version_infotpreparertfindertsessiontwheel_cachetrequire_hashestupgrade_strategytforce_reinstalltisolatedtignore_dependenciestignore_installedR)t
use_user_sitet
use_pep517Rtlistt_discovered_dependencies(tselfR8R:R9R;RBR@RAR)R>R?R=RCtpy_version_info((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyR2hs(														c	Cs|jjrt|jj�n|jt|jj��}|jpWtd�|D��|_|j	j
}|j�}|r�tj
|�ng}t�}x`t||�D]O}y|j|j||��Wq�tk
r�}||_|j|�q�Xq�W|r|�ndS(s�Resolve what operations need to be done

        As a side-effect of this method, the packages (and their dependencies)
        are downloaded, unpacked and prepared for installation. This
        preparation is done by ``pip.operations.prepare``.

        Once PyPI has static dependency metadata available, it would be
        possible to move the preparation to become a step separated from
        dependency resolution.
        css|]}|jVqdS(N(thas_hash_options(t.0treq((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pys	<genexpr>�sN(R8twheel_download_dirRtunnamed_requirementsRDtrequirementstvaluesR<tanyR9tsearch_scopetget_formatted_locationsR tinfoRRtextendt_resolve_oneRRJtappend(	RFtrequirement_sett	root_reqsRPt	locationstdiscovered_reqsthash_errorsRJR,((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pytresolve�s*
			cCsF|jdkrtS|jdkr&tS|jdks;t�|jSdS(Nsto-satisfy-onlyR0sonly-if-needed(R=tFalsetTrueR4t	is_direct(RFRJ((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyt_is_upgrade_allowed�scCs5|jst|j�r(|j|_nd|_dS(s4
        Set a requirement to be installed.
        N(RBR
tsatisfied_bytconflicts_withR5(RFRJ((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyt_set_req_to_reinstall�scCs�|jr
dS|j|j�|js*dS|jrD|j|�dS|j|�sj|jdkrfdSdS|j	s�y|j
j|dt�Wq�t
k
r�dStk
r�q�Xn|j|�dS(sCheck if req_to_install should be skipped.

        This will check if the req is installed, and whether we should upgrade
        or reinstall it, taking into account all the relevant user options.

        After calling this req_to_install will only have satisfied_by set to
        None if the req_to_install is to be upgraded/reinstalled etc. Any
        other value will be a dist recording the current thing installed that
        satisfies the requirement.

        Note that for vcs urls and the like we can't assess skipping in this
        routine - we simply identify that we need to pull the thing down,
        then later on it is pulled down and introspected to assess upgrade/
        reinstalls etc.

        :return: A text reason for why it was skipped, or None.
        sonly-if-neededs#already satisfied, skipping upgradesalready satisfiedtupgradesalready up-to-dateN(RAR5tcheck_if_existsRBR`R>RbR_R=tlinkR9tfind_requirementR]RR(RFtreq_to_install((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyt_check_skip_installed�s*			
	


cCsG|jdk	std��|jrF|jj||j|j|j�S|jdks[t�|j	|�}|jr�|jj
||j|�S|j|�}|jj||j
|j||j�}|js�|j|j�n|jrC|jdkp|jp|jp|jjdk}|r0|j|�qCtjd|�n|S(szTakes a InstallRequirement and returns a single AbstractDist         representing a prepared variant of the same.
        s9require_hashes should have been set in Resolver.resolve()sto-satisfy-onlytfiles<Requirement already satisfied (use --upgrade to upgrade): %sN(R<R5R4teditableR8tprepare_editable_requirementRBR9R`Rhtprepare_installed_requirementR_tprepare_linked_requirementR:RARdR=R>RetschemeRbR RR(RFRJtskip_reasontupgrade_allowedt
abstract_distt
should_modify((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyt_get_abstract_dist_fors6										
c

s��js�jrgSt�_�jj���j��}|j�}t|d�jd�j	�g�����fd�}t
��#�j�j�s�t�_
�j�dd	�n�js��jr�tjddj�j��ntt�j�t|j��}x!|D]}tjd||�qWtt|j�t�j�@�}x*|j|�D]}	||	d|�qhWn�jr��jr��jj��nWd	QX�S(
sxPrepare a single requirements file.

        :return: A list of additional InstallRequirements to also install.
        RR)c	s�tt|��d�jd�jd�j�}�j}�j|d|d|�\}}|r}|r}�j|j|�n�j	|�dS(NR?R;RCtparent_req_nametextras_requested(
RR%R?R;RCtnametadd_requirementRERURS(tsubreqRutsub_install_reqRtt
to_scan_againt
add_to_parent(t	more_reqsRgRVRF(s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pytadd_reqts				

Rts!Installing extra requirements: %rt,s"%s does not provide the extra '%s'RuN(t
constrainttpreparedR]treqs_to_cleanupRURstget_pkg_resources_distributionR.R7R)R	thas_requirementRvR^RwR5R@textrasR R&R#tsortedtsetR!trequiresRjR`tsuccessfully_downloaded(
RFRVRgRqR(R}tmissing_requestedtmissingtavailable_requestedRx((R|RgRVRFs;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyRTRsD
	

			
csOg�t������fd��x!|jj�D]}�|�q7W�S(s�Create the installation order.

        The installation order is topological - requirements are installed
        before the requiring thing. We break cycles at an arbitrary point,
        and make no other guarantees.
        csi|js|�krdS|jr&dS�j|�x"�j|jD]}�|�qDW�j|�dS(N(R`RtaddRERvRU(RJtdep(tordertordered_reqstscheduleRF(s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyR��s	
(R�RMRN(RFtreq_settinstall_req((R�R�R�RFs;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pytget_installation_order�s	
N(
t__name__t
__module__t__doc__R3R5R2R[R_RbRhRsRTR�(((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyR/as$	3	
		5	:	](9R�tloggingR6tcollectionsRt	itertoolsRtpip._vendor.packagingRtpip._internal.exceptionsRRRRRtpip._internal.req.constructorsRtpip._internal.utils.loggingR	tpip._internal.utils.miscR
RRtpip._internal.utils.packagingR
Rtpip._internal.utils.typingRttypingRRRRRtpip._vendorRtpip._internal.cacheRtpip._internal.distributionsRtpip._internal.downloadRtpip._internal.indexRt pip._internal.operations.prepareRtpip._internal.req.req_installRtpip._internal.req.req_setRt	getLoggerR�R R\R.tobjectR/(((s;/tmp/pip-install-ewDPok/pip/pip/_internal/legacy_resolve.pyt<module>s0((-