Ë
    :i¯eF  ã                   ó�   — d dl Z d dlZd dlZd dlmZmZ d dlmZmZ d dl	m
Z
mZ ddgZdedefd	„Zdedee   fd
„Zdedee   fd„Zy)é    N)ÚListÚOptional)Úsite_packagesÚ	user_site)Úrunning_under_virtualenvÚvirtualenv_no_globalÚegg_link_path_from_sys_pathÚegg_link_path_from_locationÚraw_nameÚreturnc                 ó6   — t        j                  dd| «      dz   S )zÕ
    Convert a Name metadata value to a .egg-link name, by applying
    the same substitution as pkg_resources's safe_name function.
    Note: we cannot use canonicalize_name because it has a different logic.
    z[^A-Za-z0-9.]+ú-z	.egg-link)ÚreÚsub)r   s    úEE:\TRUCKING_PROJECT\Lib\site-packages\pip\_internal\utils\egg_link.pyÚ_egg_link_namer      s   € ô �6‰6Ð" C¨Ó2°[Ñ@Ð@ó    c                 óÊ   — t        | «      }t        j                  D ]E  }t        j                  j	                  ||«      }t        j                  j                  |«      sŒC|c S  y)zJ
    Look for a .egg-link file for project name, by walking sys.path.
    N)r   ÚsysÚpathÚosÚjoinÚisfile)r   Úegg_link_nameÚ	path_itemÚegg_links       r   r	   r	      sO   € ô # 8Ó,€MÜ—X‘Xò ˆ	Ü—7‘7—<‘< 	¨=Ó9ˆÜ�7‰7�>‰>˜(Õ#ØŠOðð r   c                 óœ  — g }t        «       r;|j                  t        «       t        «       sLt        rF|j                  t        «       n0t        r|j                  t        «       |j                  t        «       t        | «      }|D ]E  }t        j                  j                  ||«      }t        j                  j                  |«      sŒC|c S  y)a  
    Return the path for the .egg-link file if it exists, otherwise, None.

    There's 3 scenarios:
    1) not in a virtualenv
       try to find in site.USER_SITE, then site_packages
    2) in a no-global virtualenv
       try to find in site_packages
    3) in a yes-global virtualenv
       try to find in site_packages, then site.USER_SITE
       (don't look in global location)

    For #1 and #3, there could be odd cases, where there's an egg-link in 2
    locations.

    This method will just return the first one found.
    N)
r   Úappendr   r   r   r   r   r   r   r   )r   Úsitesr   ÚsiteÚegglinks        r   r
   r
   '   s‘   € ð$ €EÜÔ!Ø�‰”]Ô#Ü#Ô%­)Ø�L‰LœÕ#åØ�L‰LœÔ#Ø�‰”]Ô#ä" 8Ó,€MØò ˆÜ—'‘'—,‘,˜t ]Ó3ˆÜ�7‰7�>‰>˜'Õ"ØŠNðð r   )r   r   r   Útypingr   r   Úpip._internal.locationsr   r   Úpip._internal.utils.virtualenvr   r   Ú__all__Ústrr   r	   r
   © r   r   ú<module>r(      sl   ðÛ 	Û 	Û 
ß !ç <÷ð "Ø!ð€ðA˜Sð A Só Að	¨#ð 	°(¸3±-ó 	ð!¨#ð !°(¸3±-ô !r   