e f@sVddlZddlZddlZddlZddlZddlZddlmZddgZdZ dZ dj e Z yddl Z Wn$ek rdZ dd ZYn Xd d Zd e fd e fgZdd dZddZddZddddddddddddddZddddZdddZdS)N)rewheelversion bootstrapz28.8.0z6.0.8zpip {} requires SSL/TLScCsttdS)N) RuntimeError_MISSING_SSL_MESSAGErr7/opt/alt/python34/lib64/python3.4/ensurepip/__init__.py_require_ssl_for_pipsr cCsdS)Nrrrrrr sZ setuptoolspipcCs\|dk r|tjt_nddl}|ddkrK|jdn|j|dS)Nrinstalllistwheelz--pre)r zlistr )syspathr appendmain)argsadditional_pathsr rrr_run_pip$s   rcCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONrrrrr0scCsEddtjD}x|D]}tj|=qWtjtjd:s z7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)osenvirondevnull)Zkeys_to_removerrrr#_disable_pip_configuration_settings6s rrootupgradeFuser altinstall default_pip verbosityc Cs?|r|rtdntt|r?dtjd} tj| ||j tjj|tjj| qMW|r|jndd d |g}|r|d |g7}n|r|d g7}n|r|dg7}n|r|dd|g7}nt|ddtD|WdQXdS)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. z.Cannot use altinstall and default_pip togetherr!ZENSUREPIP_OPTIONSr NcSsg|]}|dqS)rr)rprrrras zbootstrap..Z_bundledz{}-{}-py2.py3-none-any.whlz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|]}|dqS)rr)rr$rrrrs ) ValueErrorr rrrrZfind_system_records _PROJECTSalltempfileZTemporaryDirectoryZrewheel_from_recordnamerrjoindirname__file__formatshutilcopybasenameZcleanupr)rrr r!r"r#ZwhlsZ rewheel_dirZ dep_recordsZdrZnew_whlZprojectrZwhlZtmpdirrrrrrrBsN    &  , c Csyddl}Wntk r(dSYnX|jtkrdd}t|j|jtdtjdStt dddg}|r|dd |g7}nt |d d t t DdS) 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$rrrrs z%_uninstall_helper..) r ImportError __version__rprintr/rstderrr rrreversedr()r#r msgrrrr_uninstall_helpers  "r:c Cstdkr,tdjtdtjdSddl}|jdd}|jddddd jt d d |jd d ddddddd d|jddddddd d|jdddddd d|jdddd d|jdddddd d|jdddddd d|j |}t d |j d!|j d"|jd|jd#|jd$|jdS)%NzIgnoring ensurepip failure: {}r3rprogzpython -m ensurepipz --versionactionrzpip {}helpz9Show the version of pip that is bundled with this Python.z-vz --verbosecountdefaultdestr#zDGive more output. Option is additive, and can be used up to 3 times.z-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.z--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.z --altinstallzmMake an alternate install, installing only the X.Y versionedscripts (Default: pipX, pipX.Y, easy_install-X.Y)z --default-pipzpMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scriptsrrr r!r")sslr6r/rrr7argparseArgumentParser add_argumentr parse_argsrrrr r#r!r")argvrCparserrrrr_mainsb          rI)rZos.pathZpkgutilr0rr*Z ensurepipr__all__Z_SETUPTOOLS_VERSIONrr/rrBr4r r(rrrrr:rIrrrrs4             I