2biF S SK r S SKrS SKrS SKJrJr S SKJrJr S SK J
r
Jr SS/rS\
S\
4S jrS\
S\\
4S
jrS\
S\\
4S jrg) N)ListOptional)
site_packages user_site)running_under_virtualenvvirtualenv_no_globalegg_link_path_from_sys_pathegg_link_path_from_locationraw_namereturnc 8 [ R " SSU 5 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)resub)r s ڎ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/utils/egg_link.py_egg_link_namer s 66"C2[@@ c [ U 5 n[ R HJ n[ R R X!5 n[ R R U5 ( d MH Us $ g)zB
Look for a .egg-link file for project name, by walking sys.path.
N)r syspathosjoinisfile)r
egg_link_name path_itemegg_links r r r sK #8,MXX 77<< 9
77>>(##O r c / n[ 5 ( aE UR [ 5 [ 5 ( d [ ( a UR [ 5 O5[ ( a UR [ 5 UR [ 5 [ U 5 nU HJ n[ R R X25 n[ R R U5 ( d MH Us $ g)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 siteegglinks r r
r
' s $ E!!
]##%%))LL#9LL#
]#"8,M'',,t3
77>>'""N r )r r r typingr r pip._internal.locationsr r pip._internal.utils.virtualenvr r __all__strr r r
r r