B Na,kt@sddlZddlZddlZddlZddlZddlZddlZddgZdZ dZ iZ ddZ e dZ e d Zde d fd ed fgZdd d Zd dZddZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrap) setuptoolspipz&/opt/alt/python37/share/python-wheels/cCstjtd|}it|<xVdD]N}d||}xWq"Wt t t|t j j dS)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})key)ospathjoin _WHEEL_DIRformat_wheelsgloblenbasenamestrmax distutilsrZ LooseVersion)ZpkgprefixsuffixpatternrZ version_strr7/opt/alt/python37/lib64/python3.7/ensurepip/__init__.py_get_most_recent_wheel_versions  rrrZpy3c Cs|dk r|tjt_tjdd}|tjdd<z>ytjddddWn$tk rj}z|jSd}~XYnXWd|tjdd<XtddS)Nr__main__T)Zrun_nameZ alter_sysz*pip did not exit, this should never happen)sysrargvrunpyZ run_module SystemExitcode SystemError)argsadditional_pathsZ backup_argvexcrrr_run_pip$s r$cCstS)N) _PIP_VERSIONrrrrr7scCs6ddtjD}x|D] }tj|=qWtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr Asz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)renvirondevnull)Zkeys_to_remover(rrr#_disable_pip_configuration_settings=s  r,F)rootupgradeuser altinstall default_pip verbositycCst||||||ddS)N)r-r.r/r0r1r2) _bootstrap)r-r.r/r0r1r2rrrrIs c Cs8|r|rtdt|r&dtjd<n|s4dtjd<t}g}xtD]x\}} } t|| } ttj t | d4} ttj || d} | | WdQRXWdQRX|tj || qHWdddd |g}|r|d |g7}|r|d g7}|r|d g7}|r|d d|g7}t|ddtD|SQRXdS)Nz.Cannot use altinstall and default_pip togetherr0ZENSUREPIP_OPTIONSinstallrbwbz--no-cache-dirz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|] }|dqS)rr)r'prrrr)sz_bootstrap..) ValueErrorr,rr*tempfileZTemporaryDirectory _PROJECTSr openrr r writereadappendr$)r-r.r/r0r1r2Ztmpdirr"ZprojectrZpy_tagZ wheel_nameZsfpfpr!rrrr3Xs2     "   r3)r2cCsy ddl}Wntk r dSX|jtkrLd}t||jttjddStdddg}|rr|dd|g7}t |d d t t DS) NrzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))fileZ uninstallz-yz--disable-pip-version-checkr7r8cSsg|] }|dqS)rr)r'r9rrrr)sz%_uninstall_helper..) r ImportError __version__r%printr rstderrr,r$reversedr<)r2rmsgr!rrr_uninstall_helpers   rIcCsddl}|jdd}|jdddtdd|jd d d dd d d|jdddddd|jddddd|jdddd|jddddd|jddddd||}t|j|j|j |j |j |j dS)Nrzpython -m ensurepip)progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)actionrhelpz-vz --verbosecountr2zDGive more output. Option is additive, and can be used up to 3 times.)rKdefaultdestrLz-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.)rKrNrLz--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.)rNrLz --altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z --default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r-r.r/r2r0r1) argparseArgumentParser add_argumentr r parse_argsr3r-r.r/r2r0r1)rrQparserr!rrr_mainsZ   rV)N)N)Zdistutils.versionrr rZos.pathrrr;__all__Z_PACKAGE_NAMESr r rZ_SETUPTOOLS_VERSIONr%r<r$rr,rr3rIrVrrrrs4     2