HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_internal/utils/__pycache__/virtualenv.cpython-310.pyc
o

��h
�@s�ddlmZddlZddlZddlZddlZddlZe�e�Z	e�
d�Zddd�Zddd	�Z
dd
d�Zdd
d�Zddd�Zddd�Zddd�ZdS)�)�annotationsNz8include-system-site-packages\s*=\s*(?P<value>true|false)�return�boolcCstjttdtj�kS)znChecks if sys.base_prefix and sys.prefix match.

    This handles PEP 405 compliant virtual environments.
    �base_prefix)�sys�prefix�getattr�r	r	�I/usr/local/lib/python3.10/dist-packages/pip/_internal/utils/virtualenv.py�_running_under_venvsrcCs
ttd�S)zmChecks if sys.real_prefix is set.

    This handles virtual environments created with pypa's virtualenv.
    �real_prefix)�hasattrrr	r	r	r
� _running_under_legacy_virtualenvs
rcCst�pt�S)zDTrue if we're running inside a virtual environment, False otherwise.)rrr	r	r	r
�running_under_virtualenv sr�list[str] | NonecCsftj�tjd�}z t|dd��}|����Wd�WS1s!wYWdSty2YdSw)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.cfgzutf-8)�encodingN)	�os�path�joinrr�open�read�
splitlines�OSError)�pyvenv_cfg_file�fr	r	r
�_get_pyvenv_cfg_lines%s
(��rcCsPt�}|durt�d�dS|D]}t�|�}|dur%|�d�dkr%dSqdS)aZCheck `{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.
    Nz�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!r	r	r
�_no_global_under_venv4s�
�r%cCs0tj�tj�tj��}tj�|d�}tj�|�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.
    zno-global-site-packages.txt)rr�dirname�abspath�site�__file__r�exists)�site_mod_dir�no_global_site_packages_filer	r	r
�"_no_global_under_legacy_virtualenvQs�r-cCst�rt�St�rt�SdS)zHReturns a boolean, whether running in venv with no system site-packages.F)rr%rr-r	r	r	r
�virtualenv_no_global_s
r.)rr)rr)�
__future__r�loggingr�rer(r�	getLogger�__name__r�compiler rrrrr%r-r.r	r	r	r
�<module>s"
