o
    6‘ði£�  ã                   @  s<  d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm	Z	m
Z
 d dlmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZmZ d dlmZmZ d d	lmZ d d
lmZm Z  d dl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z( d dl)m*Z* d dl+m,Z,m-Z- d dl.m/Z/ d dl0m1Z1 d dl2m3Z3 d dl4m5Z5 d dl6m7Z7m8Z8 d dl9m:Z:m;Z; d dl<m=Z= d dl>m?Z? d dl@mAZA d dlBmCZC d dlDmEZE ddlFmGZGmHZHmIZI ddlJmKZKmLZLmMZMmNZNmOZOmPZPmQZQ ddlRmSZSmTZT ddlUmVZVmWZWmXZXmYZYmZZZ erþG dd„ deƒZ[e \e]¡Z^ed ƒZ_e`e1e_f ZaG d!d"„ d"eƒZbG d#d$„ d$ƒZcdS )%é    )ÚannotationsN)ÚIterableÚIteratorÚMappingÚSequence)ÚTYPE_CHECKINGÚCallableÚ
NamedTupleÚProtocolÚTypeVarÚcast)ÚInvalidRequirement)ÚSpecifierSet)ÚNormalizedNameÚcanonicalize_name)ÚInvalidVersionÚVersion)ÚResolutionImpossible)Ú
CacheEntryÚ
WheelCache)ÚDistributionNotFoundÚInstallationErrorÚInvalidInstalledPackageÚMetadataInconsistentÚMetadataInvalidÚUnsupportedPythonVersionÚUnsupportedWheel)ÚPackageFinder)ÚBaseDistributionÚget_default_environment)ÚInstallationCandidate)ÚLink)ÚWheel)ÚRequirementPreparer)Úinstall_req_drop_extrasÚinstall_req_from_link_and_ireq)ÚInstallRequirementÚcheck_invalid_constraint_type)ÚInstallRequirementProvider)Úget_supported)ÚHashes)Úget_requirement)Úrunning_under_virtualenvé   )Ú	CandidateÚ
ConstraintÚRequirement)ÚAlreadyInstalledCandidateÚBaseCandidateÚEditableCandidateÚExtrasCandidateÚLinkCandidateÚRequiresPythonCandidateÚas_base_candidate)ÚFoundCandidatesÚIndexCandidateInfo)ÚExplicitRequirementÚRequiresPythonRequirementÚSpecifierRequirementÚ!SpecifierWithoutExtrasRequirementÚUnsatisfiableRequirementc                   @  s   e Zd ZU ded< ded< dS )ÚConflictCauser;   Úrequirementr.   ÚparentN©Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© rG   rG   új/root/parts/websockify/install/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.pyr?   J   s   
 r?   ÚCc                   @  s&   e Zd ZU ded< ded< ded< dS )ÚCollectedRootRequirementszlist[Requirement]Úrequirementsúdict[str, Constraint]Úconstraintszdict[str, int]Úuser_requestedNrB   rG   rG   rG   rH   rJ   U   s   
 rJ   c                   @  s  e Zd Z	d‹dŒdd„Zed�dd„ƒZdŽdd„Zddœd�d#d$„Zd�d*d+„Zd‘d1d2„Z	d’d4d5„Z
d“d<d=„Z	d‹d”dFdG„Zd•dKdL„Zd–dPdQ„Zd—dXdY„Zd˜d^d_„Zd™dcdd„Zdšdgdh„Z	id›dœdjdk„Zd�dmdn„Zdždqdr„ZdŸdtdu„Zd dydz„Zd¡dd€„Zd¢d‚dƒ„Zd£d‰dŠ„ZdS )¤ÚFactoryNÚfinderr   Úpreparerr#   Úmake_install_reqr(   Úwheel_cacheúWheelCache | NoneÚuse_user_siteÚboolÚforce_reinstallÚignore_installedÚignore_requires_pythonÚpy_version_infoútuple[int, ...] | NoneÚreturnÚNonec
                 C  sŠ   || _ || _|| _t|	ƒ| _|| _|| _|| _|| _i | _	i | _
i | _i | _i | _tƒ | _|s@tƒ }
dd„ |
jdd�D ƒ| _d S i | _d S )Nc                 S  s   i | ]}|j |“qS rG   )Úcanonical_name)Ú.0ÚdistrG   rG   rH   Ú
<dictcomp>|   s    ÿÿz$Factory.__init__.<locals>.<dictcomp>F)Ú
local_only)Ú_finderrQ   Ú_wheel_cacher6   Ú_python_candidateÚ_make_install_req_from_specÚ_use_user_siteÚ_force_reinstallÚ_ignore_requires_pythonÚ_build_failuresÚ_link_candidate_cacheÚ_editable_candidate_cacheÚ_installed_candidate_cacheÚ_extras_candidate_cacher)   Ú_supported_tags_cacher   Úiter_installed_distributionsÚ_installed_dists)ÚselfrP   rQ   rR   rS   rU   rW   rX   rY   rZ   ÚenvrG   rG   rH   Ú__init__\   s*   
þ
þ
zFactory.__init__c                 C  s   | j S ©N)rh   ©rr   rG   rG   rH   rW   ƒ   s   zFactory.force_reinstallÚlinkr!   c                 C  s>   |j sd S t|jƒ}| | jj ¡ ¡rd S |j› d�}t|ƒ‚)Nz+ is not a supported wheel on this platform.)Úis_wheelr"   ÚfilenameÚ	supportedrc   Útarget_pythonÚget_unsorted_tagsr   )rr   rw   ÚwheelÚmsgrG   rG   rH   Ú"_fail_if_link_is_unsupported_wheel‡   s   
z*Factory._fail_if_link_is_unsupported_wheel©Ú
comes_fromÚbaser2   Úextrasúfrozenset[str]r�   úInstallRequirement | Noner4   c                C  sX   t |ƒtdd„ |D ƒƒf}z| j| }W |S  ty+   t|||d�}|| j|< Y |S w )Nc                 s  s   � | ]}t |ƒV  qd S ru   )r   )r_   ÚerG   rG   rH   Ú	<genexpr>—   ó   € z1Factory._make_extras_candidate.<locals>.<genexpr>r€   )ÚidÚ	frozensetrn   ÚKeyErrorr4   )rr   r‚   rƒ   r�   Ú	cache_keyÚ	candidaterG   rG   rH   Ú_make_extras_candidate�   s   ýýzFactory._make_extras_candidater`   r   Útemplater&   r.   c                 C  sV   z| j |j }W n ty   t||| d�}|| j |j< Y nw |s#|S | j|||d�S )N)Úfactoryr€   )rm   r^   r‹   r1   rŽ   )rr   r`   rƒ   r�   r‚   rG   rG   rH   Ú_make_candidate_from_distŸ   s   þz!Factory._make_candidate_from_distÚnameúNormalizedName | NoneÚversionúVersion | NoneúCandidate | Nonec                 C  s0   |   ||||¡}|r|d u r|S | j|||d�S )Nr€   )Ú_make_base_candidate_from_linkrŽ   )rr   rw   rƒ   r�   r’   r”   r‚   rG   rG   rH   Ú_make_candidate_from_link®   s   ÿz!Factory._make_candidate_from_linkúBaseCandidate | Nonec              
   C  s  || j v rd S |jrH|| jvrCzt||| ||d�| j|< W n% ttfyB } ztjd||ddid� || j |< W Y d }~d S d }~ww | j| S || jvrzt	||| ||d�| j|< W n# ty~ } ztjd||ddid� || j |< W Y d }~d S d }~ww | j| S )N)r�   r’   r”   z3Discarding [blue underline]%s[/]: [yellow]%s[reset]ÚmarkupT)Úextra)
