U
    +|ju  ã                   @   sÆ  d 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Z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 ddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% ddl&m'Z'm(Z( ddl)m*Z* dd	l+m,Z, dd
l-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z:m;Z; ddl<m=Z=m>Z> ddl?m@Z@mAZA ddlBmCZCmDZDmEZEmFZF ddlGmHZHmIZImJZJmKZK ddlLmMZMmNZN e�rÎddlmOZO G dd„ deOƒZPe QeR¡ZSedeTƒZUe#eUeTe$eVeTf f ZWdDdd„ZXdd„ ZYdd„ ZZd d!„ Z[d"d#„ Z\d$d%„ Z]d&d'„ Z^d(d)„ Z_dEd*d+„Z`d,d-„ Zad.d/„ Zbd0d1„ ZcG d2d3„ d3ƒZdG d4d5„ d5ƒZeG d6d7„ d7e6ƒZfd8d9„ ZgG d:d;„ d;e,ƒZhdFd>d?„Ziejjd@dA„ ƒZkdGdBdC„ZldS )HzGSupport for installing and building the "wheel" binary package format.
é    N)Úurlsafe_b64encode)ÚMessage)ÚchainÚfilterfalseÚstarmap)ÚIOÚTYPE_CHECKINGÚAnyÚBinaryIOÚCallableÚDictÚIterableÚIteratorÚListÚNewTypeÚOptionalÚSequenceÚSetÚTupleÚUnionÚcast)ÚZipFileÚZipInfo)Úpkg_resources)ÚScriptMaker)Úget_export_entry)ÚDistribution)Ú
ensure_strÚensure_textÚreraise)ÚInstallationError)Úget_major_minor_version)ÚDIRECT_URL_METADATA_NAMEÚ	DirectUrl)ÚSCHEME_KEYSÚScheme)Úadjacent_tmp_fileÚreplace)Úcaptured_stdoutÚ
ensure_dirÚ	hash_fileÚ	partition)Úcurrent_umaskÚis_within_directoryÚ2set_extracted_file_to_default_mode_plus_executableÚzip_item_is_executable)Úparse_wheelÚ$pkg_resources_distribution_for_wheel)ÚProtocolc                   @   s    e Zd ZdZdZdZdd„ ZdS )ÚFileNc                 C   s   d S ©N© ©Úselfr5   r5   únC:\Users\snmko\Desktop\web_content\django_cbt\venv\Lib\site-packages\pip/_internal/operations/install/wheel.pyÚsaveB   s    z	File.save)Ú__name__Ú
__module__Ú__qualname__Úsrc_record_pathÚ	dest_pathÚchangedr9   r5   r5   r5   r8   r3   =   s   r3   Ú
RecordPathé   c                 C   s6   t | |ƒ\}}dt| ¡ ƒ d¡ d¡ }|t|ƒfS )z?Return (encoded_digest, length) for path using hashlib.sha256()zsha256=Úlatin1ú=)r*   r   ÚdigestÚdecodeÚrstripÚstr)ÚpathÚ	blocksizeÚhÚlengthrD   r5   r5   r8   ÚrehashM   s    ÿþþrL   c                 C   s   | dddœS )zPReturn keyword arguments to properly open a CSV file
    in the given mode.
    Ú úutf-8)ÚmodeÚnewlineÚencodingr5   )rO   r5   r5   r8   Úcsv_io_kwargsW   s    rR   c              	   C   s    t j | ¡st‚t| dƒ�R}| ¡ }| d¡s<W 5 Q R £ dS tj 	t 
¡ ¡}d| t j 	d¡ }| ¡ }W 5 Q R X t| dƒ�}| |¡ | |¡ W 5 Q R X dS )zQReplace #!python with #!/path/to/python
    Return True if file was changed.
    Úrbs   #!pythonFs   #!ÚasciiÚwbT)ÚosrH   ÚisfileÚAssertionErrorÚopenÚreadlineÚ
