o 7]h@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)selfrr;/usr/lib/python3/dist-packages/pip/_internal/req/req_set.py__init__s zRequirementSet.__init__cCs4tdd|jDddd}ddd|DS)Ncss|]}|js|VqdSN) 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) NcSrrr r"rrrr#"r$z)RequirementSet.__repr__..r%z4<{classname} object; {count} requirement(s): {reqs}>z, csr(rr)rrrrr)rz*RequirementSet.__repr__..) classnamecountreqs)r+rr,format __class____name__lenr-)rr format_stringrrr__repr__szRequirementSet.__repr__ install_reqcCs|jrJ|j|dSr)r!rappend)rr8rrradd_unnamed_requirement,s z&RequirementSet.add_unnamed_requirementcCs"|jsJt|j}||j|<dSr)r!rr)rr8 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) match_markersloggerinfor!markerslinkis_wheelr filenamer get_supportedr supportedr r2 user_suppliedr:get_requirementKeyError constraintextrasr specifierr<pathtupler+setdebug) rr8r=r>wheeltags existing_reqhas_conflicting_requirementdoes_not_satisfy_constraintrrradd_requirement6s            zRequirementSet.add_requirementr!cCs t|}||jvo|j|j Sr)rrrKrr!r;rrrhas_requirements  zRequirementSet.has_requirementcCs*t|}||jvr|j|Std|)NzNo project with the name )rrrJrXrrrrIs  zRequirementSet.get_requirementcCs|jt|jSr)rlistrr,)rrrrall_requirementsszRequirementSet.all_requirements)T)NN)r4 __module__ __qualname__boolrr*r.r7r r:r<rrrrrWrYrIpropertyr[rrrrr s*    ur )logging collectionsrtypingrrrrrpip._vendor.packaging.utilsrpip._internal.exceptionsr pip._internal.models.wheelr pip._internal.req.req_installr pip._internal.utilsr getLoggerr4r@r rrrrs