a ljd@sddlmZmZmZmZmZddlmZddlm Z m Z ddl m Z m Z ddlmZmZddlmZddlmZeedeefZee e fZeeeed d d ZGd d d ZGdddZededddZGdddZdS)) FrozenSetIterableOptionalTupleUnion) SpecifierSet)NormalizedNamecanonicalize_name) LegacyVersionVersion)Linklinks_equivalent)InstallRequirement)Hashes Candidate)projectextrasreturncCs,|s|Stdd|D}d|d|S)Ncss|]}t|VqdSN)r ).0erL/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/base.py zformat_name..z{}[{}],)sortedformatjoin)rrZcanonical_extrasrrr format_namesrc@sxeZdZeeeeddddZeddddZ ee ddd d Z e dd d Z e dd ddZde dddZdS) ConstraintN) specifierhasheslinksrcCs||_||_||_dSr)r!r"r#)selfr!r"r#rrr__init__szConstraint.__init__rcCsttttSr)r rr frozenset)clsrrremptyszConstraint.empty)ireqrcCs.|jrt|jgnt}t|j|jdd|SNF)Ztrust_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__)otherrcCsRt|tstS|j|j@}|j|jdd@}|j}|jrF||jg}t|||Sr+) isinstancerNotImplementedr!r"r#r,unionr )r$r1r!r"r#rrr__and__*s  zConstraint.__and__r candidatercs4|jr"tfdd|jDs"dS|jjjddS)Nc3s|]}t|VqdSr) _match_link)rr,r7rrr6rz-Constraint.is_satisfied_by..FT)Z prereleases)r#allr!containsversionr$r7rr9ris_satisfied_by4szConstraint.is_satisfied_by)__name__ __module__ __qualname__rrrr r% classmethodr)rr-r.r0r5r>rrrrr s   r c@s\eZdZeedddZeedddZdeddd Z e dd d Z edd d Z dS) Requirementr&cCs tddS)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 overrideNNotImplementedErrorr/rrr project_name?szRequirement.project_namecCs tddS)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. rDNrEr/rrrnameIszRequirement.namerr6cCsdSNFrr=rrrr>RszRequirement.is_satisfied_bycCs tddSNrDrEr/rrrget_candidate_lookupUsz Requirement.get_candidate_lookupcCs tddSrJrEr/rrrformat_for_errorXszRequirement.format_for_errorN) r?r@rApropertyrrGstrrHr.r>CandidateLookuprKrLrrrrrC>s rC)r,r7rcCs|jrt||jSdSrI) source_linkr )r,r7rrrr8\s r8c@seZdZeedddZeedddZeedddZ ee ddd Z ee dd d Z ee edd d Ze ee edddZe edddZedddZdS)rr&cCs tddS)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 subclassNrEr/rrrrGcszCandidate.project_namecCs tddS)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. rQNrEr/rrrrHmszCandidate.namecCs tddSNrQrEr/rrrr<vszCandidate.versioncCs tddSrRrEr/rrr is_installedzszCandidate.is_installedcCs tddSrRrEr/rrr is_editable~szCandidate.is_editablecCs tddSrRrEr/rrrrPszCandidate.source_link) with_requiresrcCs tddSrRrE)r$rUrrriter_dependenciesszCandidate.iter_dependenciescCs tddSrRrEr/rrrget_install_requirementsz!Candidate.get_install_requirementcCs tddSrJrEr/rrrrLszCandidate.format_for_errorN)r?r@rArMrrGrNrHCandidateVersionr<r.rSrTrr rPrrCrVrrWrLrrrrrbs N)typingrrrrrZ pip._vendor.packaging.specifiersrZpip._vendor.packaging.utilsrr Zpip._vendor.packaging.versionr r Zpip._internal.models.linkr r Zpip._internal.req.req_installrZpip._internal.utils.hashesrrOrXrNrr rCr.r8rrrrrs    (