startswithÚsysÚ
executableÚencodeÚgetfilesystemencodingÚlinesepÚreadÚwrite)rH   ÚscriptÚ	firstlineÚexenameÚrestr5   r5   r8   Ú
fix_script_   s    

rg   c                 C   s   |   dd¡ ¡ dkS )NzRoot-Is-PurelibrM   Útrue)ÚgetÚlower)Úmetadatar5   r5   r8   Úwheel_root_is_purelibt   s    rl   c                    sz   z|   d¡}|   d¡}W n tk
r4   i i f Y S X dd„ ‰ t‡ fdd„| ¡ D ƒƒ}t‡ fdd„| ¡ D ƒƒ}||fS )NÚconsole_scriptsÚgui_scriptsc                 S   s&   t | ƒ dd¡ d¡}|d |d fS )z[get the string representation of EntryPoint,
        remove space and split on '='
        ú rM   rC   r   é   )rG   r'   Úsplit)ÚsÚsplit_partsr5   r5   r8   Ú	_split_ep„   s    z"get_entrypoints.<locals>._split_epc                 3   s   | ]}ˆ |ƒV  qd S r4   r5   ©Ú.0Úv©rt   r5   r8   Ú	<genexpr>�   s     z"get_entrypoints.<locals>.<genexpr>c                 3   s   | ]}ˆ |ƒV  qd S r4   r5   ru   rx   r5   r8   ry   Ž   s     )Úget_entry_mapÚKeyErrorÚdictÚvalues)ÚdistributionÚconsoleÚguir5   rx   r8   Úget_entrypointsy   s    
	r�   c                    s‚  | sdS t  t¡}| D ]*}tj |¡}tj |¡}||  |¡ qdd„ tj 	dd¡ 
tj¡D ƒ‰ ˆ  tj tj tj¡¡¡ ‡ fdd„| ¡ D ƒ}|sœdS g }| ¡ D ]b\}}t|ƒ}t|ƒdkrÔd	 |d
 ¡}	n$d d |dd… ¡d |d  ¡}	| d |	|¡¡ q¨d}
t|ƒdk�r0| |
 d¡¡ n| |
 d¡¡ tdd„ tj 	dd¡ 
tj¡D ƒƒ}|�rxd}| |¡ d |¡S )z�Determine if any scripts are not on PATH and format a warning.
    Returns a warning message if one or more scripts are not on PATH,
    otherwise None.
    Nc                 S   s    g | ]}t j |¡ t j¡‘qS r5   )rV   rH   ÚnormcaserF   Úsep©rv   Úir5   r5   r8   Ú
