Your IP : 3.131.37.82


Current Path : /opt/alt/python310/lib64/python3.10/ensurepip/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/ensurepip/__pycache__/__init__.cpython-310.opt-2.pyc

o

7]�f�&�@sddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddgZdZ
e�dd�ZdaiZd	d
�Zed�Zed�Zded
fded
fgZdd�Zdd�Zdad!dd�Zdd�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zd!dd �ZdS)"�N)�	resources�version�	bootstrap)�
setuptools�pipZPackage)r�
wheel_name�
wheel_pathz'/opt/alt/python310/share/python-wheels/cCs�tj�td�|��}it|<dD]%}d�||�}t�|�D]}|t|�t|��}tj�|�t||<qqt	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�_WHEEL_PKG_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�9/opt/alt/python310/lib64/python3.10/ensurepip/__init__.py�_get_most_recent_wheel_versions�rrrZpy3cCs�i}zt�|�}Wntyd}Ynwt|�}|D]2}|�d�s#qtD]
}|d}|�|�r2nq%q|�|��d�d}tj	�
||�}t|d|�||<q|S)Nrz.whl�-r)r
�listdir�OSError�sorted�endswith�_PACKAGE_NAMES�
startswith�removeprefix�	partitionrr�_Package)r�packages�	filenames�filename�namerrrrrr�_find_packages0s(�

�r*csjtdurtSi}tD]\}}}t||}t||d�||<q
tr1tt��t�fdd�tD��r1�}|a|S)Nc3s�|]}|�vVqdS�Nr)�.0r)�Zdir_packagesrr�	<genexpr>Ys�z _get_packages.<locals>.<genexpr>)�	_PACKAGES�	_PROJECTSrr%r
r*�allr!)r&r)r�py_tagrrr-r�
_get_packagesMsr3cCsJd|pg�d|�d�}tjddd|g}tjjr|�dd�tj|d	d
�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-Wzignore::DeprecationWarningz-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip`s��	�rAcCs	t�djS)Nr)r3rrrrrrzscCs2dd�tjD�}|D]}tj|=q
tjtjd<dS)NcSsg|]	}|�d�r|�qS)ZPIP_)r")r,�krrr�
<listcomp>�sz7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r
�environ�devnull)Zkeys_to_removerBrrr�#_disable_pip_configuration_settings�s
rFF��root�upgrade�user�
altinstall�default_pip�	verbositycCs	t||||||d�dS)NrG)�
_bootstraprGrrrr�s

�cCsx	|r	|r	td��t�d|�t�|rdtjd<n|s!dtjd<t����}g}tD]O\}}	}
t	||	}tj
�t|�}tj
�||�}
t
|d��$}t
|
d��}|�|���Wd�n1s`wYWd�n1sowY|�|
�q*ddd	d
|g}|r�|d|g7}|r�|dg7}|r�|d
g7}|r�|dd|g7}tg|�t�|�Wd�S1s�wYdS)Nz.Cannot use altinstall and default_pip togetherzensurepip.bootstraprKZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--userr�v)�
ValueErrorr5�auditrFr
rD�tempfileZTemporaryDirectoryr0rrrr
�open�write�read�appendrAr!)rHrIrJrKrLrMZtmpdirr>Zprojectrr2rZfilename_wheelZfilename_tmpZsfp�fpr=rrrrN�sB

���

$�rN)rMcCs�	zddl}Wn
tyYdSwt�}|j|kr+td|j�d|�d�tjd�dSt�gd�}|r=|dd|g7}tg|�t	t
���S)	Nrz2ensurepip will only uninstall a matching version (z installed, z available))�file)Z	uninstallz-yz--disable-pip-version-checkrrT)r�ImportErrorr�__version__�printr5�stderrrFrA�reversedr!)rMrZavailable_versionr=rrr�_uninstall_helper�s*�
���rccCs�ddl}|jdd�}|jddd�t��dd�|jd	d
ddd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�countrMzDGive more output. Option is additive, and can be used up to 3 times.)re�default�destrfz-UrR�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rerhrfrSzInstall using the user scheme.rQz=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.)rHrIrJrMrKrL)
�argparse�ArgumentParser�add_argumentrr�
parse_argsrNrHrIrJrMrKrL)�argvrk�parserr=rrr�_main�sj
�������
�rqr+) Zdistutils.versionrr�collectionsr
Zos.pathr:r5Z	sysconfigrW�	importlibr�__all__r!�
namedtupler%r
rrZ_SETUPTOOLS_VERSIONZ_PIP_VERSIONr0r*r3r/rArrFrrNrcrqrrrr�<module>sN�
�
��8

?>