o
    h                     @   s  d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm	Z	m
Z
mZmZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dl m!Z! d dl"m#Z# d dl$m%Z% e&e'Z(de)de	ddfddZ*d+ddZ+de
e)e)f fddZ,de)defddZ-de)dee) fddZ.de
e)e)f ddfdd Z/d+d!d"Z0d#eddfd$d%Z1d&ede)fd'd(Z2G d)d* d*eZ3dS ),    N)Values)
ModuleType)AnyDictListOptional)where)parse)__file__)
cmdoptions)Command)make_target_python)SUCCESS)Configuration)get_environment)
indent_log)get_pip_versionnamevaluereturnc                 C   s   t d| | d S )Nz%s: %s)loggerinfo)r   r    r   X/var/www/html/olx_land/venv/lib/python3.10/site-packages/pip/_internal/commands/debug.py
show_value   s   r   c                  C   sH   t d tjj} t  td|  W d    d S 1 sw   Y  d S )Nzsys.implementation:r   )r   r   sysimplementationr   r   r   )implementation_namer   r   r   show_sys_implementation   s
   
"r   c                  C   sd   t jt jtdd} t| }dd | D }W d    n1 s$w   Y  tdd |D S )N_vendorz
vendor.txtc                 S   s(   g | ]}d |v r|  ddd qS )==    r   )stripsplit.0liner   r   r   
<listcomp>-   s    "z)create_vendor_txt_map.<locals>.<listcomp>c                 s   s    | ]	}| d dV  qdS )r    r"   N)r$   r%   r   r   r   	<genexpr>2   s    z(create_vendor_txt_map.<locals>.<genexpr>)ospathjoindirnamepip_locationopen	readlinesdict)vendor_txt_pathflinesr   r   r   create_vendor_txt_map%   s   
r5   module_namec                 C   s:   |   } | dkr
d} td|  t t dd ttj| S )N
setuptoolspkg_resourceszpip._vendor.r   )level)lower
__import__globalslocalsgetattrpipr   )r6   r   r   r   get_module_from_module_name5   s
   r@   c                 C   sH   t | }t|dd }|s"ttj|jg}|| }|r"t|j	}|S )N__version__)
r@   r>   r   r*   r+   r-   r
   get_distributionstrversion)r6   modulerD   envdistr   r   r   get_vendor_version_from_module@   s   

rH   vendor_txt_versionsc                 C   sZ   |   D ]&\}}d}t|}|sd}|}nt|t|kr"d|}td||| qdS )z{Log the actual version and print extra info if there is
    a conflict or if the actual version could not be imported.
     zM (Unable to locate actual module version, using vendor.txt specified version)z5 (CONFLICT: vendor.txt suggests version should be {})z%s==%s%sN)itemsrH   parse_versionformatr   r   )rI   r6   expected_versionextra_messageactual_versionr   r   r   show_actual_vendor_versionsN   s   rQ   c                  C   sD   t d t } t  t|  W d    d S 1 sw   Y  d S )Nzvendored library versions:)r   r   r5   r   rQ   )rI   r   r   r   show_vendor_versionsc   s
   

"rR   optionsc           	      C   s   d}t | }| }| }d}|rd| d}dt||}t| | jdk r9t||kr9d}|d | }nd}t * |D ]	}tt	| qA|r`d	j|d
}t| W d    d S W d    d S 1 skw   Y  d S )N
   rJ   z
 (target: )zCompatible tags: {}{}r"   TFz?...
[First {tag_limit} tags shown. Pass --verbose to show all.])	tag_limit)
r   get_tagsformat_givenrM   lenr   r   verboser   rC   )	rS   rV   target_pythontagsformatted_targetsuffixmsgtags_limitedtagr   r   r   	show_tagsk   s0   
"rb   configc                    sr   t  }|  D ]\}}||dd  q|sdS g d  fdd|D }|s+dS d|v r4|d d|S )	N.r   zNot specified)installwheeldownloadc                    s   g | ]}| v r|qS r   r   )r&   r9   levels_that_override_globalr   r   r(      s    z"ca_bundle_info.<locals>.<listcomp>globalz, )setrK   addr$   remover,   )rc   levelskey_global_overriding_levelr   rh   r   ca_bundle_info   s   


rr   c                   @   s<   e Zd ZdZdZdZdddZded	ee	 de
fd
dZdS )DebugCommandz$
    Display debug information.
    z
      %prog <options>Tr   Nc                 C   s,   t | j | jd| j | jj  d S )Nr   )r   add_target_python_optionscmd_optsparserinsert_option_grouprc   load)selfr   r   r   add_options   s   zDebugCommand.add_optionsrS   argsc                 C   s   t d tdt  tdtj tdtj tdt  tdt  tdt	
  tdtj t  td	t| jj td
tjd
 tdtjd tdt  tdtjj t  t| tS )NzThis command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.zpip versionzsys.versionzsys.executablezsys.getdefaultencodingzsys.getfilesystemencodingzlocale.getpreferredencodingzsys.platformz'cert' config valueREQUESTS_CA_BUNDLECURL_CA_BUNDLEzpip._vendor.certifi.where()zpip._vendor.DEBUNDLED)r   warningr   r   r   rD   
executablegetdefaultencodinggetfilesystemencodinglocalegetpreferredencodingplatformr   rr   rv   rc   r*   environgetr   r?   r   	DEBUNDLEDrR   rb   r   )ry   rS   r{   r   r   r   run   s,   zDebugCommand.runr   N)__name__
__module____qualname____doc__usageignore_require_venvrz   r   r   rC   intr   r   r   r   r   rs      s    
rs   r   )4r   loggingr*   r   optparser   typesr   typingr   r   r   r   pip._vendorr?   pip._vendor.certifir   pip._vendor.packaging.versionr	   rL   r
   r.   pip._internal.clir   pip._internal.cli.base_commandr   pip._internal.cli.cmdoptionsr   pip._internal.cli.status_codesr   pip._internal.configurationr   pip._internal.metadatar   pip._internal.utils.loggingr   pip._internal.utils.miscr   	getLoggerr   r   rC   r   r   r5   r@   rH   rQ   rR   rb   rr   rs   r   r   r   r   <module>   s<    


 