rj   Úeditablerl   r3   r   r   ÚloggerÚinfork   r5   )rr   rw   r�   r’   r”   r†   rG   rG   rH   r—   ½   sZ   


ûü
€ø


ûü
€ø
	z&Factory._make_base_candidate_from_linkÚireqsúSequence[InstallRequirement]ÚstrÚ	specifierr   úInstallationCandidate | Nonec              
   C  s¨   dd„ |D ƒ}|sd S t |ƒdkr#td|›dd dd„ |D ƒ¡› �ƒ‚|d	 }|js,J ‚|js1J ‚| |j¡sJtd
|j›d|›d|j›d|›d�	ƒ‚t|t|jƒ|jƒS )Nc                 S  s   g | ]}|j r|‘qS rG   )Úlocked_link)r_   ÚireqrG   rG   rH   Ú
<listcomp>ù   s    z>Factory._get_locked_installation_candidate.<locals>.<listcomp>r-   z$Multiple locks provided for package ú in ú, c                 s  s   � | ]}t |jƒV  qd S ru   )r¡   r�   )r_   ÚlirrG   rG   rH   r‡   ÿ   ó   € z=Factory._get_locked_installation_candidate.<locals>.<genexpr>r   zLocked version z for package z from zA is not compatible with other requirements for the same package (ú))	Úlenr   Újoinr¤   Úlocked_versionÚcontainsr�   r    r¡   )rr   rŸ   r’   r¢   Úlocked_ireqsÚlocked_ireqrG   rG   rH   Ú"_get_locked_installation_candidateö   s2   ÿÿ


