U .e@sddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZerdd lmZmZmZmZmZdd lmZeeZGd d d eZdS))absolute_importN) OrderedDict)canonicalize_name) pep425tags)InstallationError) indent_log)MYPY_CHECK_RUNNING)Wheel)DictIterableListOptionalTuple)InstallRequirementc@sXeZdZdddZddZddZd d Zd d ZdddZddZ ddZ ddZ d S)RequirementSetFTcCs*t|_||_||_g|_g|_g|_dS)z!Create a RequirementSet. N)r requirementsrequire_hashescheck_supported_wheelsunnamed_requirementsZsuccessfully_downloadedreqs_to_cleanup)selfrrr=/usr/lib/python3.8/site-packages/pip/_internal/req/req_set.py__init__s zRequirementSet.__init__cCs4tdd|jDddd}ddd|DS)Ncss|]}|js|VqdSN)Z comes_from.0reqrrr +sz)RequirementSet.__str__..cSs t|jSrrnamerrrr,z(RequirementSet.__str__..key css|]}t|jVqdSrstrrrrrrr.s)sortedrvaluesjoin)rrrrr__str__(s zRequirementSet.__str__cCsBt|jddd}d}|j|jjt|ddd|DdS) NcSs t|jSrrr!rrrr"4r#z)RequirementSet.__repr__..r$z4<{classname} object; {count} requirement(s): {reqs}>z, css|]}t|jVqdSrr'rrrrr;sz*RequirementSet.__repr__..)Z classnamecountZreqs)r)rr*format __class____name__lenr+)rr format_stringrrr__repr__0szRequirementSet.__repr__cCs|jr t|j|dSr)r AssertionErrorrappend)r install_reqrrradd_unnamed_requirement>s z&RequirementSet.add_unnamed_requirementcCs"|js tt|j}||j|<dSr)r r4rr)rr6 project_namerrradd_named_requirementCs  z$RequirementSet.add_named_requirementNc Cs||s$td|j|jgdfS|jrd|jjrdt|jj}t }|j rd| |sdt d|j|j|dkksztd|js|||gdfSz||j}Wntk rd}YnX|dko|o|j o|j|jko|jj|jjk}|rt d|||jf|s"|||g|fS|js2|js:g|fS|joZ|joX|jj|jjk }|r||j|t d|jd|_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-%s is not a supported wheel on this platform.zTa direct req shouldn't have a parent and also, a non direct req should have a parentz5Double requirement given: %s (already in %s, name=%r)zhCould not satisfy constraints for '%s': installation from path or url cannot be constrained to a versionFzSetting %s extras to: %s)Z match_markersloggerinfor ZmarkerslinkZis_wheelr filenamerZ get_supportedrZ supportedrZ is_directr4r7get_requirementKeyError constraintZextrasrZ specifierr9pathrr5tupler)setdebug) rr6Zparent_req_nameZextras_requestedZwheelZtagsZ existing_reqZhas_conflicting_requirementZdoes_not_satisfy_constraintrrradd_requirementJs          zRequirementSet.add_requirementcCs t|}||jko|j|j Sr)rrr@rr r8rrrhas_requirements  zRequirementSet.has_requirementcCs,t|}||jkr|j|Std|dS)NzNo project with the name %r)rrr?rFrrrr>s  zRequirementSet.get_requirementc Cs4tdt|jD] }|qW5QRXdS)zClean up files, remove builds.zCleaning up...N)r:rDrrZremove_temporary_source)rrrrr cleanup_filess  zRequirementSet.cleanup_files)FT)NN) r0 __module__ __qualname__rr,r3r7r9rErGr>rHrrrrrs   p  r)Z __future__rZlogging collectionsrZpip._vendor.packaging.utilsrZ pip._internalrZpip._internal.exceptionsrZpip._internal.utils.loggingrZpip._internal.utils.typingrZpip._internal.wheelr typingr r r r rZpip._internal.req.req_installrZ getLoggerr0r:objectrrrrrs