B (\@sddlZddlZddlZddlZddlZddlZddlZddlmZddgZ dZ dZ dZ de d fd e d fgZ dd d Zd dZddZdddddddddZdddddddddZddddZdddZdS)N)rewheelversion bootstrap) setuptoolspipz47.1.0z20.2.4rZpy3rc Cs|dk r|tjt_|ddkr*|dtjdd}|tjdd<z>ytjddddWn$tk r}z|jSd}~XYnXWd|tjdd<Xtd dS) Nr)installlistZwheelz--prer__main__T)Zrun_nameZ alter_sysz*pip did not exit, this should never happen) syspathappendargvrunpyZ run_module SystemExitcode SystemError)argsadditional_pathsZ backup_argvexcr5/opt/alt/python37/lib/python3.7/ensurepip/__init__.py_run_pips   rcCstS)N) _PIP_VERSIONrrrrr*scCs6ddtjD}x|D] }tj|=qWtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr 4sz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)osenvirondevnull)Zkeys_to_removerrrr#_disable_pip_configuration_settings0s  r!F)rootupgradeuser altinstall default_pip verbositycCst||||||ddS)N)r"r#r$r%r&r') _bootstrap)r"r#r$r%r&r'rrrr<s c Cs|r|rtdt|r&dtjd<n|s4dtjd<g}d}tddtD}t|rt }xr|D](} t | |j } | tj |j | qfWn@x>tD]6\} } } tj tj tdd| | | }| |qWt }g}x4|D],}t||| tj |tj |qW|r&|dd d d |g}|rF|d |g7}|rV|d g7}|rf|dg7}|r~|dd|g7}t|ddtD|SQRXdS)Nz.Cannot use altinstall and default_pip togetherr%ZENSUREPIP_OPTIONSrcSsg|] }|dqS)rr)rprrrrisz_bootstrap..Z_bundledz{}-{}-{}-py2.py3-none-any.whlz--no-cache-dirz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|] }|dqS)rr)rr)rrrrs) ValueErrorr!rrrZfind_system_records _PROJECTSalltempfileZTemporaryDirectoryZrewheel_from_recordnamer r joindirname__file__formatshutilcopybasenameZcleanupr)r"r#r$r%r&r'ZwhlsZ rewheel_dirZ dep_recordsZdrZnew_whlZprojectrZpy_tagZwhlZtmpdirrrrrrr(KsL            r()r'cCsy 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-checkr*r+cSsg|] }|dqS)rr)rr)rrrrsz%_uninstall_helper..) r ImportError __version__rprintr4r stderrr!rreversedr-)r'rmsgrrrr_uninstall_helpers   r?cCsddl}|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 --verbosecountr'zDGive more output. Option is additive, and can be used up to 3 times.)rAdefaultdestrBz-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.)rArDrBz--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.)rDrBz --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$r'r%r&) argparseArgumentParser add_argumentr4r parse_argsr(r"r#r$r'r%r&)rrGparserrrrr_mainsZ   rL)N)N)rZos.pathZpkgutilr5r rr/Z ensurepipr__all__Z_PACKAGE_NAMESZ_SETUPTOOLS_VERSIONrr-rrr!rr(r?rLrrrrs0     H