<listcomp>£   s    z5message_about_scripts_not_on_PATH.<locals>.<listcomp>ÚPATHrM   c                    s&   i | ]\}}t j |¡ˆ kr||“qS r5   )rV   rH   r‚   )rv   Ú
parent_dirÚscripts©Únot_warn_dirsr5   r8   Ú
<dictcomp>ª   s   ÿ z5message_about_scripts_not_on_PATH.<locals>.<dictcomp>rp   zscript {} isr   zscripts {} areú, éÿÿÿÿz and z.The {} installed in '{}' which is not on PATH.zeConsider adding {} to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.zthis directoryzthese directoriesc                 s   s   | ]}|r|d  dkV  qdS )r   ú~Nr5   r„   r5   r5   r8   ry   Ë   s     z4message_about_scripts_not_on_PATH.<locals>.<genexpr>ziNOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.Ú
)ÚcollectionsÚdefaultdictÚsetrV   rH   ÚdirnameÚbasenameÚaddÚenvironri   rq   ÚpathsepÚappendr‚   r\   r]   ÚitemsÚsortedÚlenÚformatÚjoinÚany)r‰   Úgrouped_by_dirÚdestfilerˆ   Úscript_nameÚwarn_forÚ	msg_linesÚdir_scriptsÚsorted_scriptsÚ
start_textÚlast_line_fmtÚwarn_for_tildeÚtilde_warning_msgr5   rŠ   r8   Ú!message_about_scripts_not_on_PATH’   sV    
þ
ÿÿ ÿÿÿÿÿ
r«   c                 C   s   t dd„ | D ƒƒS )aŸ  Normalize the given rows of a RECORD file.

    Items in each row are converted into str. Rows are then sorted to make
    the value more predictable for tests.

    Each row is a 3-tuple (path, hash, size) and corresponds to a record of
    a RECORD file (see PEP 376 and PEP 427 for details).  For the rows
    passed to this function, the size can be an integer as an int or string,
    or the empty string.
    c                 s   s*   | ]"\}}}t |d d�|t|ƒfV  qdS )rN   ©rQ   N)r   rG   )rv   Úrecord_pathÚhash_Úsizer5   r5   r8   ry   í   s   ÿz&_normalized_outrows.<locals>.<genexpr>)r›   )Úoutrowsr5   r5   r8   Ú_normalized_outrowsÙ   s    þr±   c                 C   s   | S r4   r5   )r­   r5   r5   r8   Ú_record_to_fs_pathó   s    r²   c                 C   sX   |d k	r>t j | ¡d  ¡ t j |¡d  ¡ kr>t j | |¡} |  t jjd¡} td| ƒS )Nr   ú/r@   )rV   rH   Ú
splitdriverj   Úrelpathr'   rƒ   r   )rH   Úrelative_tor5   r5   r8   Ú_fs_to_record_pathø   s    ÿr·   c                 C   s   t | dd�}td|ƒS )NrN   r¬   r@   )r   r   )Úrecord_columnÚpr5   r5   r8   Ú_parse_record_path  s    rº   c                 C   sê   g }| D ]Ž}t |ƒdkr$t d|¡ t|d ƒ}| ||¡}||krVtt|ƒƒ\}	}
n0t |ƒdkrj|d nd}	t |ƒdkr‚|d nd}
| ||	|
f¡ q|D ]*}t||ƒ}t|ƒ\}	}
| ||	|
f¡ qœ| 	¡ D ]}| |ddf¡ qÐ|S )z_
    :param installed: A map from archive RECORD path to installation RECORD
        path.
    é   z,RECORD line has more than three elements: %sr   rp   rM   é   )
rœ   ÚloggerÚwarningrº   ÚpoprL   r²   r™   r·   r}   )Úold_csv_rowsÚ	installedr?   Ú	generatedÚlib_dirÚinstalled_rowsÚrowÚold_record_pathÚnew_record_pathrD   rK   ÚfrH   Úinstalled_record_pathr5   r5   r8   Úget_csv_rows_for_installed
  s$    
rÊ   c                 C   s  |   ¡ } g }|  dd¡}|r”dtjkr4| d| ¡ tj dd¡dkr^| d tjd |¡¡ | dt	ƒ › d	|› �¡ d
d„ | D ƒ}|D ]
}| |= qˆ|  dd¡}|rîdtjkr¼| d| ¡ | d t	ƒ |¡¡ dd„ | D ƒ}|D ]
}| |= qâ| 
tdj|  ¡ ƒ¡ |S )zk
    Given the mapping from entrypoint name to callable, return the relevant
    console script specs.
    ÚpipNÚENSUREPIP_OPTIONSzpip = rM   Ú
