"Jd*Q ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddlm Z ddlmZmZmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddl"m#Z#ddl$m%Z%m&Z&m'Z'ddl(m)Z)dd l*m+Z+dd l,m-Z-m.Z.m/Z/dd l,m0Z0dd l1m2Z2dd l3m4Z4ddl5m6Z6gdZ7ej8e9Z:e dZ;eee<ee>e>fZ?ee@eee@ee@ffZAde@fdZBdee>dfdee>e>e>ffdZCde@ddfdZDde@fdZEe%de&de'ddvde@deFddfd ZGd!edefde@d"e=ddfd#ZHde@de@fd$ZIdwde@d&e@de@fd'ZJd(e@d)ee@de@fd*ZKd(e@ddfd+ZLd(e@d)ee@de@fd,ZMd(e@de@fd-ZNd(e@de@fd.ZOd/e@de>fd0ZPd1eQde@fd2ZRd3eeedeee@ee>ffd4ZSde@deFfd5ZTejUfd6ed7e>deeVfd8ZWdxde@d9eFde@fd:ZXde@dee@e@ffd;ZYdZZde@deFfd?Z[d@e#deFfdAZ\d@e#deFfdBZ]d@e#deFfdCZ^dDZ_dEe@dee#fdFZ`d@e#de@fdGZadHedIeddfdJZbGdKdLe ZcejddMe@deecfdNZedeecfdOZfdeecfdPZgdQedRedeefdSZhdTe@dUee>de@fdVZidydXe@dYe@de@fdZZjdXe@dee@ee>ffd[ZkdXe@deAfd\ZldXe@de@fd]Zmd^e@d_ee@geedffdee@eAffd`ZndXe@deAfdaZodXe@dee@fdbZpd^e@dee@e@ee@e@fffdcZqd^e@de@fddZrd^e@de@fdeZsGdfdgZtdhe@detfdiZud^e@detfdjZvdkeFddfdlZwdeFfdmZxdzde@doe>deee>ffdpZydeFfdqZzdreedeeeeffdsZ{dtee;geFfdree;deee;ee;ffduZ|dS){N)StringIO) filterfalsetee zip_longest) TracebackType) AnyBinaryIOCallableContextManagerIterableIteratorListOptionalTextIOTupleTypeTypeVarcast Distribution)retrystop_after_delay wait_fixed) __version__) CommandError)get_major_minor_version site_packages user_site) get_scheme)WINDOWS)egg_link_path_from_location)running_under_virtualenv) rmtree display_path backup_dirasksplitext format_sizeis_installable_dirnormalize_pathrenamesget_progcaptured_stdout ensure_dirremove_auth_from_urlTreturnctjtjtdd}tj|}dt|tS)Nz..zpip {} from {} (python {})) ospathjoindirname__file__abspathformatrr) pip_pkg_dirs K/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/utils/misc.pyget_pip_versionr<Gsa',,rwx88$EEK'//+..K ' . .!!  py_version_info.ct|dkr|dt|z dzz }nt|dkr |dd}td|S)ax Convert a tuple of ints representing a Python version to one of length three. :param py_version_info: a tuple of ints representing a Python version, or None to specify no version. The tuple can have any length. :return: a tuple of length three if `py_version_info` is non-None. Otherwise, return `py_version_info` unchanged (i.e. None). )rN VersionInfo)lenr)r>s r;normalize_version_inforCRsf ?aAO 4 44<< _   ! !)"1"-   / //r=r4c tj|dS#t$r<}|jtjkr|jtjkrYd}~dSYd}~dSd}~wwxYw)z os.path.makedirs without EEXIST.N)r3makedirsOSErrorerrnoEEXIST ENOTEMPTY)r4es r;r.r.es D  7el " "qw%/'A'A  # " " " " "'A'A'A'A'A'As A+AAc tjtjd}|dvrtjdS|S#t ttf$rYnwxYwdS)Nr)z __main__.pyz-cz -m pippip) r3r4basenamesysargv executableAttributeError TypeError IndexError)progs r;r,r,osp w ,, ( ( (n--- -K Iz 2     5sAAAA A Tr@g?)reraisestopwaitFdir ignore_errorsc>tj||tdS)N)rYonerror)shutilr#rmtree_errorhandler)rXrYs r;r#r#}s  M#]Your response ({!r}) was not one of the expected responses: {}z, )rinputstriplowerprintr9r5)rurvresponses r;r&r&s    >>>>##))++ 7 " " VHdii&8&899     O r=c>t|t|S)zAsk for input interactively.)rrrs r; ask_inputrsG >>r=cHt|tj|S)z!Ask for a password interactively.)rgetpassrs r; ask_passwordrs G ?7 # ##r=valcf|}|dvrdS|dvrdStd|)zConvert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if 'val' is anything else. )yyesttrueon1rp)rsnoffalseoff0rzinvalid truth value )r ValueError)rs r; strtoboolrsJ ))++C 222q 5 5 5q777888r=bytesc|dkrd|dz dz S|dkr%dt|dz S|dkrd|dz Sdt|S) Ni@Bz {:.1f} MBg@@ii'z{} kBz {:.1f} kBz{} bytes)r9int)rs r;r(r(s {!!%&.4"7888   ~~c%$,//000 !!%&.111  U,,,r=rowscld|D}dt|ddiDfd|D}|fS)zReturn a list of formatted rows and a list of column sizes. For example:: >>> tabulate([['foobar', 2000], [0xdeadbeef]]) (['foobar 2000', '3735928559'], [10, 4]) cRg|]$}ttt|%S)tuplemaprr).0rows r; ztabulate..s( 1 1 1SE#c3-- 1 1 1r=cRg|]$}ttt|%Sr)maxrrB)rcols r;rztabulate..s( L L LCSS#   L L Lr= fillvalueryc g|]B}dttj|CS) )r5rrrljustrstrip)rrsizess r;rztabulate..s? K K KsSXXc#)S%00 1 1 8 8 : : K K Kr=)r)rtablers @r;tabulaters[ 2 1D 1 1 1D L L;+K+K+K L L LE K K K Kd K K KE %<r=cDtj|sdStjtj|drdStjtj|drdSdS)atIs path is a directory containing pyproject.toml or setup.py? If pyproject.toml exists, this is a PEP 517 project. Otherwise we look for a legacy setuptools layout by identifying setup.py. We don't check for the setup.cfg because using it without setup.py is only available for PEP 517 projects, which are already covered by the pyproject.toml check. Fzpyproject.tomlTzsetup.py)r3r4isdirisfiler5rls r;r)r)s{ 7==  u w~~bgll4)9::;;t w~~bgll44455t 5r=filesizec#DK ||}|sdS|V)z7Yield pieces of data from a file-like object until EOF.TN)read)rrchunks r; read_chunksrs5 $  E r=resolve_symlinksctj|}|r tj|}ntj|}tj|S)zN Convert a path to its canonical, case-normalized, absolute version. )r3r4 expanduserrealpathr8rh)r4rs r;r*r*sa 7  d # #D%w%%wt$$ 7  D ! !!r=ctj|\}}|dr|dd|z}|dd}||fS)z,Like os.path.splitext, but take off .tar tooz.tarN) posixpathr'rendswith)r4baserns r;r'r'$s\"4((ID# zz||V$$233i#oCRCy 9r=oldnewctj|\}}|r5|r3tj|stj|t j||tj|\}}|r*|r* tj|dS#t$rYdSwxYwdSdS)z7Like os.renames(), but handles renaming across devices.N) r3r4r|rqrEr\move removedirsrF)rrheadtails r;r+r+-ss##JD$ RW^^D11 D KSs##JD$   M$         DD sB,, B:9B:cztsdS|ttjS)z Return True if path is within sys.prefix, if we're running in a virtualenv. If we're not in a virtualenv, all paths are considered "local." Caution: this function assumes the head of path has been normalized with normalize_path. T)r"rir*rNprefixrls r;is_localr>s3 $ % %t ??>#*55 6 66r=distc:tt|S)z Return True if given Distribution object is installed locally (i.e. within current virtualenv). Always True if we're not in a virtualenv. )r dist_locationrs r; dist_is_localrLs M$'' ( ((r=cjt|ttS)zF Return True if given Distribution is installed in user site. )rrir*rrs r;dist_in_usersiterWs(    ) ).*C*C D DDr=cjt|ttS)z[ Return True if given Distribution is installed in sysconfig.get_python_lib(). )rrir*rrs r;dist_in_site_packagesr^s(    ) ).*G*G H HHr=ctt|}|ttdjddS)zf Return True if given Distribution is installed in path matching distutils_scheme layout. rypythonr)r*rrirpurelibr|)r norm_paths r;dist_in_install_pathrfs\ }T2233I   2$$X..q1!3!3 4 44r=req_namecddlm}ddlm}||}|dSt ||jS)a%Given a requirement name, return the installed Distribution object. This searches from *all* distributions available in the environment, to match the behavior of ``pkg_resources.get_distribution()``. Left for compatibility until direct pkg_resources uses are refactored out. r)get_default_environmentrN)pip._internal.metadatar$pip._internal.metadata.pkg_resourcesrget_distributionr_dist)rr_Distrs r;rrpsa?>>>>>JJJJJJ " " $ $ 5 5h ? ?D |t t   ""r=ctt|j}|rt|St|jS)aO Get the site-packages location of this distribution. Generally this is dist.location, except in the case of develop-installed packages, where dist.location is the source code location, and we want to know where the egg-link file is. The returned location is normalized (in particular, with symlinks removed). )r! project_namer*location)regg_links r;rrs:+4+<==H(h''' $- ( ((r=msgargsc*tj|g|RdSN)loggerinfo)rrs r; write_outputrs  Kdr=cTeZdZUdZeed<ededdfdZedZ dS) StreamWrapperN orig_streamr1c$||_|Sr)r)clsrs r; from_streamzStreamWrapper.from_streams%suu r=c|jjSr)rencodingselfs r;rzStreamWrapper.encodings((r=) __name__ __module__ __qualname__rr__annotations__ classmethodrpropertyrrr=r;rrsmKf[ ))X)))r=r stream_namec#"Ktt|}tt|t| tt|Vtt||dS#tt||wxYw)zReturn a context manager used by captured_stdout/stdin/stderr that temporarily replaces the sys stream *stream_name* with a StringIO. Taken from Lib/support/__init__.py in the CPython repo. N)getattrrNsetattrrr)r orig_stdouts r;captured_outputrs#{++K Cm77 DDEEE/c;'''''[+.....[+....s A66Bc tdS)zCapture the output of sys.stdout: with captured_stdout() as stdout: print('hello') self.assertEqual(stdout.getvalue(), 'hello ') Taken from Lib/support/__init__.py in the CPython repo. stdoutrrr=r;r-r-s 8 $ $$r=c tdS)z See captured_stdout(). stderrr rr=r;captured_stderrr s 8 $ $$r= sequentialnamedc tt|tt|fi|}d|D}||d<t dd|S)Nci|]\}}|| Srr)rkeyvalues r; zenum..s:::jc5uc:::r=reverse_mappingEnumr)dictziprangerBitemstype)rrenumsreverses r;enumrsg Zs:!7!788 B BE B BE::EKKMM:::G&E  E " ""r=hostportc,||Sd|vrd|d}|d|S)z. Build a netloc from a host-port pair N:[]r)rr s r; build_netlocr%s8 |  d{{4{{{  T  r=httpsnetlocschemec^|ddkrd|vr d|vrd|d}|d|S)z) Build a full URL from a netloc. r"@r#r$z://)count)r'r(s r;build_url_from_netlocr-sP||CA#V"3"368I8IV ! ! ! !!r=czt|}tj|}|j|jfS)z2 Return the host-port pair from a netloc. )r-urllibparseurlparsehostnamer )r'urlparseds r; parse_netlocr5s5  ' 'C \ " "3 ' 'F ?FK ''r=cd|vr|dfS|dd\}}d}d|vr|dd\}}n|d}}tj|}|tj|}|||ffS)zp Parse out and remove the auth information from a netloc. Returns: (netloc, (username, password)). r+)NNrpNr")rsplitr|r/r0unquote)r'authpwusers r;split_auth_from_netlocr<s  &|## ==a((LD&B d{{::c1%%bbb <   % %D ~ \ ! !" % % D": r=ct|\}\}}||S|d}d}n!tj|}d}d|||S)z Replace the sensitive data in a netloc with "****", if it exists. For example: - "user:pass@example.com" returns "user:****@example.com" - "accesstoken@example.com" returns "****@example.com" N****ryz:****z{user}{password}@{netloc})r;passwordr')r<r/r0quoter9)r'r;r?s r; redact_netlocrA su 6f==F T8 | |!!$'' & - - HV .  r=r3transform_netlocctj|}||j}|j|d|j|j|jf}tj|}|td|fS)aRTransform and replace netloc in a url. transform_netloc is a function taking the netloc and returning a tuple. The first element of this tuple is the new netloc. The entire tuple is returned. Returns a tuple containing the transformed url as item 0 and the original tuple returned by transform_netloc as item 1. r NetlocTuple) r/r0urlsplitr'r(r4queryfragment urlunsplitr)r3rBpurl netloc_tuple url_piecessurls r;_transform_urlrMsq <  % %D##DK00L+|A 4:t}UJ < " ": . .D m\22 22r=c t|Sr)r<r's r; _get_netlocrP3s !& ) ))r=c"t|fSr)rArOs r;_redact_netlocrR7s & ! ! ##r=cBt|t\}\}}|||fS)z Parse a url into separate netloc, auth, and url with no auth. Returns: (url_without_auth, netloc, (username, password)) rMrP)r3url_without_authr'r9s r;split_auth_netloc_from_urlrV;s* (6c;'G'G$nvt VT ))r=c8t|tdS)z7Return a copy of url with 'username:password@' removed.rrTr3s r;r/r/Es #{ + +A ..r=c8t|tdS)z.Replace the password in a given url with ****.r)rMrRrXs r;redact_auth_from_urlrZLs #~ . .q 11r=cJeZdZdededdfdZdefdZdefdZdedefd Z dS) HiddenTextsecretredactedr1Nc"||_||_dSr)r]r^)rr]r^s r;__init__zHiddenText.__init__Rs   r=cFdt|S)Nz)r9rrrs r;__repr__zHiddenText.__repr__Vs"))#d))444r=c|jSrr^rs r;__str__zHiddenText.__str__Ys }r=othercft|t|krdS|j|jkS)NF)rr])rrfs r;__eq__zHiddenText.__eq__]s/ ::e $ $5{el**r=) rrrrrr`rbrerboolrhrr=r;r\r\Qs!s!c!d!!!!5#5555+C+D++++++r=r\rc$t|dS)Nr>rd)r\)rs r; hide_valuerkfs ef - - --r=cBt|}t||S)Nrd)rZr\)r3r^s r;hide_urlrmjs"#C((H cH - - --r= modifying_pipcddtjddjtjddg}|o7to0tjtjd|v}|rYtjddgtjd dz}td d |dS) zProtection of pip.exe from modification on Windows On Windows, any operation modifying pip should be run as: python -m pip ... zpip.exez pip{}.exerz pip{}.{}.exeNr*z-mrLrpz3To modify pip, please run the following command: {}r) r9rN version_infor r3r4rMrOrPrr5)rn pip_namesshould_show_use_python_msg new_commands r;(protect_pip_from_modification_on_windowsrtos 3+A.//s/34I P'Pbg&6&6sx{&C&Cy&P" ~tU3chqrrlB  B I I%%       r=cZtjduotjS)zIs this console interactive?N)rNstdinisattyrr=r;is_console_interactiverxs" 9D 7SY%5%5%7%77r= blocksizectj}d}t|d5}t||D])}|t |z }||* dddn #1swxYwY||fS)z5Return (hash, length) for path using hashlib.sha256()rrb)rN)hashlibsha256openrrBupdate)r4rzhlengthrblocks r; hash_filers A F dD  Q 333  E c%jj F HHUOOOO  f9s (s0, s1), (s2, s3), (s4, s5), ... )iterr)rs r;pairwisersH~~H x * **r=predcft|\}}t||t||fS)z Use a predicate to partition entries into false entries and true entries, like partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9 )rrfilter)rrt1t2s r; partitionrs2]]FB tR &r"2"2 22r=)F)rm)T)r&)ry)} contextlibrGrr}iologgingr3rr\rarN urllib.parser/r itertoolsrrrtypesrtypingrr r r r r rrrrrrrpip._vendor.pkg_resourcesrpip._vendor.tenacityrrrrLrpip._internal.exceptionsrpip._internal.locationsrrrrpip._internal.utils.compatr pip._internal.utils.egg_linkr!pip._internal.utils.virtualenvr"__all__ getLoggerrrr0 BaseExceptionExcInforrArrrDr<rCr.r,rir#r]r$r%r~rr&rrrfloatr(rr)DEFAULT_BUFFER_SIZErrr*r'r+rrrrrrrrrcontextmanagerrr-r rr%r-r5r<rArMrPrRrVr/rZr\rkrmrtrxrrrrrr=r;rsm     3333333333 322222DDDDDDDDDD111111UUUUUUUUUU............DDDDDDCCCCCC   "  8 $ $ GCLL ]#]MA BCcM" Cx}hsm;<<= 0E#s(O0c3PSm@T0000&ST #    t**1--JJsOODDDQQQDQTQQQEDQhsCx0wSW(ssCcs!S!8C=!S!!!! S T      x}     ss $#$#$$$$ 93 93 9 9 9 9 -u----- 8HSM* uT#YS 5I/J    ST"-/,BhcxPU " " " " " " " "35c?34" 73 74 7 7 7 7) )))))E<EDEEEEI IIIII444#s#x '=####" ) ) ) ) ) )c#$ ) ) ) ) )H ) ) )  / /-)@ / / / / % 6 % % % %% 6%%%%#c#C#DI#### s (3- C    ""#"s"""""((sHSM'9!:((((3;:##,3 3 (#c3h)? @3 3 3333(** ****$3$5:$$$$*C*E#sE#s(O2K,L****/c/c////2c2c2222 ++++++++*.c.j.....#.*....  D T    488888  C C eCHo     D    +x}+%S/)B++++ 3 A39  3qk 3 8A; #$ 3 3 3 3 3 3r=