a  ze @s\ddlZddlZddlZddlZddlZddlZddlmZm Z ddl m Z m Z ddl mZddlmZmZeeZeeZeeddZedd d Zedd d Zedd dZedddZgdZ e!ddure "dd eeej#eej#eeej#ee dddZ$edddZ%edddZ&edddZ'eej(eefdddZ)dS)!N)InvalidSchemeCombinationUserInstallationInvalid) SCHEME_KEYSScheme)running_under_virtualenv)get_major_minor_versionis_osx_frameworkZget_preferred_scheme)returncCsdtvot otS)aCheck for Apple's ``osx_framework_library`` scheme. Python distributed by Apple's Command Line Tools has this special scheme that's used when: * This is a framework build. * We are installing into the system prefix. This does not account for ``pip install --prefix`` (also means we're not installing to the system prefix), which should use ``posix_prefix``, but logic here means ``_infer_prefix()`` outputs ``osx_framework_library``. But since ``prefix`` is not available for ``sysconfig.get_default_scheme()``, which is the stdlib replacement for ``_infer_prefix()``, presumably Apple wouldn't be able to magically switch between ``osx_framework_library`` and ``posix_prefix``. ``_infer_prefix()`` returning ``osx_framework_library`` means its behavior is consistent whether we use the stdlib implementation or our own, and we deal with this special case in ``get_scheme()`` instead. osx_framework_library)_AVAILABLE_SCHEMESrr r r d/opt/bitninja-python-dojo/embedded/lib/python3.9/site-packages/pip/_internal/locations/_sysconfig.py _should_use_osx_framework_prefixs rcCsvtr tdStrdStjjdtj}|tvr6|StjjtvrJtjjStjd}|tvrb|StjtvrrtjSdS)a!Try to find a prefix scheme for the current platform. This tries: * A special ``osx_framework_library`` for Python distributed by Apple's Command Line Tools, when not running in a virtual environment. * Implementation + OS, used by PyPy on Windows (``pypy_nt``). * Implementation without OS, used by PyPy on POSIX (``pypy``). * OS + "prefix", used by CPython on POSIX (``posix_prefix``). * Just the OS name, used by CPython on Windows (``nt``). If none of the above works, fall back to ``posix_prefix``. prefixr __prefix posix_prefix)_PREFERRED_SCHEME_APIrsysimplementationnameosr )implementation_suffixedsuffixedr r r _infer_prefix8s   rcCsHtr tdStrtsd}n tjd}|tvr6|SdtvrDtdS)z3Try to find a user scheme for the current platform.userosx_framework_user_user posix_user)rr rrrr rrr r r _infer_userWs  r!cCs(tr tdStjd}|tvr$|SdS)z,Try to find a home for the current platform.home_home posix_home)rrrr r r r r _infer_homefs  r%)installed_basebaseinstalled_platbaseplatbaser exec_prefixuserbaseF) dist_namerr"rootisolatedrr csb|rrtddr$r$tdddur4t}n|r@t}nt}durZ|dkrZd}durvfddtD}n durfd dtD}ni}tj||d }tr|r|d t j } n|d t j } d t } t j | dd| |d<n|sd}t|d|dt j |d||d|dd} |dur^tD]&} tj|t| | } t| | | q6| S)a\ Get the "scheme" corresponding to the input parameters. :param dist_name: the name of the package to retrieve the scheme for, used in the headers scheme path :param user: indicates to use the "user" scheme :param home: indicates to use the "home" scheme :param root: root under which other directories are re-based :param isolated: ignored, but kept for distutils compatibility (where this controls whether the user-site pydistutils.cfg is honored) :param prefix: indicates to use the "prefix" scheme and provides the base directory for the same z--userz--prefixz--homeNr rcsi|] }|qSr r .0k)r"r r zget_scheme..csi|] }|qSr r r/)rr rr2r3)schemevarsr+r'pythonincludesiteUNKNOWNplatlibpurelibscriptsdata)r:r;headersr<r=)rr%r!r _HOME_KEYS sysconfig get_pathsrgetrrrrpathjoinrr distutilsutil change_rootgetattrsetattr)r,rr"r-r.r scheme_name variablespathsr' python_xyr4keyvaluer )r"rr get_scheme}sJ    rPcCs4tjdddkr(tjdddkr(dStdS)Ndarwinz/System/Library/z/usr/local/binr<)rplatformrr@rAr r r rget_bin_prefixs$rUcCs tdS)Nr;r@rAr r r r get_purelibsrWcCs tdS)Nr:rVr r r r get_platlibsrX)rr cCs"tj||dd}|d|dfS)N)r'r))r5r;r:rV)rrLr r rget_prefixed_libssrY)FNNFN)*distutils.utilrEloggingrrr@typingpip._internal.exceptionsrrpip._internal.models.schemerrpip._internal.utils.virtualenvrr'rr getLogger__name__loggersetget_scheme_namesr rHrboolrstrrr!r%r?get_config_varappendOptionalrPrUrWrXTuplerYr r r rsJ      M