3  f@sddlZddlZddlZddlZddlZddlZddlmZddgZdZ dZ de fde fgZ dd d Z d dZ d d ZdddddddddZdddddddddZddddZdddZdS)N)rewheelversion bootstrapz40.6.2z9.0.1Z setuptoolspipcCs>|dk r|tjt_ddl}|ddkr2|jd|jj|S)Nrinstalllistwheelz--pre)rrr)syspathZ pip._internalappendZ _internalmain)argsadditional_pathsrr7/opt/alt/python36/lib64/python3.6/ensurepip/__init__.py_run_pips    rcCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONrrrrr#scCs6ddtjD}x|D] }tj|=qWtjtjd<dS)NcSsg|]}|jdr|qS)ZPIP_) startswith).0krrr -sz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)osenvirondevnull)Zkeys_to_removerrrr#_disable_pip_configuration_settings)s  rF)rootupgradeuser altinstall default_pip verbositycCst||||||ddS)z Bootstrap pip into the current Python installation (or the given root directory). Note that calling this function will alter both sys.path and os.environ. )rrrrrr N) _bootstrap)rrrrrr rrrr5s c Cs|r|rtdt|r&dtjd<n|s4dtjd<g}d}tjddtD}t|rtj }xn|D](} tj | |j } |j tj j|j | qfWn.Z_bundledz{}-{}-py2.py3-none-any.whlz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|] }|dqS)rr)rr"rrrrs) ValueErrorrrrrZfind_system_records _PROJECTSalltempfileZTemporaryDirectoryZrewheel_from_recordnamer r joindirname__file__formatshutilcopybasenameZcleanupr)rrrrrr ZwhlsZ rewheel_dirZ dep_recordsZdrZnew_whlZprojectrZwhlZtmpdirrr rrrr!DsL             r!)r c Csy ddl}Wntk r dSX|jtkrLd}t|j|jttjddStdddg}|rr|dd |g7}t |d d t t DS) z~Helper to support a clean default uninstall process on Windows Note that calling this function may alter os.environ. rNzOensurepip 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__rprintr-r stderrrrreversedr&)r rmsgr rrr_uninstall_helpers   r8cCsddl}|jdd}|jdddjtdd|jd d d dd d d|jdddddd|jddddd|jdddd|jddddd|jddddd|j|}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.)r:defaultdestr;z-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.)r:r=r;z--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.)r=r;z --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.)rrrr rr) argparseArgumentParser add_argumentr-r parse_argsr!rrrr rr)argvr@parserr rrr_mainsZ   rF)N)N)rZos.pathZpkgutilr.r r(Z ensurepipr__all__Z_SETUPTOOLS_VERSIONrr&rrrrr!r8rFrrrrs,     H