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||_t|j|_dSr)_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__cCst|jjjSr)rr*r.r 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 cCs|jjj}|j|jddSNTZ prereleases)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=rBrrrrcsz"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)rCrrrrrrpsz&RequiresPythonRequirement.project_namecCs|jjSr)rCr rrrrr tszRequiresPythonRequirement.namecCst|Srrrrrrr!xsz*RequiresPythonRequirement.format_for_errorcCs"|jj|jjddr|jdfSdS)NTr<NN)r=r>rCr?rrrrr"{s z.RequiresPythonRequirement.get_candidate_lookupr cCs|jj|jddSr;)r=r>r?rrrrr#sz)RequiresPythonRequirement.is_satisfied_by)rr$r%__doc__rrrrrrr&rrr r!rr"r'r#rrrrrA`srAc@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)rHrrrrrsz UnsatisfiableRequirement.__str__cCsdj|jjt|jdS)Nz{class_name}({name!r}))rr )rrrrrIrrrrrsz!UnsatisfiableRequirement.__repr__cCs|jSrrHrrrrrsz%UnsatisfiableRequirement.project_namecCs|jSrrHrrrrr szUnsatisfiableRequirement.namecCst|SrrDrrrrr!sz)UnsatisfiableRequirement.format_for_errorcCsdS)NrErrrrrr"sz-UnsatisfiableRequirement.get_candidate_lookupr cCsdS)NFrrrrrr#sz(UnsatisfiableRequirement.is_satisfied_by)rr$r%rFrrrrrr&rr r!rr"rr'r#rrrrrGsrGN)Z pip._vendor.packaging.specifiersrZpip._vendor.packaging.utilsrrZpip._internal.req.req_installrbaserrr r r r(rArGrrrrs  !6(