altinstallz
pip{} = {}r   z = c                 S   s   g | ]}t  d |¡r|‘qS )zpip(\d(\.\d)?)?$©ÚreÚmatch©rv   Úkr5   r5   r8   r†   e  s      z,get_console_script_specs.<locals>.<listcomp>Úeasy_installzeasy_install = zeasy_install-{} = {}c                 S   s   g | ]}t  d |¡r|‘qS )zeasy_install(-\d\.\d)?$rÎ   rÑ   r5   r5   r8   r†   u  s     ú{} = {})Úcopyr¿   rV   r—   r™   ri   r�   r\   Úversion_infor!   Úextendr   rš   )r   Úscripts_to_generateÚ
pip_scriptÚpip_eprÒ   Úeasy_install_scriptÚeasy_install_epr5   r5   r8   Úget_console_script_specs+  sF    #
ÿÿ
ÿ ÿÿÿrÝ   c                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚZipBackedFilec                 C   s   || _ || _|| _d| _d S ©NF)r=   r>   Ú	_zip_filer?   )r7   r=   r>   Úzip_filer5   r5   r8   Ú__init__‚  s    zZipBackedFile.__init__c                 C   s   | j  | j¡S r4   )rà   Úgetinfor=   r6   r5   r5   r8   Ú_getinfo‰  s    zZipBackedFile._getinfoc              
   C   sŠ   t j | j¡}t|ƒ t j | j¡r0t  | j¡ |  ¡ }| j 	|¡�*}t	| jdƒ�}t
 ||¡ W 5 Q R X W 5 Q R X t|ƒr†t| jƒ d S )NrU   )rV   rH   r”   r>   r)   ÚexistsÚunlinkrä   rà   rY   ÚshutilÚcopyfileobjr/   r.   )r7   rˆ   ÚzipinforÈ   Údestr5   r5   r8   r9   �  s    
 zZipBackedFile.saveN)r:   r;   r<   râ   rä   r9   r5   r5   r5   r8   rÞ   �  s   rÞ   c                   @   s   e Zd Zdd„ Zdd„ ZdS )Ú
ScriptFilec                 C   s$   || _ | j j| _| j j| _d| _d S rß   )Ú_filer=   r>   r?   )r7   Úfiler5   r5   r8   râ   «  s    

zScriptFile.__init__c                 C   s   | j  ¡  t| jƒ| _d S r4   )rì   r9   rg   r>   r?   r6   r5   r5   r8   r9   ²  s    
zScriptFile.saveN)r:   r;   r<   râ   r9   r5   r5   r5   r8   rë   ª  s   rë   c                       s   e Zd Z‡ fdd„Z‡  ZS )ÚMissingCallableSuffixc                    s   t ƒ  d |¡¡ d S )Nz¢Invalid script entry point: {} - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.)Úsuperrâ   r�   )r7   Úentry_point©Ú	__class__r5   r8   râ   ¹  s
    ýÿzMissingCallableSuffix.__init__)r:   r;   r<   râ   Ú__classcell__r5   r5   rñ   r8   rî   ¸  s   rî   c                 C   s*   t | ƒ}|d k	r&|jd kr&tt|ƒƒ‚d S r4   )r   Úsuffixrî   rG   )ÚspecificationÚentryr5   r5   r8   Ú_raise_for_invalid_entrypointÃ  s    r÷   c                       s   e Zd Zd‡ fdd„	Z‡  ZS )ÚPipScriptMakerNc                    s   t |ƒ tƒ  ||¡S r4   )r÷   rï   Úmake)r7   rõ   Úoptionsrñ   r5   r8   rù   Ë  s    zPipScriptMaker.make)N)r:   r;   r<   rù   ró   r5   r5   rñ   r8   rø   Ê  s   rø   TFc           :   
      s  t ˆ| ƒ\}}	t|	ƒr|j‰n|j‰i ‰tƒ ‰g }
