zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
H=®dŸã@sˆddlmZddlmZddlmZmZerTddlmZddl    m
Z
ddlm Z m Z Gdd    „d    eƒZ Gd
d „d eƒZGd d „d eƒZdS)é)Úcanonicalize_name)ÚMYPY_CHECK_RUNNINGé)Ú RequirementÚ format_name)Ú SpecifierSet)ÚInstallRequirement)Ú    CandidateÚCandidateLookupc@s@eZdZdd„Zdd„Zedd„ƒZdd„Zd    d
„Zd d „Z    d S)ÚExplicitRequirementcCs
||_dS©N©Ú    candidate©Úselfr©rúgD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/resolution/resolvelib/requirements.pyÚ__init__szExplicitRequirement.__init__cCsdj|jj|jdS)Nz{class_name}({candidate!r}))Ú
class_namer)ÚformatÚ    __class__Ú__name__r©rrrrÚ__repr__sþzExplicitRequirement.__repr__cCs|jjSr )rÚnamerrrrrszExplicitRequirement.namecCs
|j ¡Sr )rÚformat_for_errorrrrrr!sz$ExplicitRequirement.format_for_errorcCs
|jdfSr r rrrrÚget_candidate_lookup%sz(ExplicitRequirement.get_candidate_lookupcCs
||jkSr r rrrrÚis_satisfied_by)sz#ExplicitRequirement.is_satisfied_byN)
rÚ
__module__Ú __qualname__rrÚpropertyrrrrrrrrr s
r c@sHeZdZdd„Zdd„Zdd„Zedd„ƒZd    d
„Zd d „Z    d d„Z
dS)ÚSpecifierRequirementcCs(|jdkstdƒ‚||_t|jƒ|_dS)NzThis is a link, not a specifier)ÚlinkÚAssertionErrorÚ_ireqÚ    frozensetÚextrasÚ_extras)rÚireqrrrr/szSpecifierRequirement.__init__cCs t|jjƒSr )Ústrr$ÚreqrrrrÚ__str__5szSpecifierRequirement.__str__cCsdj|jjt|jjƒdS)Nz{class_name}({requirement!r}))rÚ requirement)rrrr)r$r*rrrrr9s
þzSpecifierRequirement.__repr__cCst|jjjƒ}t||jƒSr )rr$r*rrr')rÚcanonical_namerrrr@szSpecifierRequirement.namecCsZdd„t|ƒ d¡Dƒ}t|ƒdkr(dSt|ƒdkr<|dSd |dd…¡d    |dS)
NcSsg|] }| ¡‘qSr)Ústrip)Ú.0ÚsrrrÚ
<listcomp>Msz9SpecifierRequirement.format_for_error.<locals>.<listcomp>ú,rÚrz, éÿÿÿÿz and )r)ÚsplitÚlenÚjoin)rÚpartsrrrrFs   z%SpecifierRequirement.format_for_errorcCs
d|jfSr )r$rrrrrUsz)SpecifierRequirement.get_candidate_lookupcCs:|j|jks td |j|j¡ƒ‚|jjj}|j|jddS)Nz?Internal issue: Candidate is not for this requirement  {} vs {}T©Ú prereleases)rr#rr$r*Ú    specifierÚcontainsÚversion)rrÚspecrrrrYsÿÿ
z$SpecifierRequirement.is_satisfied_byN) rrrrr+rr rrrrrrrrr!.s
r!c@sDeZdZdZdd„Zdd„Zedd„ƒZdd    „Zd
d „Z    d d „Z
dS)ÚRequiresPythonRequirementz9A requirement representing Requires-Python metadata.
    cCs||_||_dSr )r;Ú
_candidate)rr;Úmatchrrrrhsz"RequiresPythonRequirement.__init__cCsdj|jjt|jƒdS)Nz{class_name}({specifier!r}))rr;)rrrr)r;rrrrrmsþz"RequiresPythonRequirement.__repr__cCs|jjSr )r@rrrrrrtszRequiresPythonRequirement.namecCsdt|jƒS)NzPython )r)r;rrrrrysz*RequiresPythonRequirement.format_for_errorcCs"|jj|jjddr|jdfSdS)NTr9)NN)r;r<r@r=rrrrr}s
z.RequiresPythonRequirement.get_candidate_lookupcCs(|j|jjkstdƒ‚|jj|jddS)NzNot Python candidateTr9)rr@r#r;r<r=rrrrrƒsz)RequiresPythonRequirement.is_satisfied_byN) rrrÚ__doc__rrr rrrrrrrrr?es
r?N)Zpip._vendor.packaging.utilsrÚpip._internal.utils.typingrÚbaserrZ pip._vendor.packaging.specifiersrZpip._internal.req.req_installrr    r
r r!r?rrrrÚ<module>s    7