U Mfk@sddlZddlZddlZddlZddlZddlZddlZddlZddgZ dZ dZ iZ ddZ e dZe d Zded fd ed fgZdd d Zd dZddZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrap) setuptoolspipz&/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 rrrZpy3cCsFd|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)Zcheck)sys executableflagsisolatedinsert subprocessrun returncode)argsadditional_pathscodecmdrrr_run_pip%s  r&cCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONrrrrr9scCs2ddtjD}|D] }tj|=qtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr Cs 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/rrrrKs 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.bootstrapr3ZENSUREPIP_OPTIONSZinstallrbwbz--no-cache-dirz --no-indexz --find-links--root --upgrade--user-vcSsg|] }|dqSrrr)prrrr+sz_bootstrap..N) ValueErrorrauditr.rr,tempfileZTemporaryDirectory _PROJECTSr openrr r writereadappendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ wheel_nameZsfpfpr"rrrr6Zs4      "   r6)r5cCsz 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-checkr<r=cSsg|] }|dqSr>rr?rrrr+sz%_uninstall_helper..) r ImportError __version__r'printr rstderrr.r&reversedrD)r5rmsgr"rrr_uninstall_helpers   rQcCsddl}|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 --verbosecountr5zDGive more output. Option is additive, and can be used up to 3 times.)rSdefaultdestrTz-Ur: store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz --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.)r0r1r2r5r3r4) argparseArgumentParser add_argumentr r parse_argsr6r0r1r2r5r3r4)argvrYparserr"rrr_mainsn   r_)N)N)Zdistutils.versionrr rZos.pathrZrunpyrCr__all__Z_PACKAGE_NAMESr r rZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrrs@     6