d.‡‡‡fdd„	}‡fdd„}dd„ }‡fdd	„‰ ‡ fd
d„}‡ ‡fdd„}dd„ }|ƒ }t||ƒ}t||ƒ\}}|ˆtˆt 	¡ d�ƒ}t
||ƒ}dd„ }t||ƒ\}}|ˆ|ƒ}t
||ƒ}t||ƒ}tˆ| ˆƒ}t|ƒ\‰‰‡‡fdd„}t
||ƒ}t||ƒ}t
t|ƒ}t||ƒ}|D ] }| ¡  ||j|j|jƒ �qJ‡‡fdd„} dd„ }!|�r4tƒ �’}"t ¡ �~ t d¡ | ƒ D ]f}#t|#t 	¡ d�}$tj|$ddd�}%|%�rª|!|#ƒ}&tj |&¡�sît‚td|& tjj d¡ƒ}'||'|&ƒ �qªW 5 Q R X W 5 Q R X t! "|" #¡ ¡ t$d|j%ƒ}(d|(_&dh|(_'d|(_(t)ˆƒ})t*t+d j,ˆ -¡ ƒƒ}*|( .|)¡}+|
 /|+¡ |
 /|( .|*d!di¡¡ |�r¼t0|+ƒ},|,dk	�r¼t! 1|,¡ d"t2ƒ  @ ‰t3j4‡fd#d$„ƒ}-tj 5ˆ|¡}.tj 5|.d%¡}/|-|/ƒ�}0|0 6d&¡ W 5 Q R X |
 7|/¡ |dk	�rhtj 5|.t8¡}1|-|1ƒ�}2|2 6| 9¡  :d'¡¡ W 5 Q R X |
 7|1¡ |�rœtj 5|.d(¡}3t;|3d)ƒ� W 5 Q R X |
 7|3¡ | <d*¡}4t*t= >|4 ?¡ ¡ƒ}5t@|5ˆˆ|
ˆd+�}6tj 5|.d*¡}7|-|7ftAd,ƒŽ�$}8t= Btd-|8ƒ¡}9|9 CtD|6ƒ¡ W 5 Q R X dS )/a�  Install a wheel.

    :param name: Name of the project to install
    :param wheel_zip: open ZipFile for wheel being installed
    :param scheme: Distutils scheme dictating the install directories
    :param req_description: String used in place of the requirement, for
        logging
    :param pycompile: Whether to byte-compile installed Python files
    :param warn_script_location: Whether to check that scripts are installed
        into a directory on PATH
    :raises UnsupportedWheel:
        * when the directory holds an unpacked wheel with incompatible
          Wheel-Version
        * when the .dist-info dir does not match the wheel
    Fc                    s(   t |ˆƒ}|ˆ| < |r$ˆ  t |ƒ¡ dS )z6Map archive RECORD paths to installation RECORD paths.N)r·   r–   )Úsrcfiler¡   ÚmodifiedÚnewpath)r?   rÁ   rÃ   r5   r8   Úrecord_installedú  s    
z(_install_wheel.<locals>.record_installedc                  3   s,   ˆ   ¡ } tt| ƒ}|D ]}td|ƒV  qd S )Nr@   )ÚnamelistÚmapr   r   )ÚnamesÚdecoded_namesÚname)Ú	wheel_zipr5   r8   Ú	all_paths  s    
z!_install_wheel.<locals>.all_pathsc                 S   s
   |   d¡S )Nr³   )Úendswith©rH   r5   r5   r8   Úis_dir_path  s    z#_install_wheel.<locals>.is_dir_pathc                    s$   t | |ƒs d}t| ˆ || ¡ƒ‚d S )NzRThe wheel {!r} has a file {!r} trying to install outside the target directory {!r})r-   r    r�   )Údest_dir_pathÚtarget_pathÚmessage)Ú
