Ë
    ¨Õ°jÔ^  ã                  ó‚  — 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	 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 d d
lmZ d dlmZmZ d dlmZmZm Z m!Z! d dl"m#Z#m$Z$ d dl%m&Z&  ee'«      Z(	 	 	 	 	 	 	 	 dd„Z)	 	 	 	 dd„Z*e*dd„«       Z+dd„Z,dd„Z-dd„Z. G d„ d«      Z/ G d„ d«      Z0 G d„ d«      Z1y) é    )ÚannotationsN)ÚCallableÚ	GeneratorÚIterable)Úcache_from_source)ÚAny)ÚLegacyDistutilsInstallÚUninstallMissingRecord)Úget_bin_prefixÚget_bin_user)ÚBaseDistribution)ÚWINDOWS)Úegg_link_path_from_location)Ú	getLoggerÚ
indent_log)ÚaskÚnormalize_pathÚrenamesÚrmtree)ÚAdjacentTempDirectoryÚTempDirectory)Úrunning_under_virtualenvc              #  ó    K  — t         j                  j                  | |«      }|–— t        sy|› d�–— |› d�–— |r|› d�–— y|› d�–— y­w)z‘Create the fully qualified name of the files created by
    {console,gui}_scripts for the given ``dist``.
    Returns the list of file names
    Nz.exez.exe.manifestz-script.pywz
