ó
    Þ j^$  ã                   ó–  • % S SK r S SKrS SKrS SKrS SKrS SKrS SKJrJ	r	  S SK
Jr  S SKJrJrJrJrJrJrJrJr  S SKJrJr  \R0                  " \5      r\" SSS9r\" S	S
SS9rSq\\   \S'   \	S\S   4S j5       r " S S5      r Sq!\\    \S'   \	S\\ SS4   4S j5       r" " S S5      r#\#" 5       r$ " S S5      r% " S S\%5      r&g)é    N)Ú	ExitStackÚcontextmanager)ÚPath)ÚAnyÚCallableÚDictÚ	GeneratorÚListÚOptionalÚTypeVarÚUnion)ÚenumÚrmtreeÚ_TÚTempDirectory)Úboundz	build-envzephem-wheel-cachez	req-build)Ú	BUILD_ENVÚEPHEM_WHEEL_CACHEÚ	REQ_BUILDÚ_tempdir_managerÚreturn)NNNc               #   ó„   #   • [        5        n [        U snq S v •  Uq S S S 5        g ! Uqf = f! , (       d  f       g = f7f©N)r   r   )ÚstackÚold_tempdir_managers     ÚV/var/www/html/gaurav/venv/lib/python3.13/site-packages/pip/_internal/utils/temp_dir.pyÚglobal_tempdir_managerr   '   sB   é € ô 
Œ˜Ü0@À%Ð-ÐÐ-ð	3Ûà2Ñ÷ 
ˆøð
  3Ñú÷ 
�üs'   ‚A �
/˜(œ/Ÿ	A ¨,¬/¯
=¹A c                   óJ   • \ rS rSrSrSS jrS\S\SS4S jrS\S\4S	 jr	S
r
g)ÚTempDirectoryTypeRegistryé2   zManages temp directory behaviorr   Nc                 ó   • 0 U l         g r   ©Ú_should_delete©Úselfs    r   Ú__init__Ú"TempDirectoryTypeRegistry.__init__5   s
   € Ø/1ˆÕó    ÚkindÚvaluec                 ó    • X R                   U'   g)zKIndicate whether a TempDirectory of the given kind should be
auto-deleted.
Nr"   )r%   r)   r*   s      r   Ú
set_deleteÚ$TempDirectoryTypeRegistry.set_delete8   s   € ð %*×Ñ˜DÒ!r(   c                 ó:   • U R                   R                  US5      $ )zNGet configured auto-delete flag for a given TempDirectory type,
default True.
T)r#   Úget)r%   r)   s     r   Ú
get_deleteÚ$TempDirectoryTypeRegistry.get_delete>   s   € ð ×"Ñ"×&Ñ& t¨TÓ2Ð2r(   r"   ©r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r&   ÚstrÚboolr,   r0   Ú__static_attributes__© r(   r   r   r   2   s7   † Ù)ô2ð*˜sð *¨4ð *°Dô *ð3˜sð 3 t÷ 3r(   r   Ú_tempdir_registryc               #   óP   #   • [         n [        5       q  [         v •  U q g! U q f = f7f)zmProvides a scoped global tempdir registry that can be used to dictate
whether directories should be deleted.
N)r<   r   )Úold_tempdir_registrys    r   Útempdir_registryr?   H   s.   é € ô -ÐÜ1Ó3Ðð1ÜÒà0ÑøÐ0Ñüs   ‚&” œ&Ÿ#£&c                   ó   • \ rS rSrSrg)Ú_DefaultéV   r;   N)r3   r4   r5   r6   r:   r;   r(   r   rA   rA   V   s   † Úr(   rA   c                   óÒ   ^ • \ rS rSrSrS\SSS4S\\   S\\	S\
4   S	\S
\	S\	4
U 4S jjjr\S\4S j5       rS\4S jrS\S\4S jrS\S\S\SS4S jrS	\S\4S jrSS jrSrU =r$ )r   é]   a  Helper class that owns and cleans up a temporary directory.

This class can be used as a context manager or as an OO representation of a
temporary directory.

Attributes:
    path
        Location to the created temporary directory
    delete
        Whether the directory should be deleted when exiting
        (when used as a contextmanager)

Methods:
    cleanup()
        Deletes the temporary directory

