U 3bb@sddlZddlZddlZddlZddlZddlZddlZddlZddgZ dZ iZ ddZ e dZ e dZde d fded fgZdd d Zd dZd dZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrapz&/opt/alt/python38/share/python-wheels/cCstjtd|}it|<dD]J}d||}t|D].}|t|t| }tj|t||<q:q t 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/python38/lib64/python3.8/ensurepip/__init__.py_get_most_recent_wheel_versions rZ setuptoolspipZpy3cCs.d|pgd|d}tjtjd|gddjS)Nz$ import runpy import sys sys.path = z + sys.path sys.argv[1:] = z> runpy.run_module("pip", run_name="__main__", alter_sys=True) z-cT)Zcheck) subprocessrunsys executable returncode)argsadditional_pathscoderrr_run_pip&s r cCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONrrrrr5scCs2ddtjD}|D] }tj|=qtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr ?s z7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)renvirondevnull)Zkeys_to_remover$rrr#_disable_pip_configuration_settings;s r(Frootupgradeuser 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. r)N) _bootstrapr)rrrrGs c CsP|r|rtdtd|t|r2dtjd<n|s@dtjd<t}g}tD]x\}} } t || } t tj t | d4} t tj || d} | | W5QRXW5QRX|tj || qTddd d |g}|r|d |g7}|r|d g7}|r |d g7}|r"|dd|g7}t|ddtD|W5QRSQRXdS)z Bootstrap pip into the current Python installation (or the given root directory). Returns pip command status code. Note that calling this function will alter both sys.path and os.environ. z.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr-ZENSUREPIP_OPTIONSZinstallrbwbz--no-cache-dirz --no-indexz --find-links--root --upgrade--user-vcSsg|] }|dqSrrr#prrrr%sz_bootstrap..N) ValueErrorrauditr(rr&tempfileZTemporaryDirectory _PROJECTSr openrrrwritereadappendr )r*r+r,r-r.r/ZtmpdirrZprojectrZpy_tagZ wheel_nameZsfpfprrrrr0Vs4      "   r0)r/cCsz ddl}Wntk r"YdSX|jtkrNd}t||jttjddStdddg}|rt|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-checkr6r7cSsg|] }|dqSr8rr9rrrr%sz%_uninstall_helper..) r ImportError __version__r!printr rstderrr(r reversedr>)r/rmsgrrrr_uninstall_helpers   rKcCsddl}|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.)rMdefaultdestrNz-Ur4 store_trueFz8Upgrade pip and dependencies, even if already installed.)rMrPrNr5zInstall using the user scheme.r3z=Install everything relative to this alternate root directory.)rPrNz --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_argumentr r parse_argsr0r*r+r,r/r-r.)argvrSparserrrrr_mainsn   rY)N)N)Zdistutils.versionrr rZos.pathrZrunpyr=r__all__rr rZ_SETUPTOOLS_VERSIONr!r>r rr(rr0rKrYrrrrs>     6