3 ”ReLã @sèdZddlmZddlZddlZddlZddlZddlZddlZddl mZ ddl m Z ddl m ZddlmZddlmZdd lmZdd lmZmZdd lmZerÌdd lmZmZmZmZdd lm Z!ej"dƒZ#dd„Z$dd„Z%ej&dƒZ'ej(ƒj)ƒdk�r e j*ƒZ'y ej+ƒZ,Wne-k �r2ej.Z,YnXe�r†ej/j0ej1dƒZ2ej/j0e,dƒZ3ej/j4e2ƒ�sÐej/j0ej1dƒZ2ej/j0e,dƒZ3nJej/j0ej1dƒZ2ej/j0e,dƒZ3ejdd…dk�rÐej1dd…dk�rÐdZ2d!dd„Z5d"dd „Z6dS)#z7Locations where we look for configs, install stuff, etcé)Úabsolute_importN)Ú sysconfig)Ú SCHEME_KEYS)Úinstall)ÚScheme)Úappdirs)ÚWINDOWS)ÚMYPY_CHECK_RUNNINGÚcast)Úrunning_under_virtualenv)ÚDictÚListÚOptionalÚUnion)ÚCommandÚpipcCs djtjŽS)ze Return the major-minor version of the current Python as a string, e.g. "3.7" or "3.10". z{}.{})ÚformatÚsysÚ version_info©rrú†/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/locations.pyÚget_major_minor_version"src CsZtƒrtjjtjdƒ}n6ytjjtjƒdƒ}Wntk rLtjdƒYnXtjj |ƒS)NÚsrcz=The folder you are executing pip from can no longer be found.) r ÚosÚpathÚjoinrÚprefixÚgetcwdÚOSErrorÚexitÚabspath)Ú src_prefixrrrÚget_src_prefix+s r"ÚpurelibÚpypyZScriptsÚbinéÚdarwinéz/System/Library/z/usr/local/binFcCsŒddlm}d|i}|r"dg|d<||ƒ}|jƒd} |jddd �} | dk sPt‚tt| ƒ} |o`| sttd j||ƒƒ‚|oz| sŽtd j||ƒƒ‚|p–| j| _|s¢|r¨d | _ |p°| j | _ |p¼| j | _ |pÈ| j | _ | j ƒi} xt D]} t| d | ƒ| | <qÞWd|jdƒk�r| jt| j| jd�ƒtƒ�rˆtjj| j dddjtƒƒ|ƒ| d<|dk �rˆtjjtjj| dƒƒd} tjj|| dd…ƒ| d<| S)z+ Return a distutils install scheme r)Ú DistributionÚnamez --no-user-cfgÚ script_argsNrT)Úcreatezuser={} prefix={}zhome={} prefix={}ÚÚinstall_Ú install_lib)r#ÚplatlibÚincludeÚsitezpython{}Úheadersé)Údistutils.distr)Úparse_config_filesÚget_command_objÚAssertionErrorr Údistutils_install_commandrÚuserrÚhomeÚrootÚfinalize_optionsrÚgetattrÚget_option_dictÚupdateÚdictr/r rrrrÚ splitdriver )Ú dist_namer:r;r<Úisolatedrr)Ú dist_argsÚdÚobjÚiÚschemeÚkeyÚ path_no_driverrrÚdistutils_scheme_sL            rLcCs8t||||||ƒ}t|d|d|d|d|dd�S)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 r0r#r3ÚscriptsÚdata)r0r#r3rMrN)rLr)rCr:r;r<rDrrIrrrÚ get_schemeŸsrO)FNNFN)FNNFN)7Ú__doc__Ú __future__rrÚos.pathÚplatformr2rrÚ distutilsÚdistutils_sysconfigÚdistutils.command.installrrr9Úpip._internal.models.schemerZpip._internal.utilsrÚpip._internal.utils.compatrÚpip._internal.utils.typingr r Úpip._internal.utils.virtualenvr Útypingr r rrÚ distutils.cmdrZDistutilsCommandÚuser_cache_dirÚUSER_CACHE_DIRrr"Úget_pathÚ site_packagesÚpython_implementationÚlowerÚget_python_libÚgetusersitepackagesÚ user_siteÚAttributeErrorÚ USER_SITErrrÚbin_pyÚbin_userÚexistsrLrOrrrrÚsX              ( A