When used as a context manager, if the delete attribute is True, on
exiting the context the temporary directory is deleted.
NÚtempFTÚpathÚdeleter)   Úglobally_managedÚignore_cleanup_errorsc                 óö   >• [         TU ]  5         U[        L a  Ub  SnOS nUc  U R                  U5      nXl        SU l        X l        X0l        XPl        U(       a  [        c   e[        R                  U 5        g g )NF)Úsuperr&   Ú_defaultÚ_createÚ_pathÚ_deletedrG   r)   rI   r   Úenter_context)r%   rF   rG   r)   rH   rI   Ú	__class__s         €r   r&   ÚTempDirectory.__init__r   s   ø€ ô 	‰ÑÔà”XÒØÑð ‘ð �ð ‰<Ø—<‘< Ó%ˆDàŒ
ØˆŒØŒØŒ	Ø%:Ô"æÜ#Ñ/Ð/Ð/Ü×*Ñ*¨4Õ0ð r(   r   c                 ód   • U R                   (       a   SU R                   35       eU R                  $ )Nz"Attempted to access deleted path: )rO   rN   r$   s    r   rF   ÚTempDirectory.path•   s*   € à—=—=ÐSÐ$FÀtÇzÁzÀlÐ"SÓSÐ Ø�z‰zÐr(   c                 óR   • SU R                   R                   SU R                  < S3$ )NÚ<Ú Ú>)rQ   r3   rF   r$   s    r   Ú__repr__ÚTempDirectory.__repr__š   s&   € Ø�4—>‘>×*Ñ*Ð+¨1¨T¯Y©Y©M¸Ð;Ð;r(   r%   c                 ó   • U $ r   r;   r$   s    r   Ú	__enter__ÚTempDirectory.__enter__�   s   € Øˆr(   Úexcr*   Útbc                 óÂ   • U R                   b  U R                   nO-[        (       a   [        R                  U R                  5      nOSnU(       a  U R	                  5         g g )NT)rG   r<   r0   r)   Úcleanup)r%   r^   r*   r_   rG   s        r   Ú__exit__ÚTempDirectory.__exit__    sE   € Ø�;‰;Ñ"Ø—[‘[‰FßÒÜ&×1Ñ1°$·)±)Ó<‰FàˆFæØ�L‰L�Nð r(   c                 óœ   • [         R                  R                  [        R                  " SU S3S95      n[
        R                  SU5        U$ )z<Create a temporary directory and store its path in self.pathúpip-Ú-©ÚprefixúCreated temporary directory: %s)ÚosrF   ÚrealpathÚtempfileÚmkdtempÚloggerÚdebug)r%   r)   rF   s      r   rM   ÚTempDirectory._create«   s?   € ô �w‰w×Ñ¤× 0Ò 0¸$¸t¸fÀA¸Ñ GÓHˆÜ�‰Ð6¸Ô=Øˆr(   c                 óÐ  ^• SU l         [        R                  R                  U R                  5      (       d  g/ mS[
        S[        4   S[        S[        SS4U4S jjnU R                  (       a>   [        U R                  S	S
9  T(       a!  [        R                  SU R                  5        gg[        U R                  5        g! [         a    [        U R                  US9   N_f = f)z6Remove the temporary directory created and reset stateTNÚfunc.rF   Úexc_valr   c                 ó~  >• SR                  [        R                  " [        U5      U5      5      nUR	                  5       nU [
        R                  [
        R                  [
        R                  4;   a  [        R                  SUU5        O![        R                  SU R                  U5        TR                  U5        g)z/Log a warning for a `rmtree` error and continueÚ
z2Failed to remove a temporary file '%s' due to %s.
z%s failed with %s.N)ÚjoinÚ	tracebackÚformat_exception_onlyÚtypeÚrstriprj   ÚunlinkÚremoveÚrmdirrn   ro   r5   Úappend)rr   rF   rs   Úformatted_excÚerrorss       €r   ÚonerrorÚ&TempDirectory.cleanup.<locals>.onerror½   sŒ   ø€ ð !ŸI™IÜ×/Ò/´°W³¸wÓGóˆMð *×0Ñ0Ó2ˆMØœŸ	™	¤2§9¡9¬b¯h©hÐ7Ó7Ü—‘ØIØØ!õô —‘Ð1°4×3DÑ3DÀmÔTØ�M‰M˜'Õ"r(   F)Úignore_errors)Úonexcz[Failed to remove contents in a temporary directory '%s'.
You can safely remove it manually.)rO   rj   rF   ÚexistsrN   r   r   r   ÚBaseExceptionrI   r   ÚOSErrorrn   Úwarning)r%   r�   r€   s     @r   ra   ÚTempDirectory.cleanupµ   sÈ   ø€ àˆŒÜ�w‰w�~‰~˜dŸj™j×)Ñ)Øà&(ˆð	#Ü˜3¤˜8Ñ$ð	#äð	#ô #ð	#ð ÷		#ð( ×%×%ð2ä�t—z‘z°Ò7ö Ü—‘ð9à—J‘Jõð ô �4—:‘:Õøô ó 2ä�t—z‘z¨Ô1ð2ús   Á1C ÃC%Ã$C%)rO   rN   rG   rI   r)   r2   )r3   r4   r5   r6   r7   rL   r   r8   r   r9   rA   r&   ÚpropertyrF   rY   r   r\   r   rb   rM   ra   r:   Ú__classcell__©rQ   s   @r   r   r   ]   sÜ   ø† ñð, #Ø.6ØØ!&Ø&*ñ!1à�s‰mð!1ð �d˜D (Ð*Ñ+ð!1ð ð	!1ð
 ð!1ð  $÷!1ð !1ðF ð�có ó ðð<˜#ô <ð˜ð ˜rô ð	˜Cð 	¨ð 	°ð 	¸ô 	ð˜Cð  Cô ÷*ò *r(   c                   ó„   ^ • \ rS rSrSrSrSS\S\\   SS4U 4S jjjr	\
S	\S\\SS4   4S
 j5       rS\S\4S jrSrU =r$ )ÚAdjacentTempDirectoryéâ   a‚  Helper class that creates a temporary directory adjacent to a real one.

Attributes:
    original
        The original directory to create a temp directory for.
    path
        After calling create() or entering, contains the full
        path to the temporary directory.
    delete
        Whether the directory should be deleted when exiting
        (when used as a contextmanager)

z-~.=%0123456789NÚoriginalrG   r   c                 óL   >• UR                  S5      U l        [        TU ]  US9  g )Nz/\)rG   )rz   r�   rK   r&   )r%   r�   rG   rQ   s      €r   r&   ÚAdjacentTempDirectory.__init__ø   s#   ø€ Ø Ÿ™¨Ó.ˆŒÜ‰Ñ ÐÒ'r(   Únamec              #   óÀ  #   • [        S[        U5      5       HR  n[        R                  " U R                  US-
  5       H'  nSSR                  U5      -   XS -   nXA:w  d  M#  Uv •  M)     MT     [        [        U R                  5      5       HM  n[        R                  " U R                  U5       H%  nSSR                  U5      -   U-   nXA:w  d  M!  Uv •  M'     MO     g7f)zäGenerates a series of temporary names.

The algorithm replaces the leading characters in the name
with ones that are valid filesystem characters, but are not
valid package names (for both Python and pip definitions of
package).
é   Ú~Ú N)ÚrangeÚlenÚ	itertoolsÚcombinations_with_replacementÚLEADING_CHARSrv   )Úclsr“   ÚiÚ	candidateÚnew_names        r   Ú_generate_namesÚ%AdjacentTempDirectory._generate_namesü   sÊ   é € ô �qœ#˜d›)Ö$ˆAÜ&×DÒDØ×!Ñ! 1 q¡5ö�	ð  §¡¨Ó!3Ñ3°d¸2°hÑ>�ØÕ#Ø"”Nóñ %ô ”s˜3×,Ñ,Ó-Ö.ˆAÜ&×DÒDØ×!Ñ! 1ö�	ð  §¡¨Ó!3Ñ3°dÑ:�ØÕ#Ø"”Nóò /ùs   ‚ACÁ"A+CÃCr)   c                 ó:  • [         R                  R                  U R                  5      u  p#U R	                  U5       HX  n[         R                  R                  X$5      n [         R                  " U5        [         R                  R                  U5      n  O7   [         R                  R                  [        R                  " SU S3S95      n[        R                  SU5        U$ ! [         a*  nUR                  [        R                  :w  a  e  S nAMØ  S nAff = f)Nre   rf   rg   ri   )rj   rF   Úsplitr�   r¡   rv   Úmkdirrk   r‡   ÚerrnoÚEEXISTrl   rm   rn   ro   )r%   r)   Úrootr“   rŸ   rF   Úexs          r   rM   ÚAdjacentTempDirectory._create  sÑ   € Ü—W‘W—]‘] 4§=¡=Ó1‰
ˆØ×-Ñ-¨dÖ3ˆIÜ—7‘7—<‘< Ó0ˆDðÜ—’˜”ô —w‘w×'Ñ'¨Ó-�Ùñ 4ô —7‘7×#Ñ#¤H×$4Ò$4¸dÀ4À&È¸NÑ$KÓLˆDä�‰Ð6¸Ô=Øˆøô ó à—8‘8œuŸ|™|Ó+Øõ ,ûðús   Á C&Ã&
DÃ0DÄD)r�   r   )r3   r4   r5   r6   r7   rœ   r8   r   r9   r&   Úclassmethodr	   r¡   rM   r:   r‹   rŒ   s   @r   rŽ   rŽ   â   sw   ø† ñð& &€Mñ( ð (¨h°t©nð (È÷ (ð (ð ð# 3ð #¨9°S¸$À°_Ñ+Eó #ó ð#ð2˜Cð  C÷ ò r(   rŽ   )'r¦   rš   ÚloggingÚos.pathrj   rl   rw   Ú
contextlibr   r   Úpathlibr   Útypingr   r   r   r	   r
   r   r   r   Úpip._internal.utils.miscr   r   Ú	getLoggerr3   rn   r   Útempdir_kindsr   Ú__annotations__r   r   r<   r?   rA   rL   r   rŽ   r;   r(   r   Ú<module>rµ      s  ðÜ Û Û Û Û Û ß 0Ý ÷	÷ 	ó 	÷ 2à	×	Ò	˜8Ó	$€áˆT˜Ñ)€ñ
 ØØ)Øñ€ð )-Ð �(˜9Ñ%Ó ,ð ð3 	Ð*:Ñ ;ó 3ó ð3÷3ñ 3ð& :>Ð �8Ð5Ñ6Ó =ð ð
1˜)Ð$=¸tÀTÐ$IÑJó 
1ó ð
1÷	ñ 	ñ ‹:€÷Bñ BôJF˜Mõ Fr(   