
    ;e%                        d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ ddgZ	dZ
dZdZded	fd
ed	fgZ e j        dd          Z ej        d          ad Zd ZdaddZd Zd Zdddddd ddZdddddd ddZd ddZddZdS )    N)	resourcesversion	bootstrap)
setuptoolspipz65.5.0z23.2.1r   py3r   Package)r   
wheel_name
wheel_pathWHEEL_PKG_DIRc                    i }	 t          j        |           }n# t          $ r d}Y nw xY wt          |          }|D ]}|                    d          st
          D ]}|dz   }|                    |          r n?|                    |                              d          d         }t           j	        
                    | |          }t          |d |          ||<   |S )N z.whl-r   )oslistdirOSErrorsortedendswith_PACKAGE_NAMES
startswithremoveprefix	partitionpathjoin_Package)r   packages	filenamesfilenamenameprefixr   r   s           )/usr/lib/python3.11/ensurepip/__init__.py_find_packagesr"       s   HJt$$		   			 y!!I = =  (( 	" 	 	DCZF""6**   ''//99#>>qAW\\$11
!'4<<Os    ((c                      t           t           S i } t          D ]%\  }}}| d| d| d}t          ||d           | |<   &t          r6t	          t                    t          fdt          D                       r} | a | S )Nr   z-none-any.whlc              3       K   | ]}|v V  	d S Nr   ).0r   dir_packagess     r!   	<genexpr>z _get_packages.<locals>.<genexpr>I   s(      ??t|#??????    )	_PACKAGES	_PROJECTSr   _WHEEL_PKG_DIRr"   allr   )r   r   r   py_tagr
   r'   s        @r!   _get_packagesr/   =   s    H!* = =gv>>w>>>>>
!':t<< $%n55????????? 	$#HIOr)   c                     d|pg  d|  d}t           j        ddd|g}t           j        j        r|                    dd           t          j        |d	
          j        S )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-Wzignore::DeprecationWarningz-c   z-IT)check)sys
executableflagsisolatedinsert
subprocessrun
returncode)argsadditional_pathscodecmds       r!   _run_pipr?   P   s    
 "  	  D 	$C y 

1d>#T***55r)   c                  6    	 t                      d         j        S )Nr   )r/   r   r   r)   r!   r   r   j   s     ??5!))r)   c                      d t           j        D             } | D ]}t           j        |= t           j        t           j        d<   d S )Nc                 <    g | ]}|                     d           |S )PIP_)r   )r&   ks     r!   
<listcomp>z7_disable_pip_configuration_settings.<locals>.<listcomp>u   s)    DDDAq||F/C/CDaDDDr)   PIP_CONFIG_FILE)r   environdevnull)keys_to_removerD   s     r!   #_disable_pip_configuration_settingsrJ   q   sK     EDDDDN  JqMM %'JBJ !!!r)   Frootupgradeuser
altinstalldefault_pip	verbosityc                 2    	 t          | |||||           d S )NrK   )
_bootstraprK   s         r!   r   r   }   s8     D'$+"$ $ $ $ $ $r)   c                    	 |r|rt          d          t          j        d|            t                       |rdt          j        d<   n|sdt          j        d<   t          j                    5 }g }t                      	                                D ]\  }}	|	j
        r6|	j
        }
t          j        d          dz  |
z  }|                                }net          |	j        d          5 }|                                }d d d            n# 1 swxY w Y   t          j                            |	j                  }
t          j                            ||
          }t          |d	          5 }|                    |           d d d            n# 1 swxY w Y   |                    |           dd
dd|g}| r|d| gz  }|r|dgz  }|r|dgz  }|r|dd|z  z   gz  }t-          g |t.          |          cd d d            S # 1 swxY w Y   d S )Nz.Cannot use altinstall and default_pip togetherzensurepip.bootstraprO   ENSUREPIP_OPTIONSinstall	ensurepip_bundledrbwbz--no-cache-dirz
--no-indexz--find-links--root	--upgrade--userr   v)
ValueErrorr3   auditrJ   r   rG   tempfileTemporaryDirectoryr/   itemsr
   r   files
read_bytesopenr   readr   basenamer   writeappendr?   r   )rL   rM   rN   rO   rP   rQ   tmpdirr<   r   packager
   r   whlfpr   r;   s                   r!   rS   rS      s     Kk KIJJJI#T***')))  4*6
&'' 4*3
&'		$	&	& !D& *__2244 	. 	.MD'! 	B$/
&_[99JFS
 ++-- ',d33 $r''))C$ $ $ $ $ $ $ $ $ $ $ $ $ $ $W--g.@AA
w||FJ77Hh%%                ##H---- +\>6R 	%Xt$$D 	"[M!D 	XJD 	,S3?*++D0$002BCCC!D !D !D !D !D !D !D !D !D !D !D !D !D !D !D !D !D !Ds]   .A;H )D
>H 
DH DAH )F?H FH FA H  HH)rQ   c                 @   	 	 dd l }n# t          $ r Y d S w xY wt                      }|j        |k    r)t	          d|j        d|dt
          j                   d S t                       g d}| r|dd| z  z   gz  }t          g |t          t                              S )	Nr   z2ensurepip will only uninstall a matching version (z installed, z available))file)	uninstallz-yz--disable-pip-version-checkr   r^   )r   ImportErrorr   __version__printr3   stderrrJ   r?   reversedr   )rQ   r   available_versionr;   s       r!   _uninstall_helperrx      s    




   
  		
+++ 2/2 2"2 2 2 :	 	 	 	 	'))) >==D (sY&''6d6Xn556777s    
c                 f   dd l }|                    d          }|                    ddd                    t	                                d           |                    d	d
dddd           |                    ddddd           |                    dddd           |                    dd d           |                    dddd           |                    dddd           |                    |           }t          |j        |j        |j	        |j
        |j        |j                  S )Nr   zpython -m ensurepip)progz	--versionr   zpip {}z9Show the version of pip that is bundled with this Python.)actionr   helpz-vz	--verbosecountrQ   zDGive more output. Option is additive, and can be used up to 3 times.)r{   defaultdestr|   z-Ur\   
store_trueFz8Upgrade pip and dependencies, even if already installed.)r{   r~   r|   r]   zInstall using the user scheme.r[   z=Install everything relative to this alternate root directory.)r~   r|   z--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.)rL   rM   rN   rQ   rO   rP   )argparseArgumentParseradd_argumentformatr   
parse_argsrS   rL   rM   rN   rQ   rO   rP   )argvr   parserr;   s       r!   _mainr      s   OOO$$*?$@@F
		**H	     k     kG	     -	     L    
 C	     G	     T""DYY.?$   r)   r%   )collectionsr   os.pathr8   r3   	sysconfigra   	importlibr   __all__r   _SETUPTOOLS_VERSION_PIP_VERSIONr+   
namedtupler   get_config_varr,   r"   r/   r*   r?   r   rJ   r   rS   rx   r   r   r)   r!   <module>r      s       				      



            k
"& &.
L% 	 ";!)"IK K *)/::  :    	6 6 6 64* * *	/ 	/ 	/ EE$ $ $ $ $ UE>D >D >D >D >D@ $% 8 8 8 8 8>: : : : : :r)   