a ljO@sddlmZddlmZmZddlmZddlmZm Z m Z m Z Gddde Z Gdd d e Z Gd d d e ZGd d d e ZdS)) SpecifierSet)NormalizedNamecanonicalize_name)InstallRequirement) CandidateCandidateLookup Requirement format_namec@seZdZeddddZedddZeddd Zee dd d Z eedd d Z edddZ e dddZeedddZdS)ExplicitRequirementN candidatereturncCs ||_dSNr selfr rT/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/requirements.py__init__ szExplicitRequirement.__init__rcCs t|jSr)strr rrrr__str__ szExplicitRequirement.__str__cCsdj|jj|jdS)Nz{class_name}({candidate!r})) class_namer )format __class____name__r rrrr__repr__szExplicitRequirement.__repr__cCs|jjSr)r project_namerrrrrsz ExplicitRequirement.project_namecCs|jjSr)r namerrrrr szExplicitRequirement.namecCs |jSr)r format_for_errorrrrrr! sz$ExplicitRequirement.format_for_errorcCs |jdfSrrrrrrget_candidate_lookup#sz(ExplicitRequirement.get_candidate_lookupcCs ||jkSrrrrrris_satisfied_by&sz#ExplicitRequirement.is_satisfied_by)r __module__ __qualname__rrrrrpropertyrrr r!rr"boolr#rrrrr sr c@seZdZeddddZedddZeddd Zee dd d Z eedd d Z edddZ e dddZeedddZdS)SpecifierRequirementN)ireqrcCs(|jdusJd||_t|j|_dS)NzThis is a link, not a specifier)link_ireq frozensetextras_extras)rr)rrrr+szSpecifierRequirement.__init__rcCs t|jjSr)rr+reqrrrrr0szSpecifierRequirement.__str__cCsdj|jjt|jjdS)Nz{class_name}({requirement!r}))rZ requirement)rrrrr+r/rrrrr3s zSpecifierRequirement.__repr__cCs|jjsJdt|jjjS)N'Specifier-backed ireq is always PEP 508)r+r/rr rrrrr9sz!SpecifierRequirement.project_namecCst|j|jSr)r rr.rrrrr >szSpecifierRequirement.namecCsZddt|dD}t|dkr(dSt|dkr<|dSd|ddd |dS) NcSsg|] }|qSr)strip).0srrr Hz9SpecifierRequirement.format_for_error..,rrz, z and )rsplitlenjoin)rpartsrrrr!Bs   z%SpecifierRequirement.format_for_errorcCs d|jfSr)r+rrrrr"Psz)SpecifierRequirement.get_candidate_lookupr cCsN|j|jks$Jd|jd|j|jjs4Jd|jjj}|j|jddS)Nz6Internal issue: Candidate is not for this requirement z vs r0TZ prereleases)r r+r/ specifiercontainsversion)rr specrrrr#Ss z$SpecifierRequirement.is_satisfied_by)rr$r%rrrrrr&rrr r!rr"rr'r#rrrrr(*sr(c@seZdZdZeeddddZedddZedd d Z e e dd d Z e edd dZ edddZedddZeedddZdS)RequiresPythonRequirementz4A requirement representing Requires-Python metadata.N)r>matchrcCs||_||_dSr)r> _candidate)rr>rCrrrrcsz"RequiresPythonRequirement.__init__rcCs d|jS)NzPython )r>rrrrrgsz!RequiresPythonRequirement.__str__cCsdj|jjt|jdS)Nz{class_name}({specifier!r}))rr>)rrrrr>rrrrrjsz"RequiresPythonRequirement.__repr__cCs|jjSr)rDrrrrrrpsz&RequiresPythonRequirement.project_namecCs|jjSr)rDr rrrrr tszRequiresPythonRequirement.namecCst|Srrrrrrr!xsz*RequiresPythonRequirement.format_for_errorcCs"|jj|jjddr|jdfSdS)NTr=NN)r>r?rDr@rrrrr"{s z.RequiresPythonRequirement.get_candidate_lookupr cCs(|j|jjksJd|jj|jddS)NzNot Python candidateTr=)r rDr>r?r@rrrrr#sz)RequiresPythonRequirement.is_satisfied_by)rr$r%__doc__rrrrrrr&rrr r!rr"r'r#rrrrrB`srBc@seZdZdZeddddZedddZedd d Ze edd d Z e edd dZ edddZ e dddZeedddZdS)UnsatisfiableRequirementz'A requirement that cannot be satisfied.N)r rcCs ||_dSr_name)rr rrrrsz!UnsatisfiableRequirement.__init__rcCs |jdS)Nz (unavailable)rIrrrrrsz UnsatisfiableRequirement.__str__cCsdj|jjt|jdS)Nz{class_name}({name!r}))rr )rrrrrJrrrrrsz!UnsatisfiableRequirement.__repr__cCs|jSrrIrrrrrsz%UnsatisfiableRequirement.project_namecCs|jSrrIrrrrr szUnsatisfiableRequirement.namecCst|SrrErrrrr!sz)UnsatisfiableRequirement.format_for_errorcCsdS)NrFrrrrrr"sz-UnsatisfiableRequirement.get_candidate_lookupr cCsdS)NFrrrrrr#sz(UnsatisfiableRequirement.is_satisfied_by)rr$r%rGrrrrrr&rr r!rr"rr'r#rrrrrHsrHN)Z pip._vendor.packaging.specifiersrZpip._vendor.packaging.utilsrrZpip._internal.req.req_installrbaserrr r r r(rBrHrrrrs  !6(