wheel_pathr5   r8   Úassert_no_path_traversal  s    
ÿÿz0_install_wheel.<locals>.assert_no_path_traversalc                    s   ‡‡ ‡fdd„}|S )Nc                    s0   t j | ¡}t j ˆ|¡}ˆ ˆ|ƒ t| |ˆƒS r4   )rV   rH   Únormpathrž   rÞ   )r­   Únormed_pathr>   )r  rê   rá   r5   r8   Úmake_root_scheme_file  s    
zM_install_wheel.<locals>.root_scheme_file_maker.<locals>.make_root_scheme_filer5   )rá   rê   r  )r  )rê   rá   r8   Úroot_scheme_file_maker  s    z._install_wheel.<locals>.root_scheme_file_makerc                    sF   i ‰ t D ]&}t|ƒ}tt||ƒt ¡ d�ˆ |< q‡‡ ‡‡fdd„}|S )Nr¬   c           	   	      s¼   t j | ¡}z| t jjd¡\}}}W n( tk
rN   d ˆ| ¡}t|ƒ‚Y nX zˆ| }W n: tk
r–   d 	t
ˆƒ¡}d ˆ|| |¡}t|ƒ‚Y nX t j 	||¡}ˆ ||ƒ t| |ˆƒS )Nr¼   zbUnexpected file in {}: {!r}. .data directory contents should be named like: '<scheme key>/<path>'.r�   zŠUnknown scheme key used in {}: {} (for file {!r}). .data directory contents should be in subdirectories named with a valid scheme key ({}))rV   rH   r  rq   rƒ   Ú
ValueErrorr�   r    r{   rž   r›   rÞ   )	r­   r  Ú_Ú
scheme_keyÚdest_subpathr  Úscheme_pathÚvalid_scheme_keysr>   )r  Úscheme_pathsr  rá   r5   r8   Úmake_data_scheme_file.  s2    ÿ ýÿ   û
zM_install_wheel.<locals>.data_scheme_file_maker.<locals>.make_data_scheme_file)r$   r   Úgetattrr\   r_   )rá   ÚschemeÚkeyÚencoded_keyr  )r  r  )r  rá   r8   Údata_scheme_file_maker%  s     ÿz._install_wheel.<locals>.data_scheme_file_makerc                 S   s   |   dd¡d  d¡S )Nr³   rp   r   ú.data)rq   r  r  r5   r5   r8   Úis_data_scheme_pathM  s    z+_install_wheel.<locals>.is_data_scheme_pathr¬   c                 S   s2   |   dd¡}t|ƒdko0|d  d¡o0|d dkS )Nr³   r¼   r   r  rp   r‰   )rq   rœ   r  )rH   Úpartsr5   r5   r8   Úis_script_scheme_path]  s    ÿ
ýz-_install_wheel.<locals>.is_script_scheme_pathc                    sz   | j }tj |¡}| ¡  d¡r.|d d… }n<| ¡  d¡rJ|d d… }n | ¡  d¡rf|d d… }n|}|ˆ kpx|ˆkS )Nz.exeéüÿÿÿz
-script.pyiöÿÿÿz.pya)r>   rV   rH   r•   rj   r  )rí   rH   r  Ú	matchname)r   r€   r5   r8   Úis_entrypoint_wrappert  s    z-_install_wheel.<locals>.is_entrypoint_wrapperc                  3   sH   t tˆ  ¡ ƒƒD ]2} tj ˆ| ¡}tj |¡s0q| d¡s<q|V  qd S )Nz.py)r›   r“   r}   rV   rH   rž   rW   r  )Úinstalled_pathÚfull_installed_path)rÁ   rÃ   r5   r8   Úpyc_source_file_paths�  s    
z-_install_wheel.<locals>.pyc_source_file_pathsc                 S   s   t j | ¡S )zAReturn the path the pyc file would have been written to.
        )Ú	importlibÚutilÚcache_from_sourcer  r5   r5   r8   Úpyc_output_pathž  s    z'_install_wheel.<locals>.pyc_output_pathÚignoreT)ÚforceÚquietr@   r³   NrM   rÔ   r€   i¶  c              	   ;   s<   t | f|Ž�}|V  W 5 Q R X t |jˆ ¡ t|j| ƒ d S r4   )r&   rV   Úchmodr  r'   )rH   ÚkwargsrÈ   )Úgenerated_file_moder5   r8   Ú_generate_fileÞ  s    z&_install_wheel.<locals>._generate_fileÚ	INSTALLERs   pip
