o Ec@sddlZddlmZddlmZmZmZmZmZddl m Z ddl m Z ddl mZddlmZddlmZeeZGd d d ZdS) N) OrderedDict)DictIterableListOptionalTuple)canonicalize_name)InstallationError)Wheel)InstallRequirement)compatibility_tagsc @seZdZddeddfddZdefddZdefd d Zd eddfd d Z d eddfddZ  dd ede ede e ede eee effddZdedefddZdedefddZedeefddZdS)RequirementSetTcheck_supported_wheelsreturnNcCst|_||_g|_dS)zCreate a RequirementSet.N)r requirementsrunnamed_requirements)selfrrL/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/req/req_set.py__init__s zRequirementSet.__init__cCs4tdd|jDddd}ddd|DS)Ncss|]}|js|VqdSN)Z comes_from.0reqrrr z)RequirementSet.__str__..cSt|jpdSNrnamerrrrz(RequirementSet.__str__..key cs|]}t|jVqdSrstrrrrrrrr)sortedrvaluesjoin)rrrrr__str__s zRequirementSet.__str__cCsBt|jddd}d}|j|jjt|ddd|DdS) NcSrrrr!rrrr""r#z)RequirementSet.__repr__..r$z4<{classname} object; {count} requirement(s): {reqs}>z, csr'rr(rrrrr)rz*RequirementSet.__repr__..)Z classnamecountZreqs)r*rr+format __class____name__lenr,)rr format_stringrrr__repr__szRequirementSet.__repr__ install_reqcCs|jrJ|j|dSr)r rappend)rr5rrradd_unnamed_requirement,s z&RequirementSet.add_unnamed_requirementcCs"|jsJt|j}||j|<dSr)r rr)rr5 project_namerrradd_named_requirement0s  z$RequirementSet.add_named_requirementparent_req_nameextras_requestedc Cs||std|j|jgdfS|jr3|jjr3t|jj}t }|j r3| |s3t d|j|jr>|dus>Jd|jsK|||gdfSz||j}Wn ty^d}Ynw|duo||o||j o||j|jko||jo||jo||jj|jjk}|rt d|||j|s|||g|fS|js|jsg|fS|jo|jo|jj|jjk }|rt d|jd|_|jrd|_ttt|jt|jB|_td ||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)Z match_markersloggerinfor ZmarkerslinkZis_wheelr filenamer Z get_supportedrZ supportedr r/Z user_suppliedr7get_requirementKeyError constraintZextrasrZ specifierr9pathtupler*setdebug) rr5r:r;ZwheeltagsZ existing_reqZhas_conflicting_requirementZdoes_not_satisfy_constraintrrradd_requirement6s           zRequirementSet.add_requirementr cCs t|}||jvo|j|j Sr)rrrBrr r8rrrhas_requirements  zRequirementSet.has_requirementcCs*t|}||jvr|j|Std|)NzNo project with the name )rrrArIrrrr@s  zRequirementSet.get_requirementcCs|jt|jSr)rlistrr+)rrrrall_requirementsszRequirementSet.all_requirements)T)NN)r1 __module__ __qualname__boolrr)r-r4r r7r9rrrrrHrJr@propertyrLrrrrr s*    ur )Zlogging collectionsrtypingrrrrrZpip._vendor.packaging.utilsrZpip._internal.exceptionsr Zpip._internal.models.wheelr Zpip._internal.req.req_installr Zpip._internal.utilsr Z getLoggerr1r<r rrrrs