ÿÿýÿÿz*Factory._get_locked_installation_candidateÚhashesr*   Úprefers_installedÚincompatible_idsúset[int]Úconstraint_hash_optionsúdict[str, list[str]] | NoneúIterable[Candidate]c           
        sò   ˆsdS ˆd ‰ˆj sJ dƒ‚|r)ˆjs)t| ¡ ƒr)t ˆ¡‰dd„ | ¡ D ƒˆ_ˆj s.J ‚tˆj jƒ‰tƒ ‰ ˆD ]}|j sBJ dƒ‚ˆ|j j	M ‰ˆ|j
dd�M ‰ˆ t|jƒO ‰ q9d‡ ‡‡‡‡‡fd
d„}d‡ ‡‡‡‡‡‡fdd„}	t|	|ƒ |ˆƒS )NrG   r   z)Candidates found on index must be PEP 508c                 S  s   i | ]	\}}|t |ƒ“qS rG   )Úlist)r_   ÚkÚvrG   rG   rH   ra   '  s    ÿz2Factory._iter_found_candidates.<locals>.<dictcomp>F)Útrust_internetr\   r–   c               
     s’   ˆj rdS zˆjˆ } W n
 ty   Y dS w zˆj| jdd�s#W dS W n ty6 } zt| |d�‚d}~ww ˆj| ˆ ˆd�}t|ƒˆv rGdS |S )z6Get the candidate for the currently-installed version.NT)Úprereleases)r`   Úinvalid_exc)r`   rƒ   r�   )	rh   rq   r‹   r¯   r”   r   r   r‘   r‰   )Úinstalled_distr†   r�   )rƒ   rµ   r’   rr   r¢   r�   rG   rH   Ú_get_installed_candidate4  s.   ÿÿ€ÿýz@Factory._iter_found_candidates.<locals>._get_installed_candidateúIterator[IndexCandidateInfo]c               	   3  s¤   � ˆ  ˆˆˆ¡ } r| g}nˆjjˆˆˆd�}|j}tdd„ |D ƒƒ}ddd	„}|ˆƒ}t|ƒD ]}|r6|s;|jjr;q0tj	ˆj
