| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.6/site-packages/pip/_internal/utils/__pycache__/ |
Upload File : |
3
�N�a�
� @ s� d dl Z d dlZd dlZd dlZd dlZd dlmZmZ e je �Z
ejd�Ze
d�dd�Ze
d�dd�Ze
d�d d
�Zeee d�dd�Ze
d�d
d�Ze
d�dd�Ze
d�dd�ZdS )� N)�List�Optionalz8include-system-site-packages\s*=\s*(?P<value>true|false))�returnc C s t jtt dt j�kS )znChecks if sys.base_prefix and sys.prefix match.
This handles PEP 405 compliant virtual environments.
�base_prefix)�sys�prefix�getattr� r r � /usr/lib/python3.6/virtualenv.py�_running_under_venv s r c C s
t td�S )zmChecks if sys.real_prefix is set.
This handles virtual environments created with pypa's virtualenv.
Zreal_prefix)�hasattrr r r r r
�!_running_under_regular_virtualenv s r
c C s t � p
t� S )zBReturn True if we're running inside a virtualenv, False otherwise.)r r
r r r r
�running_under_virtualenv s r c C sN t jjtjd�} y$t| dd��}|j� j� S Q R X W n tk
rH dS X dS )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�joinr r �open�read�
splitlines�OSError)Zpyvenv_cfg_file�fr r r
�_get_pyvenv_cfg_lines$ s r c C sR t � } | dkrtjd� dS x0| D ](}tj|�}|dk r"|jd�dkr"dS q"W dS )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.
Nz�Could not access 'pyvenv.cfg' despite a virtual environment being active. Assuming global site-packages is not accessible in this environment.T�valueZfalseF)r �loggerZwarning�#_INCLUDE_SYSTEM_SITE_PACKAGES_REGEX�match�group)Z cfg_lines�liner r r r
�_no_global_under_venv3 s
r c C s0 t jjt jjtj��} t jj| d�}t jj|�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)r r �dirname�abspath�site�__file__r �exists)Zsite_mod_dirZno_global_site_packages_filer r r
�#_no_global_under_regular_virtualenvP s
r% c C s t � rt� S t� rt� S dS )zHReturns a boolean, whether running in venv with no system site-packages.F)r r r
r% r r r r
�virtualenv_no_global^ s
r&