\h xddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lm Z dd l!m"Z"dd l#m$Z$ddl%m&Z&ddl'm(Z(m)Z)ddl*m+Z+m,Z,m-Z-ddl.m/Z/ej`dZ1ejde3Z4de5de5fdZ6de5dejfdZ7GddZ8e GddZ9de5de:fdZ;de$d ejxdee5fd!Z=d"e8d#ejd$e d%e gee5fdee9f d&Z>de$d ejxddfd'Z?y)(N) dataclass)AnyCallableDictOptional)parse)Group)escape)Text) LinkCollector) PackageFinder)get_default_environment)DistributionVersion)SelectionPreferences) PipSession)WINDOWS) get_best_invocation_for_this_pip#get_best_invocation_for_this_python)adjacent_tmp_filecheck_path_ownerreplace) ensure_dir)dayskeyreturncl|j}tj|j}|SN)encodehashlibsha224 hexdigest)r key_bytesnames d/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_internal/self_outdated_check.py_get_statefile_namer&$s) I >>) $ . . 0D Kisodatec`tjj|jddS)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)r(s r% _convert_dater-*s&    * *7??3+I JJr'ceZdZdeddfdZedefdZdejdeefdZ dedejddfd Z y) SelfCheckState cache_dirrNcZi|_d|_|rutjj |dt |j |_ t|jd5}tj||_dddyy#1swYyxYw#tttf$rYywxYw)N selfcheckzutf-8)encoding) _state_statefile_pathospathjoinr&ropenjsonloadOSError ValueErrorKeyError)selfr0 statefiles r%__init__zSelfCheckState.__init__4s&( # #%77<<;(;DHH(E$D  $..A7Y"&))I"6DK77  77Z2  s0 B"B=BB BBB*)B*c"tjSr)sysprefix)r?s r%rzSelfCheckState.keyEs zzr' current_timec|jsyd|jvryd|jvryt|jd}||z }|tkDry|jdS)z7Check if we have a not-outdated version loaded already.N last_check pypi_version)r4r-_WEEK)r?rErGtime_since_last_checks r%getzSelfCheckState.getIsd{{ t{{ *  ,#4;;|#<= ,z 9 5 ({{>**r'rHcF|jsyttjj |jsyt tjj |j|j |j|d}tj|dd}t|j5}|j|jddd tj|jy#1swY+xYw#t$rYywxYw)N)rrGrHT),:) sort_keys separators)r5rr6r7dirnamerr isoformatr:dumpsrwriterrr$r<)r?rHrEstatetextfs r%setzSelfCheckState.set\s##  0D0D EF  277??4#7#789 88&002(  zz%4JG t33 4 # GGDKKM " #  AFFD00 1  # #   s> D' DD D D ) __name__ __module__ __qualname__strrApropertyrr+rrKrXr'r%r/r/3sm#$"S+ 1 1+hsm+&  83D3D  r'r/c.eZdZUeed<eed<defdZy) UpgradePromptoldnewrc trtd}n t}d}tt t j |d|j d|jdt j |dt|dS)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) rrrr r from_markuprarbr )r?pip_cmdnotices r%__rich__zUpgradePrompt.__rich__s <>?wGG68GB F   (z!3DHH:WF    ( /**@B   r'N)rYrZr[r\__annotations__r rgr^r'r%r`r`s H H % r'r`pkgc^tj|}|duxrd|jk(S)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. Npip)rget_distribution installer)ridists r%was_installed_by_pipros0 # $ 5 5c :D t  7 77r'sessionoptionsctj||d}tdd}tj||}|j dj }|yt |jS)NT)rqsuppress_no_indexF) allow_yankedallow_all_prereleases)link_collectorselection_prefsrk)r createrr find_best_candidatebest_candidater\version)rprqrvrwfinderrzs r%_get_current_remote_pip_versionr}sy#))N+#O  ! !%'F//6EEN ~%% &&r'rUrE local_versionget_remote_versionc|j|}|1|}|tjdy|j||t |}tjd|tjd|t d}tjd||sy||kxr|j |j k7}|rtt||Sy)NzNo remote pip version foundzRemote version of pip: %szLocal version of pip: %srkzWas pip installed by pip? %s)rarb) rKloggerdebugrX parse_versionro base_versionr`r\)rUrEr~rremote_version_strremote_versionpip_installed_by_piplocal_version_is_olders r%_self_version_check_logicrs<0!/1  % LL6 7 $l3"#56N LL,n= LL,m</6 LL/1EF  & F  & &.*E*E E]!39KLL r'c tjd}|sy tt|jt j j t jj|jtjt||}|tjd|ddiyy#t$r/tjd tj!d d YywxYw) 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. rkN)r0)rUrEr~rz%srichT)extraz6There was an error checking the latest version of pip.zSee below for error)exc_info)rrlrr/r0r+nowtimezoneutcr{ functoolspartialr}rwarning Exceptionr)rprqinstalled_distupgrade_prompts r%pip_self_version_checkrs-.??FN  ;2 7+<+<=!**..x/@/@/D/DE(00(00/'     % NN4~N F & ;OP *T :;sBB775C/.C/)@r+rr r:loggingoptparseos.pathr6rC dataclassesrtypingrrrrpip._vendor.packaging.versionrrpip._vendor.rich.consoler pip._vendor.rich.markupr pip._vendor.rich.textr pip._internal.index.collectorr "pip._internal.index.package_finderr pip._internal.metadatarpip._internal.metadata.baser$pip._internal.models.selection_prefsrpip._internal.network.sessionrpip._internal.utils.compatrpip._internal.utils.entrypointsrrpip._internal.utils.filesystemrrrpip._internal.utils.miscr timedeltarI getLoggerrYrr\r&r-r/r`boolroValuesr}rrr^r'r%rsv  !00@**&7<:;E4.XW/"   8 $SS K3K8#4#4KIIX     08c8d8' '"*//' c]'8 ##'  !Xc]!23  m D;J;;T;r'