
    j                       S SK Jr  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	r	S SK
Jr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SK J!r!  S SK"J#r#  S SK$J%r%  S SK&J'r'J(r(  S SK)J*r*J+r+J,r,J-r-  S SK.J/r/J0r0J1r1  \Rd                  " SS9r3\Rh                  " \55      r6SS jr7 " S S5      r8\ " S S5      5       r9      S S jr:        S!S jr;      S"S jr<S#S jr=g)$    )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                n    U R                  5       n[        R                  " U5      R                  5       nU$ N)encodehashlibsha224	hexdigest)key	key_bytesnames      r/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/pip/_internal/self_outdated_check.py_get_statefile_namer'   /   s)    

I>>)$..0DK    c                  F    \ rS rSrSS jr\S	S j5       rS
S jrSS jrSr	g)SelfCheckState5   c                l   0 U l         S U l        U(       as  [        R                  R	                  US[        U R                  5      5      U l         [        U R                  SS9 n[        R                  " U5      U l         S S S 5        g g ! , (       d  f       g = f! [        [        [        4 a     g f = f)N	selfcheckzutf-8)encoding)_state_statefile_pathospathjoinr'   r#   openjsonloadOSError
ValueErrorKeyError)self	cache_dir	statefiles      r&   __init__SelfCheckState.__init__6   s    &(# #%77<<;(;DHH(E$D $..AY"&))I"6DK BA 
 BAZ2  s0   B $B
 B 

BB B B32B3c                "    [         R                  $ r   )sysprefix)r:   s    r&   r#   SelfCheckState.keyG   s    zzr(   c                    U R                   (       d  gSU R                   ;  a  gSU R                   ;  a  g[        U R                   S   5      nX-
  nU[        :  a  gU R                   S   $ )z7Check if we have a not-outdated version loaded already.N
last_checkpypi_version)r/   r   _WEEK)r:   current_timerD   time_since_last_checks       r&   getSelfCheckState.getK   sb    {{t{{*, (L(AB
 , 9 5({{>**r(   c                .   U R                   (       d  g [        R                  R                  U R                   5      n[	        U5      (       d  g [        U5        U R                  UR                  5       US.n[        R                  " USSS9n[        U R                   5       nUR                  UR                  5       5        [        X65        S S S 5         [        WR                  U R                   5        g ! , (       d  f       N0= f! [          a     g f = f)N)r#   rD   rE   T),:)	sort_keys
separators)r0   r1   r2   dirnamer   r   r#   	isoformatr5   dumpsr   writer   r   r   r%   r7   )r:   rE   rG   statefile_directorystatetextfs          r&   setSelfCheckState.set^   s    ## ggood.B.BC   344 	&'
 88&002(
 zz%4JGt334GGDKKM"&':> 5	 AFFD001 54  		s   !+C6 D 6
D
DD)r/   r0   N)r;   strreturnNone)r[   rZ   )rG   datetime.datetimer[   
str | None)rE   rZ   rG   r]   r[   r\   )
__name__
__module____qualname____firstlineno__r=   propertyr#   rI   rX   __static_attributes__ r(   r&   r*   r*   5   s%    "  +&#r(   r*   c                  4    \ rS rSr% S\S'   S\S'   SS jrSrg)	UpgradePrompt   rZ   oldnewc                   [         (       a  [        5        S3nO
[        5       nSn[        [	        5       [        R
                  " U SU R                   SU R                   S35      [        R
                  " U S[        U5       S35      5      $ )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_markupri   rj   r   )r:   pip_cmdnotices      r&   __rich__UpgradePrompt.__rich__   s    7<>?wGG68GBF( z!3DHH:WF (  /**@B

 
	
r(   re   N)r[   r   )r_   r`   ra   rb   __annotations__ro   rd   re   r(   r&   rg   rg      s    	H	H
r(   rg   c                    [         R                  " U USS9n[        S[        S1S9S9n[        R                  " UUS9nUR                  S5      R                  nUc  g [        UR                  5      $ )NT)optionssuppress_no_indexFpip)
only_final)allow_yankedrelease_control)link_collectorselection_prefs)	r
   creater   r   r   find_best_candidatebest_candidaterZ   version)sessionrs   ry   rz   finderr}   s         r&   _get_current_remote_pip_versionr      s     #))N +&5':O
 !!%'F //6EEN~%%&&r(   c                *   [        U5      n[        R                  SU5        [        R                  SU 5        [        R                  SU5        U(       d  g X:  =(       a    U R                  UR                  :g  nU(       a  [	        [        U 5      US9$ g )NzRemote version of pip: %szLocal version of pip:  %szWas pip installed by pip? %s)ri   rj   )parse_versionloggerdebugbase_versionrg   rZ   )local_versionremote_version_strinstalled_by_pipremote_versionlocal_version_is_olders        r&   _compute_upgrade_promptr      s     ##56N
LL,n=
LL,m<
LL/1AB 	& 	F&&.*E*EE  ]!39KLLr(   c                   [        5       R                  S5      nU(       d  g [        5         [	        UR
                  S9n[        R                  R                  [        R                  R                  5      nUR                  U5      nUc5  [        X5      nUc  [        R                  S5        gUR                  XT5        [        UR                   UUR"                  S:H  S9$ ! [         a     gf = f)aV  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.
ru   N)r;   zNo remote pip version found)r   r   r   )r   get_distributionr   r   r*   r;   datetimenowtimezoneutcrI   r   r   r   rX   r   r~   	installer)r   rs   installed_distrU   rG   r   s         r&   pip_self_version_check_fetchr      s     -.??FN " W%6%67E$$(():):)>)>?L<0!<WN%LL67		$3"$,,-'11U:  ( s   
C" "
C/.C/c                :    U b  [         R                  SU SS0S9  gg)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^FD>B "r(   )r#   rZ   r[   rZ   )r   r   rs   optparse.Valuesr[   r^   )r   r   r   rZ   r   boolr[   UpgradePrompt | None)r   r   rs   r   r[   r   )r   r   r[   r\   )>
__future__r   r   r    r5   loggingoptparseos.pathr1   r@   dataclassesr   pip._vendor.packaging.versionr   r   r   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   	timedeltarF   	getLoggerr_   r   r'   r*   rg   r   r   r   r   re   r(   r&   <module>r      s   "       
 ! 1 @ * * & 7 < : ? E 4 . ;   	"			8	$L L^ 
 
 
0''"1''803GK*"""1""JCr(   