|jˆ ˆˆ|jd
�}|j|fV  q0d S )N)Úproject_namer¢   r³   c                 s  s   � | ]}|j jV  qd S ru   )rw   Ú	is_yanked)r_   ÚicanrG   rG   rH   r‡   d  rˆ   zUFactory._iter_found_candidates.<locals>.iter_index_candidate_infos.<locals>.<genexpr>r¢   r   r\   rV   c                 S  s<   | D ]}|j dkr dS |j dkrq|j d¡rq dS dS )Nz===Tú==z.*F)Úoperatorr”   Úendswith)r¢   ÚsprG   rG   rH   Ú	is_pinnedf  s   

zUFactory._iter_found_candidates.<locals>.iter_index_candidate_infos.<locals>.is_pinned)rw   rƒ   r�   r’   r”   )r¢   r   r\   rV   )r²   rc   Úfind_best_candidateÚapplicable_candidatesÚallÚreversedrw   rÄ   Ú	functoolsÚpartialr˜   r”   )Úlocked_icanÚicansÚresultÚ
all_yankedrÊ   ÚpinnedrÅ   Úfunc)rƒ   r³   rŸ   r’   rr   r¢   r�   rG   rH   Úiter_index_candidate_infosQ  s6   €ÿý
úõzBFactory._iter_found_candidates.<locals>.iter_index_candidate_infos)r\   r–   )r\   rÂ   )ÚreqÚhash_optionsÚanyÚvaluesÚcopyÚitemsr   r’   rŠ   r¢   r³   rƒ   r8   )
rr   rŸ   r¢   r³   r´   rµ   r·   r¥   rÁ   r×   rG   )rƒ   r³   rµ   rŸ   r’   rr   r¢   r�   rH   Ú_iter_found_candidates  s<   	ÿþ
ý
ÿ
0üzFactory._iter_found_candidatesÚbase_requirementsúIterable[Requirement]úIterator[Candidate]c                 c  sL   � |D ] }|  ¡ \}}|du rqt|ƒ}|dusJ dƒ‚|  ||¡V  qdS )a8  Produce explicit candidates from the base given an extra-ed package.

        :param base_requirements: Requirements known to the resolver. The
            requirements are guaranteed to not have extras.
        :param extras: The extras to inject into the explicit requirements'
            candidates.
        Nzno extras here)Úget_candidate_lookupr7   rŽ   )rr   rß   rƒ   rØ   Úlookup_candÚ_Ú	base_candrG   rG   rH   Ú#_iter_explicit_candidates_from_baseˆ  s   €øz+Factory._iter_explicit_candidates_from_baseÚ
identifierÚ
constraintr/   c           	      c  s¶   � t ƒ }|}t t¡� t|ƒ}|j|krt|jƒ}t |jƒ}W d  ƒ n1 s)w   Y  |jD ]'}|  	|¡ | j
|t||ƒt|ƒdd�}|du rKq1|rU|  ||¡V  q1|V  q1dS )zÖProduce explicit candidates from constraints.

        This creates "fake" InstallRequirement objects that are basically clones
        of what "should" be the template, but with original_link set to link.
        N©r�   r’   r”   )rŠ   Ú
contextlibÚsuppressr   r+   r’   r   rƒ   Úlinksr   r—   r%   rŽ   )	rr   rç   rè   r�   rƒ   Úbase_identifierÚparsed_requirementrw   Úbase_candidaterG   rG   rH   Ú!_iter_candidates_from_constraintsž  s0   €


€ü

