Ë
    »ÿæi  ã                  ó¸   — d dl mZ d dlZd dlZd dlZd dlZd dlZ ej                  e«      Z	 ej                  d«      Zdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Zdd
„Zy)é    )ÚannotationsNz8include-system-site-packages\s*=\s*(?P<value>true|false)c                 ób   — t         j                  t        t         dt         j                  «      k7  S )znChecks if sys.base_prefix and sys.prefix match.

    This handles PEP 405 compliant virtual environments.
    Úbase_prefix)ÚsysÚprefixÚgetattr© ó    ús/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.pyÚ_running_under_venvr      s    € ô
 �:‰:œ¤ m´S·Z±ZÓ@Ñ@Ð@r
   c                 ó"   — t        t        d«      S )zmChecks if sys.real_prefix is set.

    This handles virtual environments created with pypa's virtualenv.
    Úreal_prefix)Úhasattrr   r	   r
   r   Ú _running_under_legacy_virtualenvr      s   € ô ”3˜Ó&Ð&r
   c                 ó.   — t        «       xs
 t        «       S )zDTrue if we're running inside a virtual environment, False otherwise.)r   r   r	   r
   r   Úrunning_under_virtualenvr       s   € äÓ ÒFÔ$DÓ$FÐFr
   c                 ó   — t         j                  j                  t        j                  d«      } 	 t        | d¬«      5 }|j                  «       j                  «       cddd«       S # 1 sw Y   yxY w# t        $ r Y yw xY w)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)ÚencodingN)	ÚosÚpathÚjoinr   r   ÚopenÚreadÚ
splitlinesÚOSError)Úpyvenv_cfg_fileÚfs     r   Ú_get_pyvenv_cfg_linesr   %   s^   € ô
 —g‘g—l‘l¤3§:¡:¨|Ó<€Oðô �/¨GÕ4¸Ø—6‘6“8×&Ñ&Ó(÷ 5×4Ò4ûäò Ùðús.   °A1 ½A%Á	A1 Á%A.Á*A1 Á.A1 Á1	A=Á<A=c                 ó²   — t        «       } | €t        j                  d«       y| D ]0  }t        j	                  |«      }|€Œ|j                  d«      dk(  sŒ0 y y)aZ  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.
    zŽCould not access 'pyvenv.cfg' despite a virtual environment being active. Assuming global site-packages is not accessible in this environment.TÚvalueÚfalseF)r   ÚloggerÚwarningÚ#_INCLUDE_SYSTEM_SITE_PACKAGES_REGEXÚmatchÚgroup)Ú	cfg_linesÚliner%   s      r   Ú_no_global_under_venvr)   4   sb   € ô &Ó'€IØÐô 	�‰ð#ô	
ð
 ãˆÜ3×9Ñ9¸$Ó?ˆØÑ §¡¨WÓ!5¸Ó!@Ùð ð r
   c                 ó  — t         j                  j                  t         j                  j                  t        j
                  «      «      } t         j                  j                  | d«      }t         j                  j                  |«      S )zÅCheck 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   ÚdirnameÚabspathÚsiteÚ__file__r   Úexists)Úsite_mod_dirÚno_global_site_packages_files     r   Ú"_no_global_under_legacy_virtualenvr2   Q   sV   € ô —7‘7—?‘?¤2§7¡7§?¡?´4·=±=Ó#AÓB€LÜ#%§7¡7§<¡<ØØ%ó$Ð ô �7‰7�>‰>Ð6Ó7Ð7r
   c                 óT   — t        «       r
t        «       S t        «       r
t        «       S y)zHReturns a boolean, whether running in venv with no system site-packages.F)r   r)   r   r2   r	   r
   r   Úvirtualenv_no_globalr4   _   s%   € ô ÔÜ$Ó&Ð&ä'Ô)Ü1Ó3Ð3àr
   )ÚreturnÚbool)r5   zlist[str] | None)Ú
__future__r   Úloggingr   Úrer-   r   Ú	getLoggerÚ__name__r"   Úcompiler$   r   r   r   r   r)   r2   r4   r	   r
   r   Ú<module>r=      sb   ðÝ "ã Û 	Û 	Û Û 
à	ˆ×	Ñ	˜8Ó	$€Ø&0 b§j¡jØ?ó'Ð #ó
Aó'óGó
óó:8ô
r
   