a  ze@sddlZddlZddlZddlZddlZddlZddlmZddlm Z ddgZ dZ dZ d e d fd e d fgZ dd d ZddZddZdddddddddZdddddddddZddddZdddZdS)N) resources)_bundledversion bootstrapz58.1.0z21.2.4Z setuptoolsZpy3pipcCs.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)check) subprocessrunsys executable returncode)argsadditional_pathscoderF/opt/bitninja-python-dojo/embedded/lib/python3.9/ensurepip/__init__.py_run_pips rcCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONrrrrr%scCs2ddtjD}|D] }tj|=qtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr /z7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)osenvirondevnull)Zkeys_to_removerrrr#_disable_pip_configuration_settings+s rFrootupgradeuser 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. rN) _bootstraprrrrr7s c Cs\|r|rtdtd|t|r2dtjd<n|s@dtjd<t}g}tD]v\}} } d || | } t t | } t tj|| d} | | Wdn1s0Y|tj|| qTdd d d |g}|r|d |g7}|r|d g7}|r|dg7}|r |dd|g7}t|ddtD|WdS1sN0YdS)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_OPTIONSinstallz{}-{}-{}-none-any.whlwbNz--no-cache-dirz --no-indexz --find-links--root --upgrade--user-vcSsg|] }|dqSrrrprrrr}rz_bootstrap..) ValueErrorr auditrrrtempfileTemporaryDirectory _PROJECTSformatrZ read_binaryropenpathjoinwriteappendr)rr r!r"r#r$ZtmpdirrZprojectrZpy_tagZ wheel_nameZwhlfprrrrr%Fs:     (   r%)r$cCsz ddl}Wnty YdS0|jtkrLd}t||jttjddStgd}|rp|dd|g7}t |dd 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))file)Z uninstallz-yz--disable-pip-version-checkr+r,cSsg|] }|dqSr-rr.rrrrrz%_uninstall_helper..) r ImportError __version__rprintr5r stderrrrreversedr4)r$rmsgrrrr_uninstall_helpers   rCcCsddl}|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.)rEdefaultdestrFz-Ur) store_trueFz8Upgrade pip and dependencies, even if already installed.)rErHrFr*zInstall using the user scheme.r(z=Install everything relative to this alternate root directory.)rHrFz --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.)rr r!r$r"r#) argparseArgumentParser add_argumentr5r parse_argsr%rr r!r$r"r#)argvrKparserrrrr_mainsj   rQ)N)N)rZos.pathr Zrunpyr2r importlibrr__all__Z_SETUPTOOLS_VERSIONrr4rrrrr%rCrQrrrrs4      9