*z d dl Z d dlZd dlZd dlZd dlZd dlmZmZ e j e Z
ej d Zde
fdZde
fdZde
fdZdeee fdZde
fd Zde
fd
Zde
fdZdS ) N)ListOptionalz8include-system-site-packages\s*=\s*(?Ptrue|false)returnc ^ t j t t dt j k S )znChecks if sys.base_prefix and sys.prefix match.
This handles PEP 405 compliant virtual environments.
base_prefix)sysprefixgetattr /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/utils/virtualenv.py_running_under_venvr s
:mSZ@@@@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_regular_virtualenvr s 3
&&&r c : t p
t S )zBReturn True if we're running inside a virtualenv, False otherwise.)r r r r r
running_under_virtualenvr s G$E$G$GGr c t j t j d } t | d 5 }| cddd S # 1 swxY w Y dS # t $ r Y dS w xY w)zReads {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) ospathjoinr r openread
splitlinesOSError)pyvenv_cfg_filefs r
_get_pyvenv_cfg_linesr $ s
gll3:|<