1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
U
H=®dCã@sÈddlZddlZddlmZddlmZddlmZmZm    Z    m
Z
ddl m Z ddl mZddlmZddlmZdd    lmZmZmZdd
lmZdd lmZd d lmZmZmZmZm Z d dl!m"Z"m#Z#m$Z$erªddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8m9Z9ddl:m;Z;ddl<m=Z=ddl>m?Z?ddl@mAZAd dlBmCZCmDZDd dlmEZEe.dƒZFe'e=eFfZGe'e2eCfZHe IeJ¡ZKGdd„deLƒZMdS)éN)Úsix)Úcanonicalize_name)ÚDistributionNotFoundÚInstallationErrorÚUnsupportedPythonVersionÚUnsupportedWheel)ÚWheel)ÚInstallRequirement)Ú get_supported)ÚHashes)Údist_in_site_packagesÚdist_in_usersiteÚget_installed_distributions)ÚMYPY_CHECK_RUNNING)Úrunning_under_virtualenvé)ÚAlreadyInstalledCandidateÚEditableCandidateÚExtrasCandidateÚ LinkCandidateÚRequiresPythonCandidate)ÚExplicitRequirementÚRequiresPythonRequirementÚSpecifierRequirement)    Ú    FrozenSetÚDictÚIterableÚListÚOptionalÚSequenceÚSetÚTupleÚTypeVar)Ú SpecifierSet)Ú _BaseVersion)Ú Distribution)ÚResolutionImpossible)Ú
CacheEntryÚ
WheelCache)Ú PackageFinder)ÚLink)ÚRequirementPreparer)ÚInstallRequirementProvider)Ú    CandidateÚ Requirement)Ú BaseCandidateÚCc@s„eZdZd dd„Zedd„ƒZdd„Zd    d
„Zd d „Zd d„Z    dd„Z
dd„Z d!dd„Z dd„Z dd„Zdd„Zdd„Zdd„ZdS)"ÚFactoryNFc Csh||_||_||_t|    ƒ|_||_||_||_||_|
|_    i|_
i|_ |s^dd„t ƒDƒ|_ ni|_ dS)NcSsi|]}t|jƒ|“qS©)rÚ project_name)Ú.0Údistr2r2úbD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/resolution/resolvelib/factory.pyÚ
<dictcomp>fsÿz$Factory.__init__.<locals>.<dictcomp>)Ú_finderÚpreparerÚ _wheel_cacherÚ_python_candidateÚ_make_install_req_from_specÚ_use_user_siteÚ_force_reinstallÚ_ignore_requires_pythonZuse_lazy_wheelÚ_link_candidate_cacheÚ_editable_candidate_cacherÚ_installed_dists) ÚselfÚfinderr9Úmake_install_reqÚ wheel_cacheÚ use_user_siteÚforce_reinstallÚignore_installedÚignore_requires_pythonÚpy_version_infoÚ
lazy_wheelr2r2r6Ú__init__Js 
þ
zFactory.__init__cCs|jS©N)r>)rCr2r2r6rHmszFactory.force_reinstallcCs t|||d}|rt||ƒS|S)N)Úfactory)rr)rCr5ÚextrasÚtemplateÚbaser2r2r6Ú_make_candidate_from_distrs
z!Factory._make_candidate_from_distcCsr|jr4||jkr(t|||||d|j|<|j|}n,||jkrVt|||||d|j|<|j|}|rnt||ƒS|S)N)rOÚnameÚversion)ÚeditablerArr@rr)rCÚlinkrPrQrTrUrRr2r2r6Ú_make_candidate_from_link~s, 
ÿ  
ÿ 
 