rN   Ú	REQUESTEDrU   ÚRECORD)rÁ   r?   rÂ   rÃ   ÚwzIO[str])F)Er0   rl   ÚpurelibÚplatlibr“   r   r+   r   r\   r_   r   r   r1   r�   rë   r9   r=   r>   r?   r(   ÚwarningsÚcatch_warningsÚfilterwarningsr   Ú
compileallÚcompile_filerV   rH   rå   rX   r   r'   rƒ   r½   ÚdebugÚgetvaluerø   r‰   ÚclobberÚvariantsÚset_moderÝ   Úlistr   r�   rš   Úmake_multipler×   r«   r¾   r,   Ú
contextlibÚcontextmanagerrž   rb   r™   r"   Úto_jsonr^   rY   Úget_metadataÚcsvÚreaderÚ
splitlinesrÊ   rR   ÚwriterÚ	writerowsr±   ):r  r  r  r  Ú	pycompileÚwarn_script_locationÚ
direct_urlÚ	requestedÚinfo_dirrk   rÂ   rþ   r  r  r  r  r   ÚpathsÚ
file_pathsÚroot_scheme_pathsÚdata_scheme_pathsr  Úfilesr"  Úother_scheme_pathsÚscript_scheme_pathsr  Úother_scheme_filesr~   r%  Úscript_scheme_filesrí   r(  r,  ÚstdoutrH   Úpath_argÚsuccessÚpyc_pathÚpyc_record_pathÚmakerrØ   Úgui_scripts_to_generateÚgenerated_console_scriptsÚmsgr3  Údest_info_dirÚinstaller_pathÚinstaller_fileÚdirect_url_pathÚdirect_url_fileÚrequested_pathÚrecord_textÚrecord_rowsÚrowsr­   Úrecord_filerM  r5   )	r  r?   r   r2  r€   rÁ   rÃ   r  r  r8   Ú_install_wheelÑ  sò    	(
 ÿþ
	 ÿ


  ÿ
 ÿ




 ÿ  ÿ ÿ"

ÿ









ûrp  c              
   c   s\   z
d V  W nL t k
rV } z.d | |jd ¡}tt t |ƒt ¡ d ƒ W 5 d }~X Y nX d S )NzFor req: {}. {}r   r¼   )r    r�   Úargsr   r\   Úexc_info)Úreq_descriptionÚer  r5   r5   r8   Úreq_error_context  s    
  
ÿru  c           	      C   sH   t |dd��2}t|ƒ� t| |||||||d� W 5 Q R X W 5 Q R X d S )NT)Ú
allowZip64)r  r  r  r  rO  rP  rQ  rR  )r   ru  rp  )	r  r  r  rs  rO  rP  rQ  rR  Úzr5   r5   r8   Úinstall_wheel  s    
ørx  )rA   )N)TTNF)TTNF)mÚ__doc__r‘   r=  rF  rJ  r)  ÚloggingÚos.pathrV   rÏ   rç   r\   r:  Úbase64r   Úemail.messager   Ú	itertoolsr   r   r   Útypingr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   Úzipfiler   r   Úpip._vendorr   Úpip._vendor.distlib.scriptsr   Zpip._vendor.distlib.utilr   Úpip._vendor.pkg_resourcesr   Zpip._vendor.sixr   r   r   Úpip._internal.exceptionsr    Úpip._internal.locationsr!   Úpip._internal.models.direct_urlr"   r#   Úpip._internal.models.schemer$   r%   Úpip._internal.utils.filesystemr&   r'   Úpip._internal.utils.miscr(   r)   r*   r+   Úpip._internal.utils.unpackingr,   r-   r.   r/   Úpip._internal.utils.wheelr0   r1   r2   r3   Ú	getLoggerr:   r½   rG   r@   ÚintÚInstalledCSVRowrL   rR   rg   rl   r�   r«   r±   r²   r·   rº   rÊ   rÝ   rÞ   rë   rî   r÷   rø   rp  rG  ru  rx  r5   r5   r5   r8   Ú<module>   s„   H




G
!V)    ø
  B
    ø