üóz)Factory._iter_candidates_from_constraintsrK   ú#Mapping[str, Iterable[Requirement]]Úincompatibilitiesú!Mapping[str, Iterator[Candidate]]Úis_satisfied_byú(Callable[[Requirement, Candidate], bool]c              	     s^  t ƒ }g }ˆˆ D ]}	|	 ¡ \}
}|
d ur| |
¡ |d ur#| |¡ q	t t¡�; tˆƒ}|jˆkr]| 	|  
ˆ |jd¡t|jƒ¡¡ ˆ |jg ¡D ]}	|	 ¡ \}}|d ur\| |¡ qKW d   ƒ n1 sgw   Y  |rˆz| 	| jˆˆ |d d�¡ W n
 ty‡   Y dS w dd„ | ˆd¡D ƒ‰|s¢|  |ˆ jˆ j|ˆˆ j¡S ‡ ‡‡‡‡fdd„|D ƒS )NrG   r   )r�   c                 S  s   h | ]}t |ƒ’qS rG   )r‰   ©r_   ÚcrG   rG   rH   Ú	<setcomp>÷  ó    z*Factory.find_candidates.<locals>.<setcomp>c                 3  sF   � | ]‰ t ˆ ƒˆvrˆ ˆ ¡rt‡ ‡fd d„ˆˆ D ƒƒrˆ V  qdS )c                 3  s   � | ]}ˆ|ˆ ƒV  qd S ru   rG   )r_   rØ   )r÷   rô   rG   rH   r‡   
  rª   z4Factory.find_candidates.<locals>.<genexpr>.<genexpr>N)r‰   rô   rÍ   )r_   ©rè   rç   Úincompat_idsrô   rK   )r÷   rH   r‡     s   € ÿþþýz*Factory.find_candidates.<locals>.<genexpr>)Úsetrâ   ÚaddÚappendrê   rë   r   r+   r’   Úupdateræ   ÚgetrŠ   rƒ   rð   r   rÞ   r¢   r³   rÙ   )rr   rç   rK   rò   rè   r´   rô   Úexplicit_candidatesrŸ   rØ   Úcandr¥   rî   rä   rG   rú   rH   Úfind_candidatesÀ  sb   


€
þÿ
€ôýÿýú	þzFactory.find_candidatesr¥   Úrequested_extrasúIterable[str]úIterator[Requirement]c                 c  sø   � |  |¡st d|j|j¡ dS |js,|jr%|jdur%|jjr%t	|ƒV  t
|ƒV  dS |  |j¡ | j|j|jr=t|ƒn||jrFt|jƒnddd�}|du rb|jsX| j|j ‚tt|jƒƒV  dS |  |¡V  |jrz|  |  |t|jƒ¡¡V  dS dS )aW  
        Returns requirement objects associated with the given InstallRequirement. In
        most cases this will be a single object but the following special cases exist:
            - the InstallRequirement has markers that do not apply -> result is empty
            - the InstallRequirement has both a constraint (or link) and extras
                -> result is split in two requirement objects: one with the constraint
                (or link) and one with the extra. This allows centralized constraint
                handling for the base, resulting in fewer candidate rejections.
        z6Ignoring %s: markers '%s' don't match your environmentNré   )Úmatch_markersr�   rž   r’   Úmarkersrw   rƒ   rØ   r¢   r=   r<   r   r—   r$   r   rj   r>   Úmake_requirement_from_candidaterŽ   rŠ   )rr   r¥   r  r  rG   rG   rH   Ú#_make_requirements_from_install_req  s8   €
ý
ü
ÿþz+Factory._make_requirements_from_install_reqÚ
root_ireqsúlist[InstallRequirement]rJ   c           	      C  sê   t g i i ƒ}t|ƒD ]_\}}|jrDt|ƒ}|rt|ƒ‚| ¡ s q
|js'J dƒ‚t|jƒ}||jv r;|j|  |M  < q
t	 
|¡|j|< q
t| j|dd�ƒ}|sPq
|d }|jrc|j|jvrc||j|j< |j |¡ q
|jjdd„ d� |S )NzConstraint must be namedrG   )r  r   c                 S  s   | j | jkS ru   )r’   rÃ   )ÚrrG   rG   rH   Ú<lambda>i  s    z3Factory.collect_root_requirements.<locals>.<lambda>)Úkey)rJ   Ú	enumeraterè   r'   r   r  r’   r   rM   r/   Ú	from_ireqrº   r
  Úuser_suppliedrN   rK   ÚextendÚsort)	rr   r  Ú	collectedÚir¥   Úproblemr’   Úreqsr�   rG   rG   rH   Úcollect_root_requirementsB  s6   

