
    !2i	                    j    d dl mZ 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gZddZddZddZdS )    )annotationsN)site_packages	user_site)running_under_virtualenvvirtualenv_no_globalegg_link_path_from_sys_pathegg_link_path_from_locationraw_namestrreturn	list[str]c                >    t          j        dd|           dz   |  dgS )a  
    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.

    We also look for the raw name (without normalization) as setuptools 69 changed
    the way it names .egg-link files (https://github.com/pypa/setuptools/issues/4167).
    z[^A-Za-z0-9.]+-z	.egg-link)resub)r
   s    [/var/www/html/pixcura-vrs/venv/lib/python3.11/site-packages/pip/_internal/utils/egg_link.py_egg_link_namesr      s1     	h//+=     
str | Nonec                    t          |           }t          j        D ]L}|D ]G}t          j                            ||          }t          j                            |          r|c c S HMdS )zJ
    Look for a .egg-link file for project name, by walking sys.path.
    N)r   syspathosjoinisfile)r
   egg_link_names	path_itemegg_link_nameegg_links        r   r   r   "   sz     %X..NX    	+ 	  	 Mw||I}==Hw~~h''   	  4r   c                   g }t                      rJ|                    t                     t                      s!t          r|                    t                     n;t          r|                    t                     |                    t                     t          |           }|D ]L}|D ]G}t          j                            ||          }t          j        	                    |          r|c c S HMdS )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   siter   egglinks         r   r	   r	   /   s    $ E!! $]####%% 	$) 	$LL### 	$LL###]###$X..N  + 	 	Mgll477Gw~~g&& 	 4r   )r
   r   r   r   )r
   r   r   r   )
__future__r   r   r   r   pip._internal.locationsr   r   pip._internal.utils.virtualenvr   r   __all__r   r   r	    r   r   <module>r*      s    " " " " " " 				 				 



 < < < < < < < <        "!   
 
 
 
" " " " " "r   