U ʗRen @sfdZzedWnek r(YnXddlZddlZddlZddlmZ ddl m Z ddl m Z ddlmZddlmZmZmZmZmZmZdd lmZdd lmZdd lmZd d lmZee Z!d dde"e#e"e"e#e"e#ee"e"fdddZ$d!e"e#ee"ee"e#ee"edddZ%e"dddZ&e"dddZ'e"dddZ(e"ee"e"fdddZ)dS)"z7Locations where we look for configs, install stuff, etc_distutils_hackN)Command) SCHEME_KEYS)installget_python_lib)DictListOptionalTupleUnioncast)Scheme)WINDOWS)running_under_virtualenv)get_major_minor_versionF)ignore_config_files) dist_nameuserhomerootisolatedprefixrreturnc Csddlm}d|i}|r"dg|d<||} |stz | Wn8tk rr| } tdddd | DYnXd } | jd d d } | d k st t t | } |r|rt d|d||r|rt d|d||p| j | _ |s|rd| _ |p| j | _ |p| j| _|p| j| _| i} tD]}t| d|| |<q&d| d krf| t| j| jdtr|rz|}n|r| j}n| j }tj|dddt|| d<|d k rtjtj| dd}tj||dd | d<| S)z+ Return a distutils install scheme r) Distributionnamez --no-user-cfg script_argsz6Ignore distutils configs in %s due to encoding errors.z, css|]}tj|VqdS)N)ospathbasename).0pr#/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/locations/_distutils.py ?sz#distutils_scheme..NrT)createzuser=z prefix=zhome=install_ install_lib)purelibplatlibincludesitepythonheadersr)distutils.distrparse_config_filesUnicodeDecodeErrorfind_config_filesloggerwarningjoinget_command_objAssertionErrorr distutils_install_commandrrrrfinalize_optionsrgetattrget_option_dictupdatedictr)rinstall_userbaserrr splitdriveabspath)rrrrrrrr dist_argsdpathsobjischemekey path_no_driver#r#r$distutils_scheme#sb          rJ)rrrrrrrcCs8t||||||}t|d|d|d|d|ddS)a; Get the "scheme" corresponding to the input parameters. The distutils documentation provides the context for the available schemes: https://docs.python.org/3/install/index.html#alternate-installation :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 and provides the base directory for the same :param root: root under which other directories are re-based :param isolated: equivalent to --no-user-cfg, i.e. do not consider ~/.pydistutils.cfg (posix) or ~/pydistutils.cfg (non-posix) for scheme paths :param prefix: indicates to use the "prefix" scheme and provides the base directory for the same r+r*r/scriptsdata)r+r*r/rKrL)rJr)rrrrrrrGr#r#r$ get_schemetsrM)rcCsrtjtj}tr>tj|d}tj|s:tj|d}|Stjdddkrd|dddkrddStj|dS)NScriptsbindarwinz/System/Library/z/usr/local/bin) rrnormpathsysrrr6existsplatform)rbin_pyr#r#r$get_bin_prefixs "rXcCs tddS)NF plat_specificrr#r#r#r$ get_purelibsr[cCs tddS)NTrYrr#r#r#r$ get_platlibsr\)rrcCstd|dtd|dfS)NF)rZrTr)rr#r#r$get_prefixed_libss  r])FNNFN)FNNFN)*__doc__ __import__ remove_shim ImportErrorloggingrrT distutils.cmdrDistutilsCommanddistutils.command.installrrr9distutils.sysconfigrtypingrr r r r r pip._internal.models.schemerpip._internal.utils.compatrpip._internal.utils.virtualenvrbaser getLogger__name__r4strboolrJrMrXr[r\r]r#r#r#r$sh            S #