a �Shd�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddgZ dZ iZ dd�Zed�Zed �Zded fd ed fgZdd d �Zd d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N)� resources�version� bootstrapz&/opt/alt/python39/share/python-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|� �}tj�|�t||<q:q t t t|t j j d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join� _WHEEL_DIR�format�_wheels�glob�len�basename�str�max� distutilsrZ LooseVersion)Zpkg�prefix�suffix�patternrZ version_str�r�7/opt/alt/python39/lib64/python3.9/ensurepip/__init__.py�_get_most_recent_wheel_versions rZ setuptools�pipZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS) 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-c�z-IT)Zcheck)�sys� executable�flags�isolated�insert� subprocess�run� returncode)�args�additional_paths�code�cmdrrr�_run_pip%s��  r&cCstS)N)� _PIP_VERSIONrrrrr9scCs2dd�tjD�}|D] }tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)� startswith)�.0�krrr� C�z7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settings?s r/F��root�upgrade�user� altinstall� default_pip� verbositycCst||||||d�dS)Nr0)� _bootstrapr0rrrrKs �c Cs�|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t����*}g}tD]�\}} } t || } t tj � t | �d��R} t tj � || �d��} | �| ���Wd�n1s�0YWd�n1s�0Y|�tj � || ��qTddd d |g}|�r|d |g7}|�r&|d g7}|�r6|d g7}|�rN|dd|g7}t|dd�tD�|�Wd�S1�s|0YdS)Nz.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr4ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz --no-indexz --find-links�--root� --upgrade�--user�-�vcSsg|] }|d�qS�rr�r)�prrrr+�r,z_bootstrap..)� ValueErrorr�auditr/rr-�tempfileZTemporaryDirectory� _PROJECTSr �openrrr �write�read�appendr&)r1r2r3r4r5r6Ztmpdirr#ZprojectrZpy_tagZ wheel_nameZsfp�fpr"rrrr7Zs4      J   r7)r6cCs�z ddl}Wnty YdS0|jtkrLd}t|�|jt�tjd�dSt�gd�}|rp|dd|g7}t |dd�t t �D��S) NrzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))�file)Z uninstallz-yz--disable-pip-version-checkr=r>cSsg|] }|d�qSr?rr@rrrr+�r,z%_uninstall_helper..) r� ImportError� __version__r'�printr r�stderrr/r&�reversedrE)r6r�msgr"rrr�_uninstall_helper�s   rRcCs�ddl}|jdd�}|jddd�t��dd�|jd d d dd d d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j |j |j |j d�S)Nrzpython -m ensurepip)�progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz --verbose�countr6zDGive more output. Option is additive, and can be used up to 3 times.)rT�default�destrUz-Ur;� store_trueFz8Upgrade pip and dependencies, even if already installed.)rTrWrUr<zInstall using the user scheme.r:z=Install everything relative to this alternate root directory.)rWrUz --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.)r1r2r3r6r4r5) �argparse�ArgumentParser� add_argumentr r� parse_argsr7r1r2r3r6r4r5)�argvrZ�parserr"rrr�_main�sj  ������� �r`)N)N)Zdistutils.versionrr rZos.pathrZrunpyrDr� importlibr�__all__r r rZ_SETUPTOOLS_VERSIONr'rEr&rr/rr7rRr`rrrr�s<  �  � � 6