þÿ	z!Factory.collect_root_requirementsr�   r:   c                 C  s   t |ƒS ru   )r:   )rr   r�   rG   rG   rH   r	  l  s   z'Factory.make_requirement_from_candidaterG   c                 C  s   |   ||¡}|  ||¡S )a(  
        Returns requirement objects associated with the given specifier. In most cases
        this will be a single object but the following special cases exist:
            - the specifier has markers that do not apply -> result is empty
            - the specifier has both a constraint and extras -> result is split
                in two requirement objects: one with the constraint and one with the
                extra. This allows centralized constraint handling for the base,
                resulting in fewer candidate rejections.
        )rf   r
  )rr   r¢   r�   r  r¥   rG   rG   rH   Úmake_requirements_from_specq  s   z#Factory.make_requirements_from_specúRequirement | Nonec                 C  s"   | j rd S t|ƒsd S t|| jƒS ru   )ri   r¡   r;   re   )rr   r¢   rG   rG   rH   Ú make_requires_python_requirementƒ  s
   z(Factory.make_requires_python_requirementú
str | NoneúCacheEntry | Nonec                 C  s"   | j du rdS | j j||| jd�S )a—  Look up the link in the wheel cache.

        If ``preparer.require_hashes`` is True, don't use the wheel cache,
        because cached wheels, always built locally, have different hashes
        than the files downloaded from the index server and thus throw false
        hash mismatches. Furthermore, cached wheels at present have
        nondeterministic contents due to file modification times.
        N)rw   Úpackage_nameÚsupported_tags)rd   Úget_cache_entryro   )rr   rw   r’   rG   rG   rH   Úget_wheel_cache_entryŽ  s   
	ýzFactory.get_wheel_cache_entryúBaseDistribution | Nonec                 C  sZ   | j  |j¡}|d u rd S | js|S |jr|S tƒ r+|jr+d|j› d|j› �}t	|ƒ‚d S )NzNWill not install to the user site because it will lack sys.path precedence to r§   )
rq   r   rÃ   rg   Úin_usersiter,   Úin_site_packagesÚraw_nameÚlocationr   )rr   r�   r`   ÚmessagerG   rG   rH   Úget_dist_to_uninstallŸ  s    ÿÿÿzFactory.get_dist_to_uninstallÚcausesúSequence[ConflictCause]r   c                 C  s    |sJ dƒ‚| j j}t|ƒdkr+t|d jjƒ}d|d jj›d|› d|›�}t|ƒS d|› d�}|D ]}|j 	¡ }t|jjƒ}|d	|›d
|› d�7 }q3t|ƒS )Nz,Requires-Python error reported with no causer-   r   zPackage z requires a different Python: z not in z%Packages require a different Python. z not in:Ú
z (required by r«   )
re   r”   r¬   r¡   r@   r¢   rA   r’   r   Úformat_for_error)rr   r*  r”   r¢   r(  ÚcauseÚpackagerG   rG   rH   Ú_report_requires_python_error»  s"   ÿÿÿ
z%Factory._report_requires_python_errorrØ   r0   rA   r   c                 C  sH  |d u r	t |ƒ}n	|› d|j› d�}| j |j¡}| j ¡ }tƒ }tƒ }|D ]}|jr/|jjnd}	|	r:| 	|j
¡ q&| 	|j
¡ q&dd„ t|ƒD ƒ}
dd„ t|ƒD ƒ}|r`t dd |¡p^d	¡ |rmt d
d |¡pkd	¡ d}| jjd ur…| jj t|jƒ¡}|du r…d}t d||d |
¡p�d	¡ t |ƒdkr�t d¡ td|› �ƒS )Nz (from r«   Fc                 S  ó   g | ]}t |ƒ‘qS rG   ©r¡   ©r_   r¼   rG   rG   rH   r¦   å  rù   z?Factory._report_single_requirement_conflict.<locals>.<listcomp>c                 S  r1  rG   r2  r3  rG   rG   rH   r¦   æ  rù   z)Ignored the following yanked versions: %sr¨   ÚnonezJIgnored the following versions that require a different python version: %sz; r”   zfinal versionzICould not find a %s that satisfies the requirement %s (from versions: %s)zrequirements.txtz¶HINT: You are attempting to install a package literally named "requirements.txt" (which cannot exist). Consider using the '-r' flag to install the packages listed in requirements.txtz#No matching distribution found for )r¡   r’   rc   Úfind_all_candidatesrÃ   Úrequires_python_skipped_reasonsrü   rw   rÄ   rý   r”   Úsortedr�   Úcriticalr­   Úrelease_controlÚallows_prereleasesr   rž   r   )rr   rØ   rA   Úreq_dispÚcandsÚskipped_by_requires_pythonÚversions_setÚyanked_versions_setr÷   rÄ   ÚversionsÚyanked_versionsÚversion_typeÚ
allows_prerG   rG   rH   Ú#_report_single_requirement_conflictÑ  sT   

