Z~wjddlmZddlZddlZddlZddlmZmZddlm Z m Z ddgZ dd Z dd Z ddZdS)) annotationsN) site_packages user_site)running_under_virtualenvvirtualenv_no_globalegg_link_path_from_sys_pathegg_link_path_from_locationraw_namestrreturn list[str]c>tjdd|dz|dgS)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)resub)r s n/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/utils/egg_link.py_egg_link_namesrs1 h//+=   str | Nonect|}tjD]L}|D]G}tj||}tj|r|ccSHMdS)zJ Look for a .egg-link file for project name, by walking sys.path. N)rsyspathosjoinisfile)r egg_link_names path_item egg_link_nameegg_links rrr"sz%X..NX  +  Mw||I}==Hw~~h''    4rcg}trJ|tts!tr|tn;tr|t|tt |}|D]L}|D]G}t j||}t j |r|ccSHMdS)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) rappendrrrrrrrr)r sitesrsiteregglinks rr r /s$E!!$ ]####%% $) $ LL # # #  $ LL # # # ]###$X..N+  Mgll477Gw~~g&&    4r)r r r r )r r r r) __future__rrrrpip._internal.locationsrrpip._internal.utils.virtualenvrr__all__rrr rrr*s"""""" <<<<<<<< "!         """"""r