3 ”ReÎã@s¦ddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZerˆdd lmZmZmZmZmZdd lmZejeƒZGd d „d eƒZdS) é)Úabsolute_importN)Ú OrderedDict)Úcanonicalize_name)ÚInstallationError)ÚWheel)Úcompatibility_tags)ÚMYPY_CHECK_RUNNING)ÚDictÚIterableÚListÚOptionalÚTuple)ÚInstallRequirementc@s\eZdZddd„Zdd„Zdd„Zdd „Zd d „Zdd d„Zdd„Z dd„Z e dd„ƒZ d S)ÚRequirementSetTcCstƒ|_||_g|_dS)z!Create a RequirementSet. N)rÚ requirementsÚcheck_supported_wheelsÚunnamed_requirements)Úselfr©rúˆ/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_set.pyÚ__init__szRequirementSet.__init__cCs4tdd„|jjƒDƒdd„d�}djdd„|DƒƒS)Ncss|]}|js|VqdS)N)Ú comes_from)Ú.0Úreqrrrú $sz)RequirementSet.__str__..cSs t|jƒS)N)rÚname)rrrrÚ%sz(RequirementSet.__str__..)Úkeyú css|]}t|jƒVqdS)N)Ústrr)rrrrrr's)ÚsortedrÚvaluesÚjoin)rrrrrÚ__str__!s zRequirementSet.__str__cCsBt|jjƒdd„d�}d}|j|jjt|ƒdjdd„|Dƒƒd�S) NcSs t|jƒS)N)rr)rrrrr-sz)RequirementSet.__repr__..)rz4<{classname} object; {count} requirement(s): {reqs}>z, css|]}t|jƒVqdS)N)rr)rrrrrr4sz*RequirementSet.__repr__..)Ú classnameÚcountÚreqs)r rr!ÚformatÚ __class__Ú__name__Úlenr")rrÚ format_stringrrrÚ__repr__)s zRequirementSet.__repr__cCs|j s t‚|jj|ƒdS)N)rÚAssertionErrorrÚappend)rÚ install_reqrrrÚadd_unnamed_requirement7s z&RequirementSet.add_unnamed_requirementcCs"|js t‚t|jƒ}||j|<dS)N)rr-rr)rr/Ú project_namerrrÚadd_named_requirement<s  z$RequirementSet.add_named_requirementNc CsÆ|j|ƒs$tjd|j|jƒgdfS|jrh|jjrht|jjƒ}t j ƒ}|j rh|j |ƒ rht dj|jƒƒ‚|j s€|dks€tdƒ‚|jsš|j|ƒ|gdfSy|j|jƒ}Wntk rÂd}YnX|dkoò|oò|j oò|j|jkoò|jj|jjk}|�rt dj|||jƒƒ‚|�s(|j|ƒ|g|fS|j�s:|j �rBg|fS|j�ob|j�o`|jj|jjk }|�rzt dj|jƒƒ‚d|_|j�rŽd|_ttt|jƒt|jƒBƒƒ|_tjd ||jƒ|g|fS) a&Add install_req as a requirement to install. :param parent_req_name: The name of the requirement that needed this added. The name is used because when multiple unnamed requirements resolve to the same name, we could otherwise end up with dependency links that point outside the Requirements set. parent_req must already be added. Note that None implies that this is a user supplied requirement, vs an inferred one. :param extras_requested: an iterable of extras used to evaluate the environment markers. :return: Additional requirements to scan. That is either [] if the requirement is not applicable, or [install_req] if the requirement is applicable and has just been added. z6Ignoring %s: markers '%s' don't match your environmentNz-{} is not a supported wheel on this platform.z+a user supplied req shouldn't have a parentz7Double requirement given: {} (already in {}, name={!r})zhCould not satisfy constraints for '{}': installation from path or url cannot be constrained to a versionFTzSetting %s extras to: %s)Ú match_markersÚloggerÚinforÚmarkersÚlinkÚis_wheelrÚfilenamerÚ get_supportedrÚ supportedrr'Ú user_suppliedr-r0Úget_requirementÚKeyErrorÚ constraintÚextrasrÚ specifierr2ÚpathÚtupler ÚsetÚdebug) rr/Úparent_req_nameÚextras_requestedÚwheelÚtagsÚ existing_reqÚhas_conflicting_requirementÚdoes_not_satisfy_constraintrrrÚadd_requirementCsh             zRequirementSet.add_requirementcCs t|ƒ}||jko|j|j S)N)rrr?)rrr1rrrÚhas_requirement¶s zRequirementSet.has_requirementcCs2t|ƒ}||jkr|j|StdjftƒŽƒ‚dS)Nz!No project with the name {name!r})rrr>r'Úlocals)rrr1rrrr=¿s  zRequirementSet.get_requirementcCs|jt|jjƒƒS)N)rÚlistrr!)rrrrÚall_requirementsÈszRequirementSet.all_requirements)T)NN) r)Ú __module__Ú __qualname__rr#r,r0r2rMrNr=ÚpropertyrQrrrrrs   o  r)Ú __future__rÚloggingÚ collectionsrZpip._vendor.packaging.utilsrÚpip._internal.exceptionsrÚpip._internal.models.wheelrZpip._internal.utilsrÚpip._internal.utils.typingrÚtypingr r r r r Zpip._internal.req.req_installrÚ getLoggerr)r4ÚobjectrrrrrÚs