3 /f@sddlZddlZddlZddlZddlZddlZddlmZddgZdZ dZ de fde fgZ dd d Z d dZ d d ZdddddddddZdddddddddZddddZdddZdS)N)rewheelversion bootstrapz40.6.2z9.0.3Z setuptoolspipc Csd|dk r|tjt_yddlm}Wn tk rDddlm}YnX|ddkr\|jd||S)Nr)maininstalllistwheelz--pre)rrr )syspathZ pip._internalr ImportErrorrappend)argsadditional_pathsrr /usr/lib64/python3.6/__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 2sz7_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. )rrrrr r!N) _bootstrap)rrrrr r!rrrr:s 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)rrrrr r!ZwhlsZ rewheel_dirZ dep_recordsZdrZnew_whlZprojectrZwhlZtmpdirrrrrrr"IsL             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..) rr __version__rprintr.r stderrrrreversedr')r!rmsgrrrr_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@parserrrrr_mainsZ   rF)N)N)rZos.pathZpkgutilr/r r)Z ensurepipr__all__Z_SETUPTOOLS_VERSIONrr'rrrrr"r8rFrrrrs,     H