o 7]hd@sddlmZmZmZmZmZddlmZddlm Z m Z ddl m Z m Z ddlmZmZddlmZddlmZeedeefZee e fZd ed eed efd d ZGdddZGdddZdeddd efddZGdddZdS)) FrozenSetIterableOptionalTupleUnion) SpecifierSet)NormalizedNamecanonicalize_name) LegacyVersionVersion)Linklinks_equivalent)InstallRequirement)Hashes CandidateprojectextrasreturncCs,|s|Stdd|D}d|d|S)Ncss|]}t|VqdSN)r ).0erJ/usr/lib/python3/dist-packages/pip/_internal/resolution/resolvelib/base.py szformat_name..z{}[{}],)sortedformatjoin)rrcanonical_extrasrrr format_namesrc@seZdZdededeeddfddZeddd Z ed e ddfd d Z de fd dZ de ddfddZddde fddZdS) Constraint specifierhasheslinksrNcCs||_||_||_dSr)r!r"r#)selfr!r"r#rrr__init__s zConstraint.__init__cCsttttSr)r rr frozenset)clsrrremptyszConstraint.emptyireqcCs.|jr t|jgnt}t|j|jdd|SNF)trust_internet)linkr&r r!r")r'r)r#rrr from_ireq"szConstraint.from_ireqcCst|jpt|jpt|jSr)boolr!r"r#r$rrr__bool__'szConstraint.__bool__othercCsRt|tstS|j|j@}|j|jdd@}|j}|jr#||jg}t|||Sr*) isinstancerNotImplementedr!r"r#r,unionr )r$r1r!r"r#rrr__and__*s   zConstraint.__and__ candidatercs4|jrtfdd|jDsdS|jjjddS)Nc3s|]}t|VqdSr) _match_link)rr,r6rrr6sz-Constraint.is_satisfied_by..FT) prereleases)r#allr!containsversionr$r6rr8ris_satisfied_by4szConstraint.is_satisfied_by)rr )__name__ __module__ __qualname__rrrr r% classmethodr(rr-r.r0r5r>rrrrr s"   r c@s^eZdZedefddZedefddZdddefdd Z de fd d Z defd d Z dS) RequirementrcCtd)zThe "project name" of a requirement. This is different from ``name`` if this requirement contains extras, in which case ``name`` would contain the ``[...]`` part, while this refers to the name of the project. Subclass should overrideNotImplementedErrorr/rrr project_name?zRequirement.project_namecCrD)zThe name identifying this requirement in the resolver. This is different from ``project_name`` if this requirement contains extras, where ``project_name`` would not contain the ``[...]`` part. rErFr/rrrnameIzRequirement.namer6rcCsdSNFrr=rrrr>RszRequirement.is_satisfied_bycCrDNrErFr/rrrget_candidate_lookupUz Requirement.get_candidate_lookupcCrDrMrFr/rrrformat_for_errorXrOzRequirement.format_for_errorN) r?r@rApropertyrrHstrrJr.r>CandidateLookuprNrPrrrrrC>s rCr,r6cCs|jr t||jSdSrL) source_linkr )r,r6rrrr7\s r7c@seZdZedefddZedefddZedefddZ ede fdd Z ede fd d Z ede efd d Zde dee efddZde efddZdefddZdS)rrcCrD)zThe "project name" of the candidate. This is different from ``name`` if this candidate contains extras, in which case ``name`` would contain the ``[...]`` part, while this refers to the name of the project. Override in subclassrFr/rrrrHcrIzCandidate.project_namecCrD)zThe name identifying this candidate in the resolver. This is different from ``project_name`` if this candidate contains extras, where ``project_name`` would not contain the ``[...]`` part. rUrFr/rrrrJmrKzCandidate.namecCrDNrUrFr/rrrr<vzCandidate.versioncCrDrVrFr/rrr is_installedzrWzCandidate.is_installedcCrDrVrFr/rrr is_editable~rWzCandidate.is_editablecCrDrVrFr/rrrrTrWzCandidate.source_link with_requirescCrDrVrF)r$rZrrriter_dependenciesrOzCandidate.iter_dependenciescCrDrVrFr/rrrget_install_requirementrOz!Candidate.get_install_requirementcCrDrMrFr/rrrrPrOzCandidate.format_for_errorN)r?r@rArQrrHrRrJCandidateVersionr<r.rXrYrr rTrrCr[rr\rPrrrrrbs  N)typingrrrrr pip._vendor.packaging.specifiersrpip._vendor.packaging.utilsrr pip._vendor.packaging.versionr r pip._internal.models.linkr r pip._internal.req.req_installrpip._internal.utils.hashesrrSr]rRrr rCr.r7rrrrrs    (