B š•ReLã@sèdZddlmZddlZddlZddlZddlZddlZddlZddl mZ ddl m Z ddl m ZddlmZddlmZdd lmZdd lmZmZdd lmZerÌdd lmZmZmZmZdd lm Z!e "d¡Z#dd„Z$dd„Z%e &d¡Z'e (¡ )¡dkr e  *¡Z'y e +¡Z,Wne-k r2ej.Z,YnXer†ej/ 0ej1d¡Z2ej/ 0e,d¡Z3ej/ 4e2¡sÐej/ 0ej1d¡Z2ej/ 0e,d¡Z3nJej/ 0ej1d¡Z2ej/ 0e,d¡Z3ejdd…dkrÐej1dd…dkrÐ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-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/locations.pyÚget_major_minor_version"srcCsZtƒrtj tjd¡}n6ytj t ¡d¡}Wntk rLt d¡YnXtj  |¡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<||ƒ}| ¡d} |jddd } | dk sPt‚tt| ƒ} |rr|rrtd  ||¡ƒ‚|rŠ|rŠtd  ||¡ƒ‚|p’| j| _|sž|r¤d | _ |p¬| j | _ |p¸| j | _ |pÄ| j | _ |   ¡i} xt D]} t| d | ƒ| | <qÚWd| d¡kr|  t| j| jd¡tƒr„tj | j ddd tƒ¡|¡| d<|dk r„tj tj | d¡¡d} tj || 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|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 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