þýÿüÿz+Factory._report_single_requirement_conflictrÃ   c              	   C  s&   t | j||g ii t ¡ ddd„ d�ƒS )zS
        Check if there are any candidates available for the project name.
        Tc                 S  s   dS )NTrG   )r  r÷   rG   rG   rH   r    s    z-Factory._has_any_candidates.<locals>.<lambda>)rK   rò   rè   r´   rô   )rÚ   r  r/   Úempty)rr   rÃ   rG   rG   rH   Ú_has_any_candidates  s   úÿzFactory._has_any_candidatesr†   ú,ResolutionImpossible[Requirement, Candidate]rM   rL   r   c                   s   |j sJ dƒ‚‡ fdd„|j D ƒ}|rˆ  td|ƒ¡S t|j ƒdkr6tt|j ƒƒ\}}|j|vr6ˆ  ||¡S d#d
d„}d$dd„}tƒ }|j D ]\}}|d u rS| 	¡ }	n||ƒ}	| 
|	¡ qF|rf|t|ƒƒ}
nd}
d|
› d�}t |¡ d}tƒ }|j D ],\}}|j|v rŠ| 
|j¡ |d }|r�||j› d|j› d� }n|d }|| 	¡  }q{|D ]}|› ||  	¡ › �}|d|› �7 }qªtƒ }|j D ]
\}}| 
|j¡ qÄ‡ fdd„|D ƒ}|rë|d d d d d t|ƒ¡ }|d d d d  d! }t |¡ td"ƒS )%Nz)Installation error reported with no causec                   s*   g | ]}t |jtƒr|j ˆ j¡s|‘qS rG   )Ú
isinstancer@   r;   rô   re   )r_   r.  rv   rG   rH   r¦   '  s    
ýüÿz2Factory.get_installation_error.<locals>.<listcomp>r+  r-   Úpartsú	list[str]r\   r¡   c                 S  s2   t | ƒdkr
| d S d | d d… ¡d | d  S )Nr-   r   r¨   éÿÿÿÿz and )r¬   r­   )rI  rG   rG   rH   Ú	text_joinB  s   z1Factory.get_installation_error.<locals>.text_joinrA   r.   c                 S  sF   |   ¡ }|r	|js| j› d| j› �S t|jtƒrt|jjƒS t|jƒS )NrÆ   )Úget_install_requirementr�   r’   r”   rH  r&   r¡   )rA   r¥   rG   rG   rH   Údescribe_triggerH  s   

z8Factory.get_installation_error.<locals>.describe_triggerzthe requested packageszCannot install z> because these package versions have conflicting dependencies.z
The conflict is caused by:z
    ú z depends on zThe user requested z%
    The user requested (constraint) c                   s   h | ]	}ˆ   |¡s|’qS rG   )rF  rö   rv   rG   rH   rø   x  s    z1Factory.get_installation_error.<locals>.<setcomp>z

