+
     h  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHtHt ] P                  ! ]	4      t
]P                  ! R4      tR R ltR R ltR R	 ltR
 R ltR R ltR R ltR R ltR# )i    N)ListOptionalz8include-system-site-packages\s*=\s*(?P<value>true|false)c                $    V ^8  d   QhR\         /# i   ZreturnZboolZformat   "C/usr/lib/python3.14/site-packages/pip/_internal/utils/virtualenv.py__annotate__r      s     A AT A    c                 sb    \         P                  \        \         R\         P                  4      8g  # )zfChecks if sys.base_prefix and sys.prefix match.

This handles PEP 405 compliant virtual environments.
Zbase_prefix)sysprefixZgetattr r	   r   _running_under_venvr      s     
 ::mSZZ@@@r	   c                r   r   r   r   r   r   r   r      s     ' '$ 'r	   c                 s"    \        \        R4      # )zeChecks if sys.real_prefix is set.

This handles virtual environments created with pypa's virtualenv.
Zreal_prefix)Zhasattrr
   r   r	   r    _running_under_legacy_virtualenvr      s     3&&r	   c                r   r   r   r   r   r   r   r      s     G G$ Gr	   c                 s:    \        4       ;'       g    \        4       # )zDTrue if we're running inside a virtual environment, False otherwise.)r   r   r   r	   r   running_under_virtualenvr      s     FF$D$FFr	   c                sP    V ^8  d   QhR\         \        \        ,          ,          /# r   )r   r    Zstrr   r   r   r   r   $   s      xS	2 r	   c                 s(   \         P                  P                  \        P                  R4      p  \        V RR7      ;_uu_ 4       pVP                  4       P                  4       uuRRR4       #   + '       g   i     R# ; i  \         d     R# i ; i)z}Reads {sys.prefix}/pyvenv.cfg and returns its contents as list of lines

Returns None, if it could not read/access the file.
z
pyvenv.cfgzutf-8)ZencodingN)	ospathjoinr
   r   ZopenZreadZ
splitlinesZOSError)Zpyvenv_cfg_fileZf     r   _get_pyvenv_cfg_linesr   $   sd    
 ggll3::|<O /G44668&&( 5444 s/   B A.#
B .A?	9B ?B BBc                r   r   r   r   r   r   r   r   3   s      t r	   c                 s    \        4       p V f   \        P                  R4       R# V  F7  p\        P	                  V4      pVf   K  VP                  R4      R8X  g   K6   R# 	  R# )aB  Check `{sys.prefix}/pyvenv.cfg` for system site-packages inclusion

PEP 405 specifies that when system site-packages are not supposed to be
visible from a virtual environment, `pyvenv.cfg` must contain the following
line:

    include-system-site-packages = false

Additionally, log a warning if accessing the file fails.
zCould not access 'pyvenv.cfg' despite a virtual environment being active. Assuming global site-packages is not accessible in this environment.TZvalueZfalseF)r   loggerZwarning#_INCLUDE_SYSTEM_SITE_PACKAGES_REGEXmatchZgroup)Z	cfg_linesZliner   s      r   _no_global_under_venvr   3   sb     &'I 	#	

 399$?W!5!@  r	   c                r   r   r   r   r   r   r   r   P   s     8 8D 8r	   c                 s   \         P                  P                  \         P                  P                  \        P
                  4      4      p \         P                  P                  V R4      p\         P                  P                  V4      # )zCheck if "no-global-site-packages.txt" exists beside site.py

This mirrors logic in pypa/virtualenv for determining whether system
site-packages are visible in the virtual environment.
zno-global-site-packages.txt)r   r   ZdirnameZabspathsiteZ__file__r   Zexists)Zsite_mod_dirZno_global_site_packages_filer   r   "_no_global_under_legacy_virtualenvr   P   sV     77??277??4==#ABL#%77<<%$  77>>677r	   c                r   r   r   r   r   r   r   r   ^   s     
 
d 
r	   c                 sn    \        4       '       d   \        4       # \        4       '       d   \        4       # R# )zHReturns a boolean, whether running in venv with no system site-packages.F)r   r   r   r   r   r	   r   virtualenv_no_globalr   ^   s+     $&&'))133r	   )Zloggingr   Zrer   r
   Ztypingr    r   Z	getLoggerZ__name__r   Zcompiler   r   r   r   r   r   r   r   r   r	   r   <module>r      s^     	 	  
 !			8	$&(jj?' #
A'G
:8
r	   