ReddlZddlZddlZddlZddlZddlZddlmZm Z ddl m Z m Z ddl mZddlmZmZejeZeejZeeddZdefd Zdefd Zdefd Zdefd Zgd Z ej!de "d ddededej#edej#ededej#ede fdZ$defdZ%defdZ&defdZ'dedej(eeffdZ)dS)N)InvalidSchemeCombinationUserInstallationInvalid) SCHEME_KEYSScheme)running_under_virtualenv)get_major_minor_versionis_osx_frameworkget_preferred_schemereturncNdtvot o tS)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 /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/locations/_sysconfig.py _should_use_osx_framework_prefixrs1( #55 (** *    rcltrtdStrdStjjdt j}|t vr|Stjjt vrtjjSt jd}|t vr|St jt vr t jSdS)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_suffixedsuffixeds r _infer_prefixr 8s/$X...'))'&&!$!3!8DD27DD"444&& "444!&&'"""H%%% w$$$w >rctrtdStrtsd}ntjd}|t vr|Sdt vrt dS)z3Try to find a user scheme for the current platform.userosx_framework_user_user posix_user)rr rrrrrrs r _infer_userr'Wsy-$V,,,%":"<"<%'g$$$%%%---%''' -$V,,,'   H%%% zget_scheme..s111Q111rci|]}|Srr)r8r9rs rr:zget_scheme..s3331Q333r)schemevarsr2r.pythonincludesiteUNKNOWNplatlibpurelibscriptsdata)rBrCheadersrDrE)rr,r'r _HOME_KEYS sysconfig get_pathsrgetrrr rpathjoinrr distutilsutil change_rootgetattrsetattr)r3r"r)r4r5r scheme_name variablespathsr. python_xyr<keyvalues ` ` r get_schemerX}s* ==&x<<< ==&x<<< !mm &!mm #oo k-DDD$  1111j111  3333 333   { C C CE !!  5==SZ88DD==44D846688 7<<iKKi  i i  U9-y99i 6] F  ( (CN..tWVS5I5IJJE FC ' ' ' ' MrctjdddkrtjdddkrdStjdS)Ndarwinz/System/Library/z/usr/local/binrD)rplatformrrHrIrrrget_bin_prefixr^sG |BQB8## 3B3;M(M(M    ++rc4tjdS)NrCrHrIrrr get_purelibra    ++rc4tjdS)NrBr`rrr get_platlibrdrbrcRtj||d}|d|dfS)N)r.r0)r=rCrBr`)rrTs rget_prefixed_libsrfs2  f&%I%I J J JE ) eI. //r)FNNFN)*distutils.utilrMloggingrrrHtypingpip._internal.exceptionsrrpip._internal.models.schemerrpip._internal.utils.virtualenvrr.r r getLogger__name__loggersetget_scheme_namesrrPrboolrstrr r'r,rGget_config_varappendOptionalrXr^rardTuplerfrrrrxs  VVVVVVVV;;;;;;;;CCCCCC;;;;;;;;  8 $ $S335566 +A4HH$4s> S    S 9J''3j!!! !%!%#' JJJ J /# J /#  J  J OC J JJJJZ,,,,,,S,,,,,S,,,,0c0fl38&<000000r