z7Additionally, some packages in these conflicts have no z6matching distributions available for your environment:zTo fix this you could try to:
z91. loosen the range of package versions you've specified
z<2. remove package versions to allow pip to attempt to solve zthe dependency conflict
z‚ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts)rI  rJ  r\   r¡   )rA   r.   r\   r¡   )r*  r0  r   r¬   ÚnextÚiterr’   rD  rü   r-  rý   r7  r�   r8  r”   r­   rž   r   )rr   r†   rM   Úrequires_python_causesrØ   rA   rL  rN  ÚtriggersÚtriggerrž   r~   Úrelevant_constraintsr  Úconstraint_textr*  rä   Úno_candidatesrG   rv   rH   Úget_installation_error  s�   
þÿ	




ÿ

ÿþýüûÿ
ÿþýüûÿ
	ÿzFactory.get_installation_errorru   )rP   r   rQ   r#   rR   r(   rS   rT   rU   rV   rW   rV   rX   rV   rY   rV   rZ   r[   r\   r]   )r\   rV   )rw   r!   r\   r]   )r‚   r2   rƒ   r„   r�   r…   r\   r4   )r`   r   rƒ   r„   r�   r&   r\   r.   )rw   r!   rƒ   r„   r�   r&   r’   r“   r”   r•   r\   r–   )
rw   r!   r�   r&   r’   r“   r”   r•   r\   r™   )rŸ   r    r’   r¡   r¢   r   r\   r£   )rŸ   r    r¢   r   r³   r*   r´   rV   rµ   r¶   r·   r¸   r\   r¹   )rß   rà   rƒ   r„   r\   rá   )rç   r¡   rè   r/   r�   r&   r\   rá   )rç   r¡   rK   rñ   rò   ró   rè   r/   r´   rV   rô   rõ   r\   r¹   )r¥   r&   r  r  r\   r  )r  r  r\   rJ   )r�   r.   r\   r:   )rG   )r¢   r¡   r�   r…   r  r  r\   r  )r¢   r   r\   r  )rw   r!   r’   r  r\   r  )r�   r.   r\   r#  )r*  r+  r\   r   )rØ   r0   rA   r–   r\   r   )rÃ   r¡   r\   rV   )r†   rG  rM   rL   r\   r   )rC   rD   rE   rt   ÚpropertyrW   r   rŽ   r‘   r˜   r—   r²   rÞ   ræ   rð   r  r
  r  r	  r  r  r"  r)  r0  rD  rF  rX  rG   rG   rG   rH   rO   [   s:    ö'
û



9 ù
y

"
M
5
*	ü





>rO   )dÚ
__future__r   rê   rÜ   rÏ   ÚloggingÚcollections.abcr   r   r   r   Útypingr   r   r	   r
   r   r   Ú"pip._vendor.packaging.requirementsr   Ú pip._vendor.packaging.specifiersr   Úpip._vendor.packaging.utilsr   r   Úpip._vendor.packaging.versionr   r   Úpip._vendor.resolvelibr   Úpip._internal.cacher   r   Úpip._internal.exceptionsr   r   r   r   r   r   r   Ú"pip._internal.index.package_finderr   Úpip._internal.metadatar   r   Úpip._internal.models.candidater    Úpip._internal.models.linkr!   Úpip._internal.models.wheelr"   Ú pip._internal.operations.preparer#   Úpip._internal.req.constructorsr$   r%   Úpip._internal.req.req_installr&   r'   Úpip._internal.resolution.baser(   Ú&pip._internal.utils.compatibility_tagsr)   Úpip._internal.utils.hashesr*   Úpip._internal.utils.packagingr+   Úpip._internal.utils.virtualenvr,   r‚   r.   r/   r0   Ú
candidatesr1   r2   r3   r4   r5   r6   r7   Úfound_candidatesr8   r9   rK   r:   r;   r<   r=   r>   r?   Ú	getLoggerrC   r�   rI   ÚdictÚCacherJ   rO   rG   rG   rG   rH   Ú<module>   sL     	$	$	