-script.py)ÚosÚpathÚjoinr   )Úbin_dirÚscript_nameÚis_guiÚexe_names       úU/var/www/mission/venv/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.pyÚ_script_namesr"      s^   è ø€ ô �w‰w�|‰|˜G [Ó1€HØ
‚NÝØØˆJ�dÐ
ÒØˆJ�mÐ
$Ò$ÙØ�
˜+Ð&Ó&à�
˜*Ð%Ó%ùs   ‚AAc                óD   ‡ — t        j                  ‰ «      dˆ fd„«       }|S )Nc               ?  óp   •K  — t        «       } ‰| i |¤ŽD ]  }||vsŒ|j                  |«       |–— Œ y ­w©N)ÚsetÚadd)ÚargsÚkwÚseenÚitemÚfns       €r!   Úuniquez_unique.<locals>.unique.   s=   øè ø€ ä›ˆÙ˜�O ‘Oò 	ˆDØ˜4ÒØ—‘˜”Ø“
ñ	ùs   ƒ6ž6)r(   r   r)   r   ÚreturnzGenerator[Any, None, None])Ú	functoolsÚwraps)r,   r-   s   ` r!   Ú_uniquer1   +   s'   ø€ ô ‡_�_�RÓôó ðð €Mó    c              #  óÖ  K  — | j                   }|€J d«       ‚| j                  «       }|€t        | ¬«      ‚|D ]­  }t        j                  j                  ||«      }|–— |j                  d«      sŒ9t        j                  j                  |«      \  }}|dd }t        j                  j                  ||dz   «      }|–— t        j                  j                  ||dz   «      }|–— Œ¯ y­w)aÇ  
    Yield all the uninstallation paths for dist based on RECORD-without-.py[co]

    Yield paths to all the files in RECORD. For each .py file in RECORD, add
    the .pyc and .pyo in the same directory.

    UninstallPathSet.add() takes care of the __pycache__ .py[co].

    If RECORD is not found, raises an error,
    with possible information from the INSTALLER file.

    https://packaging.python.org/specifications/recording-installed-packages/
    Nznot installed©Údistributionú.pyéýÿÿÿú.pycú.pyo)ÚlocationÚiter_declared_entriesr
   r   r   r   ÚendswithÚsplit)Údistr:   ÚentriesÚentryr   Údnr,   Úbases           r!   Úuninstallation_pathsrC   9   sÏ   è ø€ ð �}‰}€HØÐÐ0 Ó0Ðà×(Ñ(Ó*€GØ€Ü$°$Ô7Ð7àò 	ˆÜ�w‰w�|‰|˜H eÓ,ˆØŠ
Ø�=‰=˜ÕÜ—W‘W—]‘] 4Ó(‰FˆB�Ø�c�r�7ˆDÜ—7‘7—<‘<  D¨6¡MÓ2ˆDØŠJÜ—7‘7—<‘<  D¨6¡MÓ2ˆDØ‹Jñ	ùs   ‚A.C)Á1A8C)c                óÊ  — t         j                  j                  }t        «       }t        «       }t	        | t
        ¬«      D ]   }|j                  |dz   «      r|dd n|}|j                  |«      }|r?||v rŒ6t         j                  j                  |«      j                  |«      }||k(  rdn|}|rŒ?|j                  |«       |j                  |j                  |«      «       Œ¢ |S )zÈCompact a path set to contain the minimal number of paths
    necessary to contain all paths in the set. If /a/path/ and
    /a/path/to/a/file.txt are both in the set, leave only the
    shorter path.©ÚkeyÚ*NéÿÿÿÿÚ )
r   r   Úsepr&   ÚsortedÚlenr<   ÚrstripÚdirnamer'   )ÚpathsrJ   Úshort_pathsÚprefixesr   ÚcurrentÚparentÚnext_parents           r!   ÚcompactrU   [   sÈ   € ô �'‰'�+‰+€CÜ›E€KÜ›€Hä�u¤#Ô&ò 
.ˆØ#Ÿ}™}¨S°3©YÔ7�$�s˜‘)¸TˆØ—‘ Ó$ˆÙØ˜Ñ!ØÜŸ'™'Ÿ/™/¨&Ó1×8Ñ8¸Ó=ˆKØ&¨&Ò0‘R°kˆFò	 ð �O‰O˜DÔ!Ø�L‰L˜Ÿ™¨Ó,Õ-ð
.ð Ðr2   c                ó  ‡
‡‡— | D �ci c]"  }t         j                  j                  |«      |“Œ$ }}t        |«      }t	        |j                  «       D �ch c]$  }t         j                  j                  |«      d   ’Œ& c}t        ¬«      }t        «       }dd„Š|D ]º  Št        ˆfd„|D «       «      rŒt        «       }t        «       }t        j                  ‰«      D ]>  \  Š
}}	|j                  ˆ
ˆˆfd„|D «       «       |j                  ˆ
ˆˆfd„|	D «       «       Œ@ ||z
  rŒˆ|j                  |«       |j                  ‰t         j                  z   «       Œ¼ t        t        |j                  |«      «      |z  S c c}w c c}w )z«Returns a set containing the paths that need to be renamed.

    This set may include directories when the original sequence of paths
    included every file on disk.
    r   rE   c                 ót   — t         j                  j                  t        j                  j                  | Ž «      S r%   )r   r   Únormcaser   )Úas    r!   Ú	norm_joinz&compress_for_rename.<locals>.norm_join~   s$   € Ü�w‰w×Ñ¤§¡§¡¨aÐ 0Ó1Ð1r2   c              3  óz   •K  — | ]2  }t         j                  j                  ‰«      j                  |«      –— Œ4 y ­wr%   )r   r   rX   Ú
startswith)Ú.0ÚwÚroots     €r!   ú	<genexpr>z&compress_for_rename.<locals>.<genexpr>‚   s+   øè ø€ ÒG¸Œr�w‰w×Ñ Ó%×0Ñ0°×3ÑGùs   ƒ8;c              3  ó2   •K  — | ]  } ‰‰‰|«      –— Œ y ­wr%   © )r]   ÚdrN   rZ   r_   s     €€€r!   r`   z&compress_for_rename.<locals>.<genexpr>‰   s   øè ø€ ÒL¸q™y¨¨w¸×:ÑLùó   ƒc              3  ó2   •K  — | ]  } ‰‰‰|«      –— Œ y ­wr%   rb   )r]   ÚfrN   rZ   r_   s     €€€r!   r`   z&compress_for_rename.<locals>.<genexpr>Š   s   øè ø€ ÒH¸Q™Y t¨W°a×8ÑHùrd   )rY   Ústrr.   rg   )r   r   rX   r&   rK   Úvaluesr=   rL   ÚanyÚwalkÚupdateÚdifference_updater'   rJ   ÚmapÚ__getitem__)rO   ÚpÚcase_mapÚ	remainingÚ	uncheckedÚ	wildcardsÚ	all_filesÚall_subdirsÚsubdirsÚfilesrN   rZ   r_   s             @@@r!   Úcompress_for_renamerx   s   s<  ú€ ð 16Ö6¨1”—‘× Ñ  Ó# QÑ&Ð6€HÐ6Ü�H“€IÜ°X·_±_Ó5FÖG°œŸ™Ÿ™ aÓ(¨Ó+ÒGÌSÔQ€IÜ›%€Ió2ð ò )ˆÜÓG¸YÔGÔGàä!›eˆ	Ü #£ˆÜ')§w¡w¨t£}ò 	IÑ#ˆG�W˜eØ×ÑÕLÀGÔLÔLØ×ÑÕHÀ%ÔHÕHð	Ið ˜IÓ%Ø×'Ñ'¨	Ô2Ø�M‰M˜$¤§¡™-Õ(ð)ô" Œs�8×'Ñ'¨Ó3Ó4°yÑ@Ð@ùò3 7ùâGs   ˆ'E8Á)E=c                ót  — t        | «      }t        «       }t        «       }t        «       }|D ]h  }|j                  d«      rŒ|j                  d«      sd|v r.|j                  t        j                  j                  |«      «       |j                  |«       Œj t        t        t        j                  j                  |«      «      }t        |«      }|D ]¬  }t        j                  |«      D ]’  \  }}	}
|
D ]‡  }|j                  d«      rŒt        j                  j                  ||«      }t        j                  j                  |«      sŒUt        j                  j                  |«      |vsŒw|j                  |«       Œ‰ Œ” Œ® ||D �ch c]"  }t        j                  j                  |d«      ’Œ$ c}z  }||fS c c}w )as  Returns a tuple of 2 sets of which paths to display to user

    The first set contains paths that would be deleted. Files of a package
    are not added and the top-level directory of the package has a '*' added
    at the end - to signify that all it's contents are removed.

    The second set contains files that would have been skipped in the above
    folders.
    r8   z__init__.pyz
.dist-inforG   )r&   r<   r'   r   r   rN   rm   rX   rU   rj   r   Úisfile)rO   Úwill_removeÚ	will_skipÚfoldersrw   r   Ú_normcased_filesÚfolderÚdirpathÚ_ÚdirfilesÚfnameÚfile_s                r!   Úcompress_for_output_listingr…   •   so  € ô �e“*€KÜ“€Iô ‹e€GÜ‹E€EØò ˆØ�=‰=˜Ô ØØ�=‰=˜Ô'¨<¸4Ñ+?Ø�K‰KœŸ™Ÿ™¨Ó-Ô.Ø�	‰	�$�ðô œ3œrŸw™w×/Ñ/°Ó7Ó8Ðä�gÓ€Gð ò )ˆÜ$&§G¡G¨F£Oò 	)Ñ ˆG�Q˜Ø!ò 
)�Ø—>‘> &Ô)ØäŸ™Ÿ™ W¨eÓ4�ä—G‘G—N‘N 5Õ)ÜŸ™×(Ñ(¨Ó/Ð7GÒGð —M‘M %Õ(ñ
)ñ	)ð)ð À7ÖK¸œ2Ÿ7™7Ÿ<™<¨°Õ4ÒKÑK€Kà˜	Ð!Ð!ùò Ls   Æ'F5c                  óR   — e Zd ZdZd
d„Zdd„Zdd„Zdd„Zd
d„Zd
d„Z	e
dd„«       Zy	)ÚStashedUninstallPathSetzWA set of file rename operations to stash files while
    tentatively uninstalling them.c                ó    — i | _         g | _        y r%   )Ú
_save_dirsÚ_moves©Úselfs    r!   Ú__init__z StashedUninstallPathSet.__init__Ê   s   € ð 57ˆŒð .0ˆ�r2   c                óÀ   — 	 t        |«      }|| j                  t        j
                  j                  |«      <   |j
                  S # t        $ r t        d¬«      }Y ŒOw xY w)z�Stashes a directory.

        Directories are stashed adjacent to their original location if
        possible, or else moved/copied into the user's temp dir.Ú	uninstall©Úkind)r   ÚOSErrorr   r‰   r   r   rX   )rŒ   r   Úsave_dirs      r!   Ú_get_directory_stashz,StashedUninstallPathSet._get_directory_stashÒ   sU   € ð	7Ü&;¸DÓ&AˆHð 3;ˆ�‰œŸ™×(Ñ(¨Ó.Ñ/à�}‰}Ðøô	 ò 	7Ü$¨+Ô6ŠHð	7ús   ‚A ÁAÁAc                ó~  — t         j                  j                  |«      }t         j                  j                  |«      d}}d}||k7  r	 | j                  |   }n:t         j                  j                  |«      }t        d¬«      }|| j                  |<   t         j                  j                  ||«      }|rG|t         j                  j                  k7  r*t         j                  j                  |j                  |«      S |j                  S # t
        $ r Y nw xY wt         j                  j                  |«      |}}||k7  rŒöŒæ)z‚Stashes a file.

        If no root has been provided, one will be created for the directory
        in the user's temp directory.Nr�   r�   )
r   r   rX   rN   r‰   ÚKeyErrorr   ÚrelpathÚcurdirr   )rŒ   r   ÚheadÚold_headr“   r—   s         r!   Ú_get_file_stashz'StashedUninstallPathSet._get_file_stashà   sû   € ô
 �w‰w×Ñ Ó%ˆÜŸ™Ÿ™¨Ó.°ˆhˆØˆà�hÒðØŸ?™?¨4Ñ0�Øô —7‘7—?‘? 4Ó(ˆDÜ$¨+Ô6ˆHØ$,ˆD�O‰O˜DÑ!ä—'‘'—/‘/ $¨Ó-ˆÙ�w¤"§'¡'§.¡.Ò0Ü—7‘7—<‘< §¡¨wÓ7Ð7Ø�}‰}Ðøô ò ÙðúäŸW™WŸ_™_¨TÓ2°D�(ˆDð �hÓøs   Á	D Ä	DÄDc                ó�  — t         j                  j                  |«      xr  t         j                  j                  |«       }|r| j	                  |«      }n| j                  |«      }| j                  j                  ||f«       |r4t         j                  j                  |«      rt        j                  |«       t        ||«       |S )z�Stashes the directory or file and returns its new location.
        Handle symlinks as files to avoid modifying the symlink targets.
        )
r   r   ÚisdirÚislinkr”   r›   rŠ   ÚappendÚrmdirr   )rŒ   r   Úpath_is_dirÚnew_paths       r!   ÚstashzStashedUninstallPathSet.stashû   s”   € ô —g‘g—m‘m DÓ)ÒF´"·'±'·.±.ÀÓ2FÐ.FˆÙØ×0Ñ0°Ó6‰Hà×+Ñ+¨DÓ1ˆHà�‰×Ñ˜D (Ð+Ô,Ùœ2Ÿ7™7Ÿ=™=¨Ô2ô �H‰H�XÔÜ��hÔØˆr2   c                ó~   — | j                   j                  «       D ]  }|j                  «        Œ g | _        i | _         y)z0Commits the uninstall by removing stashed files.N)r‰   rh   ÚcleanuprŠ   )rŒ   r“   s     r!   ÚcommitzStashedUninstallPathSet.commit  s8   € àŸ™×.Ñ.Ó0ò 	ˆHØ×ÑÕð	àˆŒØˆ�r2   c                ób  — | j                   D ]  }t        j                  dg|¢­Ž  Œ | j                   D ]§  \  }}	 t        j                  d||«       t        j
                  j                  |«      st        j
                  j                  |«      rt	        j                  |«       n*t        j
                  j                  |«      rt        |«       t        ||«       Œ© | j                  «        y# t        $ r6}t        j                  d|«       t        j                  d|«       Y d}~Œõd}~ww xY w)z2Undoes the uninstall by moving stashed files back.zMoving to %s
 from %szReplacing %s from %szFailed to restore %szException: %sN)rŠ   ÚloggerÚinfoÚdebugr   r   rz   rž   Úunlinkr�   r   r   r’   Úerrorr¦   )rŒ   ro   r¢   r   Úexs        r!   Úrollbackz StashedUninstallPathSet.rollback  sà   € à—‘ò 	6ˆAÜ�K‰KÐ0Ð5°1Ô5ð	6ð #Ÿk™kò 
	2‰NˆH�dð	2Ü—‘Ð3°X¸tÔDÜ—7‘7—>‘> (Ô+¬r¯w©w¯~©~¸hÔ/GÜ—I‘I˜hÕ'Ü—W‘W—]‘] 8Ô,Ü˜8Ô$Ü˜˜hÕ'ð
	2ð 	�‰�øô	 ò 2Ü—‘Ð3°XÔ>Ü—‘˜_¨b×1Ñ1ûð2ús   »B!C/Ã/	D.Ã8,D)Ä)D.c                ó,   — t        | j                  «      S r%   )ÚboolrŠ   r‹   s    r!   Úcan_rollbackz$StashedUninstallPathSet.can_rollback*  s   € ä�D—K‘KÓ Ð r2   N©r.   ÚNone)r   rg   r.   rg   ©r.   r°   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r�   r”   r›   r£   r¦   r®   Úpropertyr±   rb   r2   r!   r‡   r‡   Æ   s9   „ ñ&ó0óóó6ó*óð& ò!ó ñ!r2   r‡   c                  ód   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zddd„Zdd„Z	dd„Z
dd	„Zedd
„«       Zy)ÚUninstallPathSetzMA set of file paths to be removed in the uninstallation of a
    requirement.c                ó¶   — t        «       | _        t        «       | _        i | _        || _        t        «       | _        t        j                  t        «      | _
        y r%   )r&   Ú_pathsÚ_refuseÚ_pthÚ_distr‡   Ú_moved_pathsr/   Ú	lru_cacher   Ú_normalize_path_cached)rŒ   r>   s     r!   r�   zUninstallPathSet.__init__3  sB   € Ü #£ˆŒÜ!$£ˆŒØ46ˆŒ	ØˆŒ
Ü3Ó5ˆÔô '0×&9Ñ&9¼.Ó&IˆÕ#r2   c                ót   — t        «       sy|j                  | j                  t        j                  «      «      S )zs
        Return True if the given path is one we are permitted to
        remove/modify, False otherwise.

        T)r   r\   rÃ   ÚsysÚprefix)rŒ   r   s     r!   Ú
_permittedzUninstallPathSet._permitted>  s+   € ô (Ô)ØØ�‰˜t×:Ñ:¼3¿:¹:ÓFÓGÐGr2   c                ó0  — t         j                  j                  |«      \  }}t         j                  j                  | j	                  |«      t         j                  j                  |«      «      }t         j                  j                  |«      sy | j                  |«      r| j                  j                  |«       n| j                  j                  |«       t         j                  j                  |«      d   dk(  r| j                  t        |«      «       y y )Né   r6   )r   r   r=   r   rÃ   rX   ÚexistsrÇ   r½   r'   r¾   Úsplitextr   )rŒ   r   r™   Útails       r!   r'   zUninstallPathSet.addI  s¿   € Ü—W‘W—]‘] 4Ó(‰
ˆˆdô �w‰w�|‰|˜D×7Ñ7¸Ó=¼r¿w¹w×?OÑ?OÐPTÓ?UÓVˆä�w‰w�~‰~˜dÔ#ØØ�?‰?˜4Ô Ø�K‰K�O‰O˜DÕ!à�L‰L×Ñ˜TÔ"ô �7‰7×Ñ˜DÓ! !Ñ$¨Ò-Ø�H‰HÔ& tÓ,Õ-ð .r2   c                ó  — | j                  |«      }| j                  |«      rE|| j                  vrt        |«      | j                  |<   | j                  |   j	                  |«       y | j
                  j	                  |«       y r%   )rÃ   rÇ   r¿   ÚUninstallPthEntriesr'   r¾   )rŒ   Úpth_filer@   s      r!   Úadd_pthzUninstallPathSet.add_pth\  sf   € Ø×.Ñ.¨xÓ8ˆØ�?‰?˜8Ô$Ø˜tŸy™yÑ(Ü&9¸(Ó&C�—	‘	˜(Ñ#Ø�I‰I�hÑ×#Ñ# EÕ*à�L‰L×Ñ˜XÕ&r2   c                ó¬  — | j                   s+t        j                  d| j                  j                  «       y| j                  j                  › d| j                  j
                  › �}t        j                  d|«       t        «       5  |s| j                  |«      r¦| j                  }t        | j                   «      }t        t        |«      «      D ])  }|j                  |«       t        j                  d|«       Œ+ | j                  j                  «       D ]  }|j!                  «        Œ t        j                  d|«       ddd«       y# 1 sw Y   yxY w)z\Remove paths in ``self._paths`` with confirmation (unless
        ``auto_confirm`` is True).z7Can't uninstall '%s'. No files were found to uninstall.Nú-zUninstalling %s:zRemoving file or directory %szSuccessfully uninstalled %s)r½   r¨   r©   rÀ   Úraw_nameÚraw_versionr   Ú_allowed_to_proceedrÁ   rx   rK   rU   r£   Úverboser¿   rh   Úremove)rŒ   Úauto_confirmrÖ   Údist_name_versionÚmovedÚ
for_renamer   Úpths           r!   r×   zUninstallPathSet.removee  s  € ð �{Š{Ü�K‰KØIØ—
‘
×#Ñ#ôð à#Ÿz™z×2Ñ2Ð3°1°T·Z±Z×5KÑ5KÐ4LÐMÐÜ�‰Ð&Ð(9Ô:ä‹\ñ 	NÙ˜t×7Ñ7¸Ô@Ø×)Ñ)�ä0°·±Ó=�
ä"¤7¨:Ó#6Ó7ò J�DØ—K‘K Ô%Ü—N‘NÐ#BÀDÕIðJð  Ÿ9™9×+Ñ+Ó-ò !�CØ—J‘J•Lð!ô —‘Ð9Ð;LÔM÷	N÷ 	Nñ 	Nús   ÂB:E
Å
Ec                ó"  — d	d„}|st        | j                  «      \  }}nt        | j                  «      }t        «       } |d|«        |d|«        |d| j                  «       |r |dt	        | j                  «      «       t        dd«      dk7  S )
z@Display which files would be deleted and prompt for confirmationc                óÐ   — |sy t         j                  | «       t        «       5  t        t	        |«      «      D ]  }t         j                  |«       Œ 	 d d d «       y # 1 sw Y   y xY wr%   )r¨   r©   r   rK   rU   )ÚmsgrO   r   s      r!   Ú_displayz6UninstallPathSet._allowed_to_proceed.<locals>._display…  sR   € ÙØä�K‰K˜ÔÜ“ñ &Ü"¤7¨5£>Ó2ò &�DÜ—K‘K Õ%ñ&÷&÷ &ñ &ús   £/AÁA%zWould remove:z+Would not remove (might be manually added):z%Would not remove (outside of prefix):zWill actually move:zProceed (Y/n)? )ÚyÚnrI   râ   )rß   rg   rO   úIterable[str]r.   r³   )r…   r½   r&   r¾   rx   r   )rŒ   rÖ   rà   r{   r|   s        r!   rÕ   z$UninstallPathSet._allowed_to_proceed‚  s…   € ó	&ñ Ü%@ÀÇÁÓ%MÑ"ˆK™ô ˜dŸk™kÓ*ˆKÜ›ˆIá� +Ô.ÙÐ>À	ÔJÙÐ8¸$¿,¹,ÔGÙÙÐ*Ô,?ÀÇÁÓ,LÔMäÐ$ nÓ5¸Ñ<Ð<r2   c                ól  — | j                   j                  s+t        j                  d| j                  j
                  «       yt        j                  d| j                  j
                  «       | j                   j                  «        | j                  j                  «       D ]  }|j                  «        Œ y)z1Rollback the changes previously made by remove().z'Can't roll back %s; was not uninstalledNzRolling back uninstall of %s)
rÁ   r±   r¨   r¬   rÀ   rÓ   r©   r®   r¿   rh   )rŒ   rÜ   s     r!   r®   zUninstallPathSet.rollbackž  s‚   € à× Ñ ×-Ò-Ü�L‰LØ9Ø—
‘
×#Ñ#ôð Ü�‰Ð2°D·J±J×4GÑ4GÔHØ×Ñ×"Ñ"Ô$Ø—9‘9×#Ñ#Ó%ò 	ˆCØ�L‰L�Nñ	r2   c                ó8   — | j                   j                  «        y)z?Remove temporary save dir: rollback will no longer be possible.N)rÁ   r¦   r‹   s    r!   r¦   zUninstallPathSet.commit«  s   € à×Ñ× Ñ Õ"r2   c           
     ó@  — |j                   }|j                  }|€(t        j                  d|j                  «        | |«      S t        |«      }|j                  s8t        j                  d|j                  |t        j                  «        | |«      S |t        j                  d«      t        j                  d«      hD �ch c]  }|r|’Œ c}v r)t        j                  d|j                  |«        | |«      S  | |«      }t        |j                  «      }|j                  xrF |d uxr@ t        j                  j!                  |«      xr |j#                  |j$                  › d�«       }|�r:|�|j'                  |«       |j)                  «       }	|	�8|	D ]1  }
|j'                  t        j                  j+                  ||
«      «       Œ3 �nÏ|j-                  d«      �r½	 |j/                  d«      }|j1                  d	¬
«      }|j/                  d«      j1                  «       D �cg c]
  }|r||vr|‘Œ c}D ]o  }t        j                  j+                  ||«      }|j'                  |«       |j'                  |› d�«       |j'                  |› d�«       |j'                  |› d�«       Œq �nò|j4                  rt7        |¬«      ‚|j8                  r‡|j'                  |«       t        j                  j;                  |«      d   }t        j                  j+                  t        j                  j=                  |«      d«      }|j?                  |d|z   «       �nG|j@                  r#tC        |«      D ]  }|j'                  |«       Œ �n|rÿtE        |«      5 }t        j                  jG                  |jI                  «       jK                  «       «      }|jM                  |«      }d d d «       t        j                  jO                  |«      sJ d|› d› d|j                  › d|› d�	«       ‚|j'                  |«       t        j                  j+                  t        j                  j=                  |«      d«      }|j?                  ||«       nt        jQ                  d||«       |jR                  rtU        «       }n
tW        «       }	 |jY                  «       D ]j  }|j'                  t        j                  j+                  ||«      «       tZ        sŒ9|j'                  t        j                  j+                  ||› d�«      «       Œl 	 	 	 	 	 	 	 dd„} |||«      D ]  }|j'                  |«       Œ |S c c}w # t2        $ r g }Y �Œww xY wc c}w # 1 sw Y   �Œ§xY w# t2        t\        f$ r Y Œew xY w)Nz-Not uninstalling %s since it is not installedz1Not uninstalling %s at %s, outside environment %sÚstdlibÚ
platstdlibz<Not uninstalling %s at %s, as it is in the standard library.z	.egg-infoztop_level.txtznamespace_packages.txtF)Úkeependsr6   r8   r9   r4   rÉ   zeasy-install.pthz./z	Egg-link z (to z') does not match installed location of z (at ú)z)Not sure how to uninstall: %s - Check: %sz.batc              3  óú   K  — | j                  «       D ]`  }|j                  dk(  r t        ||j                  d«      E d {  –—†  Œ2|j                  dk(  sŒBt        ||j                  d«      E d {  –—†  Œb y 7 Œ77 Œ	­w)NÚconsole_scriptsFÚgui_scriptsT)Úiter_entry_pointsÚgroupr"   Úname)r>   r   Úentry_points      r!   Úiter_scripts_to_removez:UninstallPathSet.from_dist.<locals>.iter_scripts_to_remove=  sv   è ø€ ð  $×5Ñ5Ó7ò N�Ø×$Ñ$Ð(9Ò9Ü,¨W°k×6FÑ6FÈÓN×NÑNØ ×&Ñ&¨-Ó7Ü,¨W°k×6FÑ6FÈÓM×MÑMñ	NàNøàMús(   ‚=A;¿A7Á A;ÁA;Á/A9Á0A;Á9A;)r>   r   r   rg   r.   úGenerator[str, None, None])/r:   Úinfo_locationr¨   r©   Úcanonical_namer   ÚlocalrÅ   rÆ   Ú	sysconfigÚget_pathr   rÓ   Ú"installed_with_setuptools_egg_infor   r   rÊ   r<   Úsetuptools_filenamer'   r;   r   Úis_fileÚ	read_textÚ
splitlinesÚFileNotFoundErrorÚinstalled_by_distutilsr	   Úinstalled_as_eggr=   rN   rÐ   Úinstalled_with_dist_inforC   ÚopenrX   ÚreadlineÚstriprÃ   Úsamefilerª   Úin_usersiter   r   Úiter_distutils_script_namesr   ÚNotADirectoryError)Úclsr>   Údist_locationrô   Únormalized_dist_locationro   Úpaths_to_removeÚdevelop_egg_linkÚsetuptools_flat_installationÚinstalled_filesÚinstalled_fileÚnamespace_packagesÚ
namespacesÚtop_level_pkgr   Úeasy_install_eggÚeasy_install_pthÚfhÚlink_pointerÚnormalized_link_pointerr   Úscriptrò   Úss                           r!   Ú	from_distzUninstallPathSet.from_dist¯  s`  € àŸ™ˆØ×*Ñ*ˆØÐ Ü�K‰KØ?Ø×#Ñ#ôñ �t“9Ðä#1°-Ó#@Ð Ø�zŠzÜ�K‰KØCØ×#Ñ#Ø(Ü—
‘
ô	ñ �t“9Ðà#ä×(Ñ(¨Ó2´I×4FÑ4FÀ|Ó4TÐUö(
àÙò ò(
ñ 
ô
 �K‰KØNØ×#Ñ#Ø(ôñ
 �t“9Ðá˜d›)ˆÜ6°t·}±}ÓEÐð ×3Ñ3ò SØ TÐ)òSä—‘—‘˜}Ó-òSð
 "×*Ñ*¨d×.FÑ.FÐ-GÀyÐ+QÓRÐRð 	%ò (ØÐ(Ø×#Ñ# MÔ2Ø"×8Ñ8Ó:ˆOØÐ*Ø&5ò U�NØ#×'Ñ'¬¯©¯©°]ÀNÓ(SÕTòUð
 —‘˜oÕ.ðOØ)-¯©Ð8PÓ)QÐ&ð "4×!>Ñ!>ÈÐ!>Ó!N�Jð "Ÿ^™^¨OÓ<×GÑGÓIö&àÙ˜Q jÑ0ò ò&ò 	7�Mô
 Ÿ7™7Ÿ<™<¨°}ÓE�DØ#×'Ñ'¨Ô-Ø#×'Ñ'¨4¨&°¨Ô5Ø#×'Ñ'¨4¨&°¨Ô6Ø#×'Ñ'¨4¨&°¨Õ6ò	7ð ×(Ò(Ü(°dÔ;Ð;à×"Ò"ð ×ÑÐ 8Ô9Ü!Ÿw™wŸ}™}Ð-EÓFÀqÑIÐÜ!Ÿw™wŸ|™|Ü—‘—‘Ð 8Ó9Ø"ó Ðð ×#Ñ#Ð$4°dÐ=MÑ6MÖNà×*Ò*Ü,¨TÓ2ò *�Ø×#Ñ# DÕ)ò*ñ ô Ð&Ó'ð ¨2Ü!Ÿw™w×/Ñ/°·±³×0CÑ0CÓ0EÓF�Ø*9×*PÑ*PØ ó+Ð'÷ô
 —7‘7×#Ñ#Ø'Ð)Aôð ð Ð,Ð-¨U°<°.ð A)Ø)-¯©¨°u¸]¸OÈ1ðNóð ð ×ÑÐ 0Ô1Ü!Ÿw™wŸ|™|Ü—‘—‘Ð 0Ó1Ð3Eó Ðð ×#Ñ#Ð$4°mÕDô �L‰LØ;ØØôð ×ÒÜ"“n‰Gä$Ó&ˆGð	Ø×:Ñ:Ó<ò P�Ø×#Ñ#¤B§G¡G§L¡L°¸&Ó$AÔBÞØ#×'Ñ'¬¯©¯©°WÀÀÈ¸oÓ(NÕOñPð	NØ"ð	Nàð	Nð (ó	Nñ (¨¨gÓ6ò 	#ˆAØ×Ñ Õ"ð	#ð ÐùòM(
øôT )ò $Ø!#“Jð$üò&÷Hñ ûôF "Ô#5Ð6ò 	Ùð	úsD   Â?U"ÇU' ÈU9ÎAU>Ò9AV Ô4V Õ'U6Õ5U6Õ>VÖVÖVN)r>   r   r.   r³   )r   rg   r.   r°   )r   rg   r.   r³   )rÏ   rg   r@   rg   r.   r³   )FF)rØ   r°   rÖ   r°   r.   r³   )rÖ   r°   r.   r°   r²   )r>   r   r.   r»   )rµ   r¶   r·   r¸   r�   rÇ   r'   rÐ   r×   rÕ   r®   r¦   Úclassmethodr  rb   r2   r!   r»   r»   /  sH   „ ñó	Jó	Hó.ó&'ôNó:=ó8ó#ð òZó ñZr2   r»   c                  ó,   — e Zd Zdd„Zdd„Zdd„Zd	d„Zy)
rÎ   c                ó>   — || _         t        «       | _        d | _        y r%   )Úfiler&   r?   Ú_saved_lines)rŒ   rÏ   s     r!   r�   zUninstallPthEntries.__init__N  s   € ØˆŒ	Ü!$£ˆŒØ04ˆÕr2   c                óì   — t         j                  j                  |«      }t        r4t         j                  j	                  |«      d   s|j                  dd«      }| j                  j                  |«       y )Nr   ú\ú/)r   r   rX   r   Ú
splitdriveÚreplacer?   r'   )rŒ   r@   s     r!   r'   zUninstallPthEntries.addS  sS   € Ü—‘× Ñ  Ó'ˆõ œ2Ÿ7™7×-Ñ-¨eÓ4°QÒ7Ø—M‘M $¨Ó,ˆEØ�‰×Ñ˜Õr2   c                ó4  — t         j                  d| j                  «       t        j                  j                  | j                  «      s!t         j                  d| j                  «       y t        | j                  d«      5 }|j                  «       }|| _	        d d d «       t        d„ D «       «      rd}nd}|r=|d   j                  |j                  d«      «      s|d   |j                  d«      z   |d<   | j                  D ]<  }	 t         j                  d	|«       |j                  ||z   j                  d«      «       Œ> t        | j                  d
«      5 }|j!                  |«       d d d «       y # 1 sw Y   ŒÛxY w# t        $ r Y Œ‡w xY w# 1 sw Y   y xY w)NzRemoving pth entries from %s:z.Cannot remove entries from nonexistent file %sÚrbc              3  ó$   K  — | ]  }d |v –— Œ
 y­w)s   
Nrb   )r]   Úlines     r!   r`   z-UninstallPthEntries.remove.<locals>.<genexpr>m  s   è ø€ Ò1 4ˆw˜$ŒÑ1ùs   ‚z
ú
rH   zutf-8zRemoving entry: %sÚwb)r¨   rÖ   r  r   r   rz   Úwarningr  Ú	readlinesr   ri   r<   Úencoder?   r×   Ú
ValueErrorÚ
writelines)rŒ   r  ÚlinesÚendliner@   s        r!   r×   zUninstallPthEntries.removeb  sX  € Ü�‰Ð6¸¿	¹	ÔBô �w‰w�~‰~˜dŸi™iÔ(Ü�N‰NÐKÈTÏYÉYÔWØÜ�$—)‘)˜TÓ"ð 	& bà—L‘L“NˆEØ %ˆDÔ÷	&ô Ñ1¨5Ô1Ô1Ø‰GàˆGá˜˜r™×+Ñ+¨G¯N©N¸7Ó,CÔDØ˜b™	 G§N¡N°7Ó$;Ñ;ˆE�"‰IØ—\‘\ò 	ˆEðÜ—‘Ð3°UÔ;Ø—‘˜e g™o×5Ñ5°gÓ>Õ?ð	ô �$—)‘)˜TÓ"ð 	! bØ�M‰M˜%Ô ÷	!ð 	!÷#	&ð 	&ûô ò Ùðú÷	!ð 	!ús*   ÂE3Ä9E?ÅFÅ3E<Å?	FÆ
FÆFc                ó*  — | j                   €!t        j                  d| j                  «       yt        j	                  d| j                  «       t        | j                  d«      5 }|j                  | j                   «       d d d «       y# 1 sw Y   yxY w)Nz.Cannot roll back changes to %s, none were madeFz!Rolling %s back to previous stater+  T)r   r¨   r¬   r  rª   r  r0  )rŒ   r  s     r!   r®   zUninstallPthEntries.rollback}  so   € Ø×ÑÐ$Ü�L‰LÐIÈ4Ï9É9ÔUØÜ�‰Ð8¸$¿)¹)ÔDÜ�$—)‘)˜TÓ"ð 	- bØ�M‰M˜$×+Ñ+Ô,÷	-à÷	-àús   Á$B	Â	BN)rÏ   rg   r.   r³   )r@   rg   r.   r³   r²   r´   )rµ   r¶   r·   r�   r'   r×   r®   rb   r2   r!   rÎ   rÎ   M  s   „ ó5ó
 ó!ô6r2   rÎ   )r   rg   r   rg   r   r°   r.   ró   )r,   ú)Callable[..., Generator[Any, None, None]]r.   r4  )r>   r   r.   ró   )rO   rã   r.   zset[str])rO   rã   r.   ztuple[set[str], set[str]])2Ú
__future__r   r/   r   rÅ   r÷   Úcollections.abcr   r   r   Úimportlib.utilr   Útypingr   Úpip._internal.exceptionsr	   r
   Úpip._internal.locationsr   r   Úpip._internal.metadatar   Úpip._internal.utils.compatr   Úpip._internal.utils.egg_linkr   Úpip._internal.utils.loggingr   r   Úpip._internal.utils.miscr   r   r   r   Úpip._internal.utils.temp_dirr   r   Úpip._internal.utils.virtualenvr   rµ   r¨   r"   r1   rC   rU   rx   r…   r‡   r»   rÎ   rb   r2   r!   ú<module>rB     sÍ   ðÝ "ã Û 	Û 
Û ß 9Ñ 9Ý ,Ý ç Sß @Ý 3Ý .Ý Dß =ß IÓ Iß MÝ Cá	�8Ó	€ð&Øð&Ø"ð&Ø,0ð&àó&ð&Ø1ðà.óð 	òó 	ðóBó0AóD."÷bf!ñ f!÷R[ñ [÷|7ò 7r2   