ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyo

�
x�_c@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZddlmZddlmZdd	lmZdd
lmZddlmZddlmZmZdd
lmZddlmZmZddl m!Z!e!r�ddl"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddlm4Z4ddlm5Z5e#e6e$e4fZ7nej8e9�Z:e;d�Z<defd��YZ=dS(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(tcheck_invalid_constraint_type(tRequirementSet(tBaseResolver(t
get_supported(t
indent_log(tdist_in_usersitetnormalize_version_info(tdist_in_install_path(tcheck_requires_pythontget_requires_python(tMYPY_CHECK_RUNNING(tDefaultDicttListtOptionaltSettTuple(t
pkg_resources(t
WheelCache(tAbstractDistribution(t
PackageFinder(tLink(tRequirementPreparer(tInstallRequirement(tInstallRequirementProvidercCs�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}(
RRRtInvalidSpecifiertloggertwarningtproject_nametjointmaptstrtdebugRtformat(tdistR tignore_requires_pythontrequires_pythont
is_compatibletexctversion((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_check_dist_requires_python=s(
tResolvercBszeZdZdddhZdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�ZRS(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-onlycCs�tt|�j�|dkr/tjd }nt|�}||_||_||_	||_
|
|_|	|_||_
||_||_||_||_tt�|_dS(Ni(tsuperR2t__init__tNonetsysR Rt_py_version_infotpreparertfindertwheel_cachetupgrade_strategytforce_reinstalltignore_dependenciestignore_installedR,t
use_user_sitet_make_install_reqRtlistt_discovered_dependencies(tselfR9R:R;tmake_install_reqR@R>R?R,R=R<tpy_version_info((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyR5ts 											cCs�td|�}x1|D])}|jr2t|�n|j|�qWg}t�}xct|j|�D]O}y|j|j||��Wqet	k
r�}||_
|j|�qeXqeW|r�|�n|S(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.
        tcheck_supported_wheels(R	t
constraintRtadd_requirementRRtall_requirementstextendt_resolve_oneRtreqtappend(RDt	root_reqsRGtrequirement_setRMtdiscovered_reqsthash_errorsR/((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pytresolve�s"	
	
			cCs:|jdkrtS|jdkr&tS|jp5|jSdS(Nsto-satisfy-onlyR3(R<tFalsetTruet
user_suppliedRH(RDRM((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_is_upgrade_allowed�s
cCsA|jst|j�r4t|j�r4t|_nd|_dS(s4
        Set a requirement to be installed.
        N(R@R
tsatisfied_byRRUtshould_reinstallR6(RDRM((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_set_req_to_reinstall�s

cCs�|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(R?R6tcheck_if_existsR@RXR=RZRWR<tlinkR:tfind_requirementRURR(RDtreq_to_install((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_check_skip_installed�s*			
	


cCs{|j|�}|jj||�}|s.dS|j}|jrw|jpLd}djd|d|�}tj	|�n|S(Ns<none given>uqThe candidate selected for download or install is a yanked version: {candidate}
Reason for being yanked: {reason}t	candidatetreason(
RWR:R^R6R]t	is_yankedt
yanked_reasonR*R#R$(RDRMR[tbest_candidateR]Rbtmsg((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_find_requirement_links			cCs�|jdkr$|j|�|_n|jdks?|jjrCdS|jjd|jd|jdt��}|dk	r�t	j
d|j�|j|jkr�|jr�t
|_n|j|_ndS(sfEnsure that if a link can be found for this, that it is found.

        Note that req.link may still be None - if the requirement is already
        installed and not needed to be upgraded based on the return value of
        _is_upgrade_allowed().

        If preparer.require_hashes is True, don't use the wheel cache, because
        cached wheels, always built locally, have different hashes than the
        files downloaded from the index server and thus throw false hash
        mismatches. Furthermore, cached wheels at present have undeterministic
        contents due to file modification times.
        NR]tpackage_nametsupported_tagssUsing cached wheel link: %s(R]R6RgR;R9trequire_hashestget_cache_entrytnameRR#R)t
original_linkt
persistentRUtoriginal_link_is_in_wheel_cache(RDRMtcache_entry((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_populate_link%s		cCs�|jr|jj|�S|j|�}|jrD|jj||�S|j|�|jj|�}|js|j	|j
�n|jr�|jdkp�|jp�|jp�|j
jdk}|r�|j|�q�tjd|�n|S(szTakes a InstallRequirement and returns a single AbstractDist         representing a prepared variant of the same.
        sto-satisfy-onlytfiles<Requirement already satisfied (use --upgrade to upgrade): %s(teditableR9tprepare_editable_requirementR`RXtprepare_installed_requirementRqtprepare_linked_requirementR?R\R@R<R=R]tschemeRZR#tinfo(RDRMtskip_reasont
abstract_distt
should_modify((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt_get_abstract_dist_forCs*			


				
c

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

        :return: A list of additional InstallRequirements to also install.
        R R,csv�jt|���}�j}�j|d|d|�\}}|re|re�j|j|�n�j|�dS(Ntparent_req_nametextras_requested(RAR(RlRIRCRNRK(tsubreqR~tsub_install_reqR}t
to_scan_againt
add_to_parent(t	more_reqsR_RPRD(sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pytadd_req�s			

R}s!Installing extra requirements: %rt,s"%s does not provide the extra '%s'R~N(RHtpreparedRUR|tget_pkg_resources_distributionR1R8R,Rthas_requirementRlRIR6R>textrasR#R)R&tsortedtsetR$trequiresRsRXtsuccessfully_downloaded(
RDRPR_RzR+R�tmissing_requestedtmissingtavailable_requestedR((R�R_RPRDsY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyRLus@
	

		
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(RXRHtaddRCRlRN(RMtdep(tordertordered_reqstscheduleRD(sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyR��s	
(R�trequirementstvalues(RDtreq_settinstall_req((R�R�R�RDsY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pytget_installation_order�s	
N(t__name__t
__module__t__doc__t_allowed_strategiesR6R5RSRWRZR`RgRqR|RLR�(((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyR2ms	&	
	
	5			2	Y(>R�tloggingR7tcollectionsRt	itertoolsRtpip._vendor.packagingRtpip._internal.exceptionsRRRRRtpip._internal.req.req_installRtpip._internal.req.req_setR	tpip._internal.resolution.baseR
t&pip._internal.utils.compatibility_tagsRtpip._internal.utils.loggingRtpip._internal.utils.miscR
RRtpip._internal.utils.packagingRRtpip._internal.utils.typingRttypingRRRRRtpip._vendorRtpip._internal.cacheRtpip._internal.distributionsRt"pip._internal.index.package_finderRtpip._internal.models.linkRt pip._internal.operations.prepareRRRR(tDiscoveredDependenciest	getLoggerR�R#RTR1R2(((sY/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.pyt<module>s:((-

Zerion Mini Shell 1.0