
    4Քh                        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
r
S SKJr  S SKJr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,  S SK-J.r.J/r/J0r0  \Rb                  " SS9r2\Rf                  " \45      r5SS jr6S S jr7 " S S5      r8\ " S S5      5       r9S!S jr:      S"S jr;          S#S jr<S$S jr=g)%    )annotationsN)	dataclass)AnyCallable)Version)parse)Group)escape)Text)LinkCollector)PackageFinder)get_default_environment)SelectionPreferences)
PipSession)WINDOWS) get_best_invocation_for_this_pip#get_best_invocation_for_this_python)adjacent_tmp_filecheck_path_owner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      Y/var/www/auris/envauris/lib/python3.13/site-packages/pip/_internal/self_outdated_check.py_get_statefile_namer&   *   s)    

I>>)$..0DK    c                `    [         R                   R                  U R                  SS5      5      $ )zConvert an ISO format string to a date.

Handles the format 2020-01-22T14:24:01Z (trailing Z)
which is not supported by older versions of fromisoformat.
Zz+00:00)datetimefromisoformatr   )isodates    r%   _convert_dater-   0   s&     **7??3+IJJr'   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)SelfCheckState9   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__:   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.keyK   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)r4   r-   _WEEK)r?   current_timerI   time_since_last_checks       r%   getSelfCheckState.getO   sb    {{t{{*, #4;;|#<=
 , 9 5({{>**r'   c                b   U R                   (       d  g [        [        R                  R	                  U R                   5      5      (       d  g [        [        R                  R	                  U R                   5      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        S S S 5         [        WR                  U R                   5        g ! , (       d  f       N0= f! [         a     g f = f)N)r"   rI   rJ   T),:)	sort_keys
separators)r5   r   r6   r7   dirnamer   r"   	isoformatr:   dumpsr   writer   r   r$   r<   )r?   rJ   rL   statetextfs         r%   setSelfCheckState.setb   s    ##  0D0D EFF 	277??4#7#789
 88&002(
 zz%4JGt334GGDKKM" 5	 AFFD001 54  		s    D/ D! 
D!
D.-D.)r4   r5   N)r@   strreturnNone)r_   r^   )rL   datetime.datetimer_   
str | None)rJ   r^   rL   ra   r_   r`   )
__name__
__module____qualname____firstlineno__rB   propertyr"   rN   r\   __static_attributes__ r'   r%   r/   r/   9   s%    "  +& r'   r/   c                  4    \ rS rSr% S\S'   S\S'   SS jrSrg)	UpgradePrompt   r^   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_markuprm   rn   r
   )r?   pip_cmdnotices      r%   __rich__UpgradePrompt.__rich__   s    7<>?wGG68GBF( z!3DHH:WF (  /**@B

 
	
r'   ri   N)r_   r	   )rc   rd   re   rf   __annotations__rs   rh   ri   r'   r%   rk   rk      s    	H	H
r'   rk   c                h    [        5       R                  U 5      nUSL=(       a    SUR                  :H  $ )zChecks whether pkg was installed by pip

This is used not to display the upgrade message when pip is in fact
installed by system package manager, such as dnf on Fedora.
Npip)r   get_distribution	installer)pkgdists     r%   was_installed_by_pipr|      s0     #$55c:Dt7 77r'   c                    [         R                  " U USS9n[        SS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)allow_yankedallow_all_prereleases)link_collectorselection_prefsrw   )r   creater   r   find_best_candidatebest_candidater^   version)sessionr~   r   r   finderr   s         r%   _get_current_remote_pip_versionr      sy     #))N +#O
 !!%'F //6EEN~%%&&r'   c                   U R                  U5      nUc1  U" 5       nUc  [        R                  S5        g U R                  XA5        [	        U5      n[        R                  SU5        [        R                  SU5        [        S5      n[        R                  SU5        U(       d  g X%:  =(       a    UR                  UR                  :g  nU(       a  [        [        U5      US9$ g )NzNo remote pip version foundzRemote version of pip: %szLocal version of pip:  %srw   zWas pip installed by pip? %s)rm   rn   )	rN   loggerdebugr\   parse_versionr|   base_versionrk   r^   )rY   rL   local_versionget_remote_versionremote_version_strremote_versionpip_installed_by_piplocal_version_is_olders           r%   _self_version_check_logicr      s     <0!/1%LL67		$3"#56N
LL,n=
LL,m</6
LL/1EF 	& 	F&&.*E*EE  ]!39KLLr'   c           
        [        5       R                  S5      nU(       d  g [        5         [	        [        UR                  S9[        R                  R                  [        R                  R                  5      UR                  [        R                  " [        X5      S9nUb  [        R!                  SUSS0S9  gg! [         a     gf = f)	zCheck for an update for pip.

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.
rw   N)r@   )rY   rL   r   r   z%srichT)extra)r   rx   r   r   r   r/   r@   r*   nowtimezoneutcr   	functoolspartialr   r   warning)r   r~   installed_distupgrade_prompts       r%   pip_self_version_checkr      s     -.??FN " /w'8'89&&**8+<+<+@+@A$,,$,,+W
	N !t^FD>B " ( s   
B> >
C
C)r"   r^   r_   r^   )r,   r^   r_   ra   )rz   r^   r_   bool)r   r   r~   optparse.Valuesr_   rb   )
rY   r/   rL   ra   r   r   r   zCallable[[], str | None]r_   zUpgradePrompt | None)r   r   r~   r   r_   r`   )>
__future__r   r*   r   r   r:   loggingoptparseos.pathr6   rE   dataclassesr   typingr   r   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.selection_prefsr   pip._internal.network.sessionr   pip._internal.utils.compatr   pip._internal.utils.entrypointsr   r   pip._internal.utils.filesystemr   r   r   pip._internal.utils.miscr   r   r   	timedeltarK   	getLoggerrc   r   r&   r-   r/   rk   r|   r   r   r   ri   r'   r%   <module>r      s   "        
 !   1 @ * * & 7 < : E 4 . X W  	"			8	$KI IX 
 
 
08''"1''8 $ 	
 1 DCr'   