a 9zi[@sddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddgZ dZ iZ ddZedZed Zded fd ed fgZdd d Zd dZddZdddddddddZdddddddddZddddZdddZdS)N) resourcesversion bootstrapz/usr/share/python3-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)pkgprefixsuffixpatternrZ version_strr*/usr/lib64/python3.9/ensurepip/__init__.py_get_most_recent_wheel_versions rZ setuptoolspipZpy3cCsFd|pgd|d}tjd|g}tjjr6|ddtj|ddjS) 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-cz-IT)check)sys executableflagsisolatedinsert subprocessrun returncode)argsadditional_pathscodecmdrrr_run_pip(s  r(cCstS)N) _PIP_VERSIONrrrrr<scCs2ddtjD}|D] }tj|=qtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr Fz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)renvirondevnull)Zkeys_to_remover,rrr#_disable_pip_configuration_settingsBs r1Frootupgradeuser altinstall default_pip verbositycCst||||||ddS)Nr2) _bootstrapr2rrrrNs c Cs|r|rtdtd|t|r2dtjd<n|s@dtjd<t*}g}tD]\}} } t || } t tj t | dR} t tj || d} | | Wdn1s0YWdn1s0Y|tj || qTddd d |g}|r|d |g7}|r&|d g7}|r6|d g7}|rN|dd|g7}t|ddtD|WdS1s|0YdS)Nz.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr6ZENSUREPIP_OPTIONSinstallrbwbz--no-cache-dirz --no-indexz --find-links--root --upgrade--user-vcSsg|] }|dqSrrr+prrrr-r.z_bootstrap..) ValueErrorrauditr1rr/tempfileTemporaryDirectory _PROJECTSr openrrr writereadappendr()r3r4r5r6r7r8Ztmpdirr%ZprojectrZpy_tagZ wheel_nameZsfpfpr$rrrr9]s4      J   r9)r8cCsz ddl}Wnty YdS0|jtkrLd}t||jttjddStgd}|rp|dd|g7}t |ddt t DS) NrzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))file)Z uninstallz-yz--disable-pip-version-checkr@rAcSsg|] }|dqSrBrrCrrrr-r.z%_uninstall_helper..) r ImportError __version__r)printr rstderrr1r(reversedrI)r8rmsgr$rrr_uninstall_helpers   rVcCsddl}|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 --verbosecountr8zDGive more output. Option is additive, and can be used up to 3 times.)rXdefaultdestrYz-Ur> store_trueFz8Upgrade pip and dependencies, even if already installed.)rXr[rYr?zInstall using the user scheme.r=z=Install everything relative to this alternate root directory.)r[rYz --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.)r3r4r5r8r6r7) argparseArgumentParser add_argumentr r parse_argsr9r3r4r5r8r6r7)argvr^parserr$rrr_mainsj   rd)N)N)Zdistutils.versionrr rZos.pathrZrunpyrGr! importlibr__all__r r rZ_SETUPTOOLS_VERSIONr)rIr(rr1rr9rVrdrrrrs<      6