z!Factory._make_candidate_from_linkcCs|sdS|d}t|jjƒ}tƒ}tƒ}|D].}||jjM}||jddO}|t|jƒO}q,t     ¡}d}    d}
|j
sª||j krª|j |} | j }    |j |    ddrª|j| ||d}
|jj|||d} |  ¡D]:} | j|    krÜ|
rÜ|
}n|j| j|||| jd    }||| j<qÄ|    r|
r|
||    <t |¡S)
Nr2rF)Útrust_internetT)Ú prereleases)r5rPrQ)r3Ú    specifierÚhashes)rWrPrQrTrU)rÚreqrTr Ú    frozensetr[r\rPÚ collectionsÚ OrderedDictr>rBÚparsed_versionÚcontainsrSr8Úfind_best_candidateÚiter_applicablerUrXrWrÚ
itervalues)rCÚireqsr[rQrTr\rPÚireqÚ
candidatesÚinstalled_versionZinstalled_candidateZinstalled_distÚfoundZicanÚ    candidater2r2r6Ú_iter_found_candidates™sR  
ýý û  zFactory._iter_found_candidatesc    s‚tƒ}g}ˆD]4}| ¡\}}|dk    r0| |¡|dk    r| |¡q|sT| ||¡S|rp| ¡j}td |¡ƒ‚‡fdd„|DƒS)NzhCould not satisfy constraints for {!r}: installation from path or url cannot be constrained to a versionc3s(|] ‰t‡fdd„ˆDƒƒrˆVqdS)c3s|]}| ˆ¡VqdSrN)Zis_satisfied_by)r4r]©Úcr2r6Ú    <genexpr>÷sz4Factory.find_candidates.<locals>.<genexpr>.<genexpr>N)Úall)r4©Ú requirementsrmr6roõsÿz*Factory.find_candidates.<locals>.<genexpr>)    ÚsetZget_candidate_lookupÚaddÚappendrlÚpoprTrÚformat)    rCrrÚ
constraintZexplicit_candidatesrfr]ÚcandrgrTr2rqr6Úfind_candidatesÞs( 
 
ÿÿ
ÿzFactory.find_candidatescCsž| |¡s t d|j|j¡dS|js.t|ƒS|jjrht|jj    ƒ}| 
|j j   ¡¡shd |j    ¡}t|ƒ‚|j|jt|jƒ||jrŠt|jƒnddd}| |¡S)Nz6Ignoring %s: markers '%s' don't match your environmentz-{} is not a supported wheel on this platform.)rPrQrTrU)Ú match_markersÚloggerÚinforTÚmarkersrWrÚis_wheelrÚfilenameÚ    supportedr8Ú target_pythonÚget_tagsrwrrXr^rPrÚmake_requirement_from_candidate)rCrgÚrequested_extrasÚwheelÚmsgryr2r2r6Ú!make_requirement_from_install_reqús0
þ ÿûz)Factory.make_requirement_from_install_reqcCst|ƒSrN)r)rCrkr2r2r6r„sz'Factory.make_requirement_from_candidater2cCs| ||¡}| ||¡SrN)r<rˆ)rCr[Ú
comes_fromr…rgr2r2r6Úmake_requirement_from_specs z"Factory.make_requirement_from_speccCs|js|dkrdSt||jƒSrN)r?rr;)rCr[r2r2r6Ú make_requires_python_requirement"sz(Factory.make_requires_python_requirementcCs*|jdks|jjrdS|jj||tƒdS)a—Look up the link in the wheel cache.
 
        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
        nondeterministic contents due to file modification times.
        N)rWÚ package_nameÚsupported_tags)r:r9Úrequire_hashesÚget_cache_entryr
)rCrWrTr2r2r6Úget_wheel_cache_entry(s
ýzFactory.get_wheel_cache_entrycCsV|j |j¡}|dkrdS|js$|St|ƒr0|StƒrRt|ƒrRtd |j    |j
¡ƒ‚dS)NzVWill not install to the user site because it will lack sys.path precedence to {} in {}) rBÚgetrTr=r rr rrwr3Úlocation)rCrkr5r2r2r6Úget_dist_to_uninstall:sþÿzFactory.get_dist_to_uninstallcCs(d}|j|j|jjt|jƒd}t|ƒS)NzOPackage {package!r} requires a different Python: {version} not in {specifier!r})ÚpackagerUr[)rwrTr;rUÚstrr[r)rCÚ requirementrQZmessage_formatÚmessager2r2r6Ú_report_requires_python_errorXsÿýz%Factory._report_requires_python_errorc Cs~|jstdƒ‚|jD]$}t|jtƒr| |j|j¡Sqt|jƒdkr|jd\}}|dkrht|ƒ}nd     ||j
¡}t   d|¡t d     |¡ƒSdd„}d    d
„}d d „}g}    |jD],\}}|dkrÌ| ¡}
n||ƒ}
|     |
¡q²|    rî||    ƒ} nd } d     | ¡} t   | ¡d} |jD]B\}}| d} |r<| d     |j
|j¡} n| d} | | ¡} q| ddddd} t  | ¡t dƒS)Nz)Installation error reported with no causerrz {} (from {})z:Could not find a version that satisfies the requirement %sz%No matching distribution found for {}cSs2t|ƒdkr|dSd |dd…¡d|dS)Nrrz, éÿÿÿÿz and )ÚlenÚjoin)Úpartsr2r2r6Ú    text_joinŽs z1Factory.get_installation_error.<locals>.text_joincSsd |j|j¡S©Nz{} {})rwrTrU)ryr2r2r6Ú readable_form•sz5Factory.get_installation_error.<locals>.readable_formcSsD| ¡}|r|js"d |j|j¡St|jtƒr:t|jjƒSt|jƒSrž)Zget_install_requirementr‰rwrTrUÚ
isinstancer    r•)Úparentrgr2r2r6Údescribe_trigger™s 
  z8Factory.get_installation_error.<locals>.describe_triggerzthe requested packageszOCannot install {} because these package versions have conflicting dependencies.z
The conflict is caused by:z
    z{} {} depends on zThe user requested z
 
zTo fix this you could try to:
z91. loosen the range of package versions you've specified
z92. remove package versions to allow pip attempt to solve zthe dependency conflict
znResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies)ZcausesÚAssertionErrorr r–rr˜r¡ršr•rwrTr|ÚcriticalrZformat_for_errorrurUr}) rCÚeÚcauser]r¡Zreq_disprrŸr¢ZtriggersZtriggerr}r‡r2r2r6Úget_installation_errorist
 þ
 
 
þÿ    
 
ÿ
þÿþýü
ÿzFactory.get_installation_error)NF)r2)Ú__name__Ú
__module__Ú __qualname__rMÚpropertyrHrSrXrlrzrˆr„rŠr‹rr“r˜r§r2r2r2r6r1Is$ õ
#
 Eü
 
r1)Nr_ÚloggingÚ pip._vendorrZpip._vendor.packaging.utilsrÚpip._internal.exceptionsrrrrÚpip._internal.models.wheelrZpip._internal.req.req_installr    Ú&pip._internal.utils.compatibility_tagsr
Úpip._internal.utils.hashesr Úpip._internal.utils.miscr r rÚpip._internal.utils.typingrÚpip._internal.utils.virtualenvrrhrrrrrrrrrrÚtypingrrrrrrr r!r"Z pip._vendor.packaging.specifiersr#Úpip._vendor.packaging.versionr$Zpip._vendor.pkg_resourcesr%Zpip._vendor.resolvelibr&Úpip._internal.cacher'r(Ú"pip._internal.index.package_finderr)Úpip._internal.models.linkr*Ú pip._internal.operations.preparer+Úpip._internal.resolution.baser,rRr-r.r/r0ÚCacheZVersionCandidatesÚ    getLoggerr¨r|Úobjectr1r2r2r2r6Ú<module>s>        ,