a Re@sddlZddlmZddlmZmZmZmZmZddl m Z ddl m Z ddl mZddlmZddlmZeeZGd d d ZdS) N) OrderedDict)DictIterableListOptionalTuple)canonicalize_name)InstallationError)Wheel)InstallRequirement)compatibility_tagsc@seZdZdeddddZedddZedd d Zedd d d Z edd ddZ dee ee e ee eee efdddZeedddZeedddZeeedddZdS)RequirementSetTN)check_supported_wheelsreturncCst|_||_g|_dS)zCreate a RequirementSet.N)r requirementsrunnamed_requirements)selfrr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/req/req_set.py__init__szRequirementSet.__init__)rcCs4tdd|jDddd}ddd|DS)Ncss|]}|js|VqdSN) comes_from.0reqrrr z)RequirementSet.__str__..cSst|jp dSNrnamerrrrrz(RequirementSet.__str__..key css|]}t|jVqdSrstrrrrrrrr)sortedrvaluesjoin)rrrrr__str__s zRequirementSet.__str__cCsBt|jddd}d}|j|jjt|ddd|DdS) NcSst|jp dSrrr!rrrr""rz)RequirementSet.__repr__..r#z4<{classname} object; {count} requirement(s): {reqs}>z, css|]}t|jVqdSrr&rrrrr)rz*RequirementSet.__repr__..) classnamecountreqs)r(rr)format __class____name__lenr*)rr format_stringrrr__repr__szRequirementSet.__repr__) install_reqrcCs|jr J|j|dSr)r rappend)rr5rrradd_unnamed_requirement,s z&RequirementSet.add_unnamed_requirementcCs"|js Jt|j}||j|<dSr)r rr)rr5 project_namerrradd_named_requirement0s  z$RequirementSet.add_named_requirement)r5parent_req_nameextras_requestedrc Cs||s$td|j|jgdfS|jrf|jjrft|jj}t }|j rf| |sft d|j|jr||dus|Jd|js|||gdfSz||j}Wntyd}Yn0|duo|o|j o|j|jko|jo|jo|jj|jjk}|rt d|||j|s.|||g|fS|js>|jsFg|fS|jof|jod|jj|jjk }|r~t 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 r/ user_suppliedr7get_requirementKeyError constraintextrasr specifierr9pathtupler(setdebug) rr5r:r;wheeltags existing_reqhas_conflicting_requirementdoes_not_satisfy_constraintrrradd_requirement6s          zRequirementSet.add_requirement)r rcCs t|}||jvo|j|j Sr)rrrHrr r8rrrhas_requirements  zRequirementSet.has_requirementcCs.t|}||jvr|j|Std|dS)NzNo project with the name )rrrGrUrrrrFs  zRequirementSet.get_requirementcCs|jt|jSr)rlistrr))rrrrall_requirementsszRequirementSet.all_requirements)T)NN)r1 __module__ __qualname__boolrr'r+r4r r7r9rrrrrTrVrFpropertyrXrrrrr s"    ur )logging collectionsrtypingrrrrrpip._vendor.packaging.utilsrpip._internal.exceptionsr pip._internal.models.wheelr Zpip._internal.req.req_installr Zpip._internal.utilsr getLoggerr1r=r rrrrs