7i ddlZddlZddlZddlZddlZddlmZmZeje Z ejdZ de fdZde fdZde fdZdeeefdZde fd Zde fd Zde fd Zy) N)ListOptionalz8include-system-site-packages\s*=\s*(?Ptrue|false)returncbtjttdtjk7S)znChecks if sys.base_prefix and sys.prefix match. This handles PEP 405 compliant virtual environments. base_prefix)sysprefixgetattrg/mnt/ssd/data/python-lab/ChefSystem/venv/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py_running_under_venvrs ::mSZZ@ @@r c"ttdS)zmChecks if sys.real_prefix is set. This handles virtual environments created with pypa's virtualenv. real_prefix)hasattrrr r r _running_under_legacy_virtualenvrs 3 &&r c.txs tS)zDTrue if we're running inside a virtual environment, False otherwise.)rrr r r running_under_virtualenvrs  F$D$FFr ctjjtjd} t |d5}|j jcdddS#1swYyxYw#t$rYywxYw)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) ospathjoinrr openread splitlinesOSError)pyvenv_cfg_filefs r _get_pyvenv_cfg_linesr $sg ggll3::|>6 77r cTtr tStr tSy)zHReturns a boolean, whether running in venv with no system site-packages.F)rr+rr4r r r virtualenv_no_globalr6^s%$&&')133 r )loggingrrer/rtypingrr getLogger__name__r$compiler&boolrrrstrr r+r4r6r r r r?s !   8 $&0bjj?'# ATA'$'G$G xS 2 t: 8D 8 d r