Ë
    ”U.j¡  ã                  óø  — d dl m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 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% d dl&m'Z'm(Z( d dl)m*Z*m+Z+m,Z,m-Z- d dl.m/Z/m0Z0m1Z1  ejd                  d¬«      Z3 ejh                  e5«      Z6dd„Z7 G d„ d«      Z8e G d„ d«      «       Z9	 	 	 	 	 	 d d„Z:	 	 	 	 	 	 	 	 d!d„Z;	 	 	 	 	 	 d"d„Z<d#d„Z=y)$é    )ÚannotationsN)Ú	dataclass)ÚVersion)Úparse)ÚGroup)Úescape)ÚText)ÚLinkCollector)ÚPackageFinder)Úget_default_environment)ÚReleaseControl)ÚSelectionPreferences)Ú
PipSession)ÚWINDOWS)Úparse_iso_datetime)Ú get_best_invocation_for_this_pipÚ#get_best_invocation_for_this_python)Úadjacent_tmp_fileÚcheck_path_ownerÚcopy_directory_permissionsÚreplace)ÚExternallyManagedEnvironmentÚcheck_externally_managedÚ
ensure_diré   )Údaysc                ól   — | j                  «       }t        j                  |«      j                  «       }|S ©N)ÚencodeÚhashlibÚsha224Ú	hexdigest)ÚkeyÚ	key_bytesÚnames      úcC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\pip/_internal/self_outdated_check.pyÚ_get_statefile_namer'   /   s)   € Ø—
‘
“€IÜ�>‰>˜)Ó$×.Ñ.Ó0€DØ€Kó    c                  ó6   — e Zd Zdd„Zedd„«       Zdd„Zd	d„Zy)
ÚSelfCheckStatec                óZ  — i | _         d | _        |rut        j                  j	                  |dt        | j                  «      «      | _        	 t        | j                  d¬«      5 }t        j                  |«      | _         d d d «       y y # 1 sw Y   y xY w# t        t        t        f$ r Y y w xY w)NÚ	selfcheckzutf-8)Úencoding)Ú_stateÚ_statefile_pathÚosÚpathÚjoinr'   r#   ÚopenÚjsonÚloadÚOSErrorÚ
ValueErrorÚKeyError)ÚselfÚ	cache_dirÚ	statefiles      r&   Ú__init__zSelfCheckState.__init__6   s•   € Ø&(ˆŒØ#ˆÔñ Ü#%§7¡7§<¡<Ø˜;Ô(;¸D¿H¹HÓ(Eó$ˆDÔ ðÜ˜$×.Ñ.¸ÕAÀYÜ"&§)¡)¨IÓ"6�D”K÷ BÐAð ÷
 BÐAûäœZ¬Ð2ò ñ ðús0   ÁB Á"BÁ=B ÂBÂB ÂB ÂB*Â)B*c                ó"   — t         j                  S r   )ÚsysÚprefix)r9   s    r&   r#   zSelfCheckState.keyG   s   € ä�z‰zÐr(   c                óÄ   — | j                   syd| j                   vryd| j                   vryt        | j                   d   «      }||z
  }|t        kD  ry| j                   d   S )z7Check if we have a not-outdated version loaded already.NÚ
last_checkÚpypi_version)r.   r   Ú_WEEK)r9   Úcurrent_timerA   Útime_since_last_checks       r&   ÚgetzSelfCheckState.getK   sd   € à�{Š{Øà˜tŸ{™{Ñ*Øà §¡Ñ,Øô (¨¯©°LÑ(AÓBˆ
Ø ,¨zÑ 9ÐØ ¤5Ò(Øà�{‰{˜>Ñ*Ð*r(   c                ó  — | j                   sy t        j                  j                  | j                   «      }t	        |«      sy t        |«       | j                  |j                  «       |dœ}t        j                  |dd¬«      }t        | j                   «      5 }|j                  |j                  «       «       t        ||«       d d d «       	 t        j                  | j                   «       y # 1 sw Y   Œ+xY w# t         $ r Y y w xY w)N)r#   rA   rB   T)Ú,Ú:)Ú	sort_keysÚ
separators)r/   r0   r1   Údirnamer   r   r#   Ú	isoformatr4   Údumpsr   Úwriter   r   r   r%   r6   )r9   rB   rD   Ústatefile_directoryÚstateÚtextÚfs          r&   ÚsetzSelfCheckState.set^   sÜ   € à×#Ò#Øä Ÿg™gŸo™o¨d×.BÑ.BÓCÐô  Ð 3Ô4Øô 	Ð&Ô'ð
 —8‘8Ø&×0Ñ0Ó2Ø(ñ
ˆô �z‰z˜%¨4¸JÔGˆä˜t×3Ñ3Ô4¸Ø�G‰G�D—K‘K“MÔ"Ü&Ð':¸AÔ>÷ 5ð	ô �A—F‘F˜D×0Ñ0Õ1÷ 5Ð4ûô ò 	áð	ús   Â,C/Ã C; Ã/C8Ã;	DÄDN)r:   ÚstrÚreturnÚNone)rV   rU   )rD   údatetime.datetimerV   ú
str | None)rB   rU   rD   rX   rV   rW   )Ú__name__Ú
__module__Ú__qualname__r<   Úpropertyr#   rF   rT   © r(   r&   r*   r*   5   s%   „ óð" òó ðó+ô&#r(   r*   c                  ó*   — e Zd ZU ded<   ded<   dd„Zy)ÚUpgradePromptrU   ÚoldÚnewc                ó  — t         rt        «       › d�}n
t        «       }d}t        t	        «       t	        j
                  |› d| j                  › d| j                  › d�«      t	        j
                  |› dt        |«      › d�«      «      S )Nz -m pipz/[bold][[reset][blue]notice[reset][bold]][reset]z) A new release of pip is available: [red]z[reset] -> [green]z[reset]z To update, run: [green]z install --upgrade pip)	r   r   r   r   r	   Úfrom_markupra   rb   r   )r9   Úpip_cmdÚnotices      r&   Ú__rich__zUpgradePrompt.__rich__‰   s•   € ÝÜ<Ó>Ð?¸wÐG‰Gä6Ó8ˆGàBˆÜÜ‹FÜ×ÑØ�(ð ØŸ™�zÐ!3°D·H±H°:¸WðFóô ×ÑØ�(ð Ü  ›/Ð*Ð*@ðBóó

ð 
	
r(   N)rV   r   )rZ   r[   r\   Ú__annotations__rg   r^   r(   r&   r`   r`   „   s   … à	ƒHØ	ƒHô
r(   r`   c                óö   — t        j                  | |d¬«      }t        dt        dh¬«      ¬«      }t	        j                  ||¬«      }|j                  d«      j                  }|€y t        |j                  «      S )NT)ÚoptionsÚsuppress_no_indexFÚpip)Ú
only_final)Úallow_yankedÚrelease_control)Úlink_collectorÚselection_prefs)	r
   Úcreater   r   r   Úfind_best_candidateÚbest_candidaterU   Úversion)Úsessionrj   rp   rq   Úfinderrt   s         r&   Ú_get_current_remote_pip_versionrx   �   s€   € ô #×)Ñ)ØØØô€Nô +ØÜ&°5°'Ô:ô€Oô
 ×!Ñ!Ø%Ø'ô€Fð ×/Ñ/°Ó6×EÑE€NØÐØäˆ~×%Ñ%Ó&Ð&r(   c                ó  — t        |«      }t        j                  d|«       t        j                  d| «       t        j                  d|«       |sy | |k  xr | j                  |j                  k7  }|rt	        t        | «      |¬«      S y )NzRemote version of pip: %szLocal version of pip:  %szWas pip installed by pip? %s)ra   rb   )Úparse_versionÚloggerÚdebugÚbase_versionr`   rU   )Úlocal_versionÚremote_version_strÚinstalled_by_pipÚremote_versionÚlocal_version_is_olders        r&   Ú_compute_upgrade_promptrƒ   ¹   s‡   € ô #Ð#5Ó6€NÜ
‡L�LÐ,¨nÔ=Ü
‡L�LÐ,¨mÔ<Ü
‡L�LÐ/Ð1AÔBáØð 	˜Ñ&ò 	FØ×&Ñ&¨.×*EÑ*EÑEð ñ Ü¤ ]Ó!3Ð9KÔLÐLàr(   c                óä  — t        «       j                  d«      }|sy	 t        «        t	        |j
                  ¬«      }t        j                  j                  t        j                  j                  «      }|j                  |«      }|€6t        | |«      }|€t        j                  d«       y|j                  ||«       t        |j                   ||j"                  dk(  ¬«      S # t        $ r Y yw xY w)an  Compute the pip upgrade prompt, if any, before the command runs.

    Limit the frequency of checks to once per week. State is stored either in
    the active virtualenv or in the user's USER_CACHE_DIR keyed off the prefix
    of the pip script path.

    Pair with :func:`pip_self_version_check_emit`, which displays the prompt
    after the command body runs.
    rl   N)r:   zNo remote pip version found)r~   r   r€   )r   Úget_distributionr   r   r*   r:   ÚdatetimeÚnowÚtimezoneÚutcrF   rx   r{   r|   rT   rƒ   ru   Ú	installer)rv   rj   Úinstalled_distrQ   rD   r   s         r&   Úpip_self_version_check_fetchrŒ   Î   sÞ   € ô -Ó.×?Ñ?ÀÓF€NÙØðÜ Ô"ô  W×%6Ñ%6Ô7€EÜ×$Ñ$×(Ñ(¬×):Ñ):×)>Ñ)>Ó?€LØŸ™ <Ó0ÐØÐ!Ü<¸WÀgÓNÐØÐ%Ü�L‰LÐ6Ô7ØØ�	‰	Ð$ lÔ3ä"Ø$×,Ñ,Ø-Ø'×1Ñ1°UÑ:ôð øô (ò Ùðús   ž
C# Ã#	C/Ã.C/c                ó>   — | �t         j                  d| ddi¬«       yy)zIEmit the upgrade prompt captured by :func:`pip_self_version_check_fetch`.Nz%sÚrichT)Úextra)r{   Úwarning)Úupgrade_prompts    r&   Úpip_self_version_check_emitr’   ó   s#   € àÐ!Ü�‰�t˜^°F¸D°>ˆÕBð "r(   )r#   rU   rV   rU   )rv   r   rj   úoptparse.ValuesrV   rY   )r~   r   r   rU   r€   ÚboolrV   úUpgradePrompt | None)rv   r   rj   r“   rV   r•   )r‘   r•   rV   rW   )>Ú
__future__r   r†   r    r4   ÚloggingÚoptparseÚos.pathr0   r>   Údataclassesr   Úpip._vendor.packaging.versionr   r   rz   Úpip._vendor.rich.consoler   Úpip._vendor.rich.markupr   Úpip._vendor.rich.textr	   Úpip._internal.index.collectorr
   Ú"pip._internal.index.package_finderr   Úpip._internal.metadatar   Ú$pip._internal.models.release_controlr   Ú$pip._internal.models.selection_prefsr   Úpip._internal.network.sessionr   Úpip._internal.utils.compatr   Úpip._internal.utils.datetimer   Úpip._internal.utils.entrypointsr   r   Úpip._internal.utils.filesystemr   r   r   r   Úpip._internal.utils.miscr   r   r   Ú	timedeltarC   Ú	getLoggerrZ   r{   r'   r*   r`   rx   rƒ   rŒ   r’   r^   r(   r&   Ú<module>r¬      s  ðÝ "ã Û Û Û Û Û Û 
Ý !å 1Ý @Ý *Ý *Ý &å 7Ý <Ý :Ý ?Ý EÝ 4Ý .Ý ;÷÷ó ÷ñ ð 	ˆ×Ñ Ô"€à	ˆ×	Ñ	˜8Ó	$€ó÷Lñ Lð^ ÷
ð 
ó ð
ð0'Øð'Ø"1ð'àó'ð8ØðØ03ðØGKðàóð*"Øð"Ø"1ð"àó"ôJCr(   