U ��.e��@s�ddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZer�dd lmZmZmZmZmZdd lmZe�e�ZGd d �d e�ZdS)�)�absolute_importN)� OrderedDict)�canonicalize_name)� pep425tags)�InstallationError)� indent_log)�MYPY_CHECK_RUNNING)�Wheel)�Dict�Iterable�List�Optional�Tuple)�InstallRequirementc@sXeZdZddd�Zdd�Zdd�Zd d �Zd d �Zddd�Zdd�Z dd�Z dd�Z d S)�RequirementSetFTcCs*t�|_||_||_g|_g|_g|_dS)z!Create a RequirementSet. N)r� requirements�require_hashes�check_supported_wheels�unnamed_requirementsZsuccessfully_downloaded�reqs_to_cleanup)�selfrr�r�=/usr/lib/python3.8/site-packages/pip/_internal/req/req_set.py�__init__s zRequirementSet.__init__cCs4tdd�|j��D�dd�d�}d�dd�|D��S)Ncss|]}|js|VqdS�N)Z comes_from��.0�reqrrr� +sz)RequirementSet.__str__..cSs t|j�Sr�r�name�rrrr�,�z(RequirementSet.__str__..��key� css|]}t|j�VqdSr��strrrrrrr.s)�sortedr�values�join)rrrrr�__str__(s �zRequirementSet.__str__cCsBt|j��dd�d�}d}|j|jjt|�d�dd�|D��d�S) NcSs t|j�Srrr!rrrr"4r#z)RequirementSet.__repr__..r$z4<{classname} object; {count} requirement(s): {reqs}>z, css|]}t|j�VqdSrr'rrrrr;sz*RequirementSet.__repr__..)Z classname�countZreqs)r)rr*�format� __class__�__name__�lenr+)rr� format_stringrrr�__repr__0s��zRequirementSet.__repr__cCs|jr t�|j�|�dSr)r �AssertionErrorr�append)r� install_reqrrr�add_unnamed_requirement>s z&RequirementSet.add_unnamed_requirementcCs"|js t�t|j�}||j|<dSr)r r4rr)rr6� project_namerrr�add_named_requirementCs  z$RequirementSet.add_named_requirementNc Cs�|�|�s$t�d|j|j�gdfS|jrd|jjrdt|jj�}t � �}|j rd|� |�sdt d|j��|j|dkksztd��|js�|�|�|gdfSz|�|j�}Wntk r�d}YnX|dko�|o�|j o�|j|jko�|jj|jjk}|�rt d|||jf��|�s"|�|�|g|fS|j�s2|j�s:g|fS|j�oZ|j�oX|jj|jjk }|�r||j�|�t d|j��d|_ttt|j�t|j�B��|_t�d||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_markers�logger�infor Zmarkers�linkZis_wheelr �filenamerZ get_supportedrZ supportedrZ is_directr4r7�get_requirement�KeyError� constraintZextrasrZ specifierr9�pathrr5�tupler)�set�debug) rr6Zparent_req_nameZextras_requestedZwheelZtagsZ existing_reqZhas_conflicting_requirementZdoes_not_satisfy_constraintrrr�add_requirementJs� � ���   �� �� ��  �� ����zRequirementSet.add_requirementcCs t|�}||jko|j|j Sr)rrr@�rr r8rrr�has_requirement�s  �zRequirementSet.has_requirementcCs,t|�}||jkr|j|Std|��dS)NzNo project with the name %r)rrr?rFrrrr>�s  zRequirementSet.get_requirementc Cs4t�d�t��|jD] }|��qW5QRXdS)zClean up files, remove builds.zCleaning up...N)r:rDrrZremove_temporary_source)rrrrr� cleanup_files�s  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:�objectrrrrr�s