3 Bu_@sddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZerdd lmZmZmZmZmZdd lmZejeZGd d d eZdS) )absolute_importN) OrderedDict)canonicalize_name)InstallationError)Wheel)compatibility_tags)MYPY_CHECK_RUNNING)DictIterableListOptionalTuple)InstallRequirementc@s\eZdZdddZddZddZdd Zd d Zdd dZddZ ddZ e ddZ d S)RequirementSetTcCst|_||_g|_dS)z!Create a RequirementSet. N)r requirementscheck_supported_wheelsunnamed_requirements)selfrr/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-1.el7.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_set.py__init__szRequirementSet.__init__cCs4tdd|jjDddd}djdd|DS)Ncss|]}|js|VqdS)N) comes_from).0reqrrr $sz)RequirementSet.__str__..cSs t|jS)N)rname)rrrr%sz(RequirementSet.__str__..)key css|]}t|jVqdS)N)strr)rrrrrr's)sortedrvaluesjoin)rrrrr__str__!s zRequirementSet.__str__cCsBt|jjddd}d}|j|jjt|djdd|DdS) NcSs t|jS)N)rr)rrrrr-sz)RequirementSet.__repr__..)rz4<{classname} object; {count} requirement(s): {reqs}>z, css|]}t|jVqdS)N)rr)rrrrrr4sz*RequirementSet.__repr__..) classnamecountreqs)r rr!format __class____name__lenr")rr format_stringrrr__repr__)s zRequirementSet.__repr__cCs|j s t|jj|dS)N)rAssertionErrorrappend)r install_reqrrradd_unnamed_requirement7s z&RequirementSet.add_unnamed_requirementcCs"|js tt|j}||j|<dS)N)rr-rr)rr/ project_namerrradd_named_requirement<s  z$RequirementSet.add_named_requirementNc Cs|j|s$tjd|j|jgdfS|jrh|jjrht|jj}t j }|j rh|j | rht dj|j|j s|dkstd|js|j||gdfSy|j|j}Wntk rd}YnX|dko|o|j o|j|jko|jj|jjk}|rt dj|||j|s(|j||g|fS|js:|j rBg|fS|job|jo`|jj|jjk }|rzt dj|jd|_|jrd|_ttt|jt|jB|_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_markersloggerinformarkerslinkis_wheelrfilenamer get_supportedr supportedrr' user_suppliedr-r0get_requirementKeyError constraintextrasr specifierr2pathtupler setdebug) rr/parent_req_nameextras_requestedwheeltags existing_reqhas_conflicting_requirementdoes_not_satisfy_constraintrrradd_requirementCsh             zRequirementSet.add_requirementcCs t|}||jko|j|j S)N)rrr?)rrr1rrrhas_requirements zRequirementSet.has_requirementcCs2t|}||jkr|j|StdjftdS)Nz!No project with the name {name!r})rrr>r'locals)rrr1rrrr=s  zRequirementSet.get_requirementcCs|jt|jjS)N)rlistrr!)rrrrall_requirementsszRequirementSet.all_requirements)T)NN) r) __module__ __qualname__rr#r,r0r2rMrNr=propertyrQrrrrrs   o  r) __future__rlogging collectionsrZpip._vendor.packaging.utilsrpip._internal.exceptionsrpip._internal.models.wheelrZpip._internal.utilsrpip._internal.utils.typingrtypingr r r r r Zpip._internal.req.req_installr getLoggerr)r4objectrrrrrs