\hjdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZddlmZddlmZmZmZddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'm(Z(m)Z)ddl*m+Z+dd l,m-Z-dd l.m/Z/dd l0m1Z1dd l2m3Z3dd l4m5Z5m6Z6m7Z7ddl8m9Z9m:Z:ddl;mm?Z?m@Z@ddlAmBZBmCZCmDZDmEZEddlFmGZGmHZHmIZImJZJddlKmLZLerddlmMZMGddeMZNejePZQe deRZSe$eSeRe%eTeRffZUdIdeRdeTde$eReRffdZVdeRdeeReffdZWdeRdeXfdZYdedeXfd ZZd!e5de$eeReRfeeReRfffd"Z[d#e"eRde!eRfd$Z\d%eeUdee$eReReRffd&Z]d'eSd(eRdeRfd)Z^deRd(eRdeSfd*Z_d+eeeRd,eeSeSfd-e#eSd.eeRd(eRdeeUf d/Z`d0eeReRfdeeRfd1ZaGd2d3ZbGd4d5ZcGd6d7e1Zdd8eRddfd9ZeGd:d;e+Zf dJdeRd?e=d@eXdAeXdBe!e:dCeXddfdDZgejdEeRdedFfdGZi dJdeRd?e=dEeRd@eXdAeXdBe!e:dCeXddfdHZjy)KzGSupport for installing and building the "wheel" binary package format. N)urlsafe_b64encode)Message)chain filterfalsestarmap)IO TYPE_CHECKINGAnyBinaryIOCallableDict GeneratorIterableIteratorListNewTypeOptionalSequenceSetTupleUnioncast)ZipFileZipInfo) ScriptMaker)get_export_entry)canonicalize_name)InstallationError)get_major_minor_version)BaseDistributionFilesystemWheelget_wheel_distribution)DIRECT_URL_METADATA_NAME DirectUrl) SCHEME_KEYSScheme)adjacent_tmp_filereplace)captured_stdout ensure_dir hash_file partition) current_umaskis_within_directory2set_extracted_file_to_default_mode_plus_executablezip_item_is_executable) parse_wheel)Protocolc4eZdZUded<eed<eed<ddZy)File RecordPathsrc_record_path dest_pathchangedNcyNselfs i/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_internal/operations/install/wheel.pysavez File.saveFs returnN)__name__ __module__ __qualname____annotations__strboolr?r;r@r>r4r4As%%  r@r4r5path blocksizerBct||\}}dt|jjdj dz}|t |fS)z?Return (encoded_digest, length) for path using hashlib.sha256()zsha256=latin1=)r+rdigestdecoderstriprG)rIrJhlengthrNs r>rehashrSPsM$ *IAv *188:6==hGNNsS SF CK  r@modec|dddS)zPReturn keyword arguments to properly open a CSV file in the given mode. utf-8)rTnewlineencodingr;)rTs r> csv_io_kwargsrZWsRW ==r@c0tjj|sJt|d5}|j }|j ds dddyt jjt j}d|ztjjdz}|j}dddt|d5}|j|jdddy#1swYAxYw#1swYyxYw) zQReplace #!python with #!/path/to/python Return True if file was changed. rbs#!pythonNFs#!asciiwbT) osrIisfileopenreadline startswithsys executableencodegetfilesystemencodinglinesepreadwrite)rIscript firstlineexenamerests r> fix_scriptro^s 77>>$   dD VOO% ##K0..''(A(A(CDGObjj&7&7&@@ {{}  dD V Y T  s#DA&D#D D  DmetadatacH|jddjdk(S)NzRoot-Is-PurelibrVtrue)getlower)rps r>wheel_root_is_purelibrurs" <<)2 . 4 4 6& @@r@distci}i}|jD]T}|jdk(r|j||j<,|jdk(s<|j||j<V||fS)Nconsole_scripts gui_scripts)iter_entry_pointsgroupvaluename)rvrxry entry_points r>get_entrypointsrvszOK--/>    1 10;0A0AOK,, -   - /,7,=,=K (( ) > K ''r@scriptsc |sytjt}|D]T}tjj |}tjj |}||j|VtjjddjtjDcgc][}tjjtjj|jtj]}}|j!tjjtjjtjj t"j$|j'Dcic]F\}}tjjtjj||vr||H}}}|syg}|j'D]l\}} t)| } t+| dk(r d| dd} n,dj-d j/| dd d z| d z} |j!d | d |dnd} t+|dk(r!|j!| j-dn |j!| j-dt1dtjjddjtjD} | rd}|j!|dj/|Scc}wcc}}w)zDetermine if any scripts are not on PATH and format a warning. Returns a warning message if one or more scripts are not on PATH, otherwise None. NPATHrVzscript rz iszscripts {} are, z and zThe z installed in 'z' which is not on PATH.zeConsider adding {} to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.zthis directoryzthese directoriesc32K|]}|s|ddk(yw)r~Nr;).0is r> z4message_about_scripts_not_on_PATH..sQ! s ziNOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications. ) collections defaultdictsetr_rIdirnamebasenameaddenvironrssplitpathsepnormcasenormpathrPsepappendrdreitemssortedlenformatjoinany)rgrouped_by_dirdestfile parent_dir script_namer not_warn_dirswarn_for msg_lines dir_scriptssorted_scripts start_text last_line_fmtwarn_for_tildetilde_warning_msgs r>!message_about_scripts_not_on_PATHrs +6*A*A#*FN4WW__X. gg&&x0 z"&&{34+11"**=  ))!,-44RVV<M  ))"''//#..*IJK $2#7#7#9% J 77  BGG,,Z8 9 N G%H% I#+>>#3   K$*;$7 ~ ! #">!#4"5S9J)00 ."-.8>";MMJ :,oj\9P Q    C 9~--.>?@--.ABCZZ^^FB7==bjjIN =  *+ 99Y k%s5A L6 A L;outrowsc&td|DS)aNormalize the given rows of a RECORD file. Items in each row are converted into str. Rows are then sorted to make the value more predictable for tests. Each row is a 3-tuple (path, hash, size) and corresponds to a record of a RECORD file (see PEP 376 and PEP 427 for details). For the rows passed to this function, the size can be an integer as an int or string, or the empty string. c3@K|]\}}}||t|fywr:)rG)r record_pathhash_sizes r>rz&_normalized_outrows..s&,DKeSY's)r)rs r>_normalized_outrowsrs* HO r@rlib_dircBtjj||Sr:)r_rIr)rrs r>_record_to_fs_pathrs 77<< --r@cptjj|djtjj|djk(r tjj ||}|j tjj d}td|S)Nr/r5)r_rI splitdrivertrelpathr(rr)rIrs r>_fs_to_record_pathrs ww$"((*bgg.@.@.I!.L.R.R.TTwwtW- << S )D  d ##r@ old_csv_rows installedr8 generatedcg}|D]}t|dkDrtjd|td|d}|j ||}||vrt t ||\} } n*t|dkDr|dnd} t|dkDr|dnd} |j|| | f|D]0} t| |} t | \} } |j| | | f2||jD cgc]} | ddf c} zScc} w)z_ :param installed: A map from archive RECORD path to installation RECORD path. z,RECORD line has more than three elements: %sr5rrrV) rloggerwarningrpoprSrrrvalues)rrr8rrinstalled_rowsrowold_record_pathnew_record_pathrNrRfrIinstalled_record_paths r>get_csv_rows_for_installedrs(-/N A s8a< NNI3 O|SV4#--I g %#$6$PQNFF"3x!|SVF"3x!|SVF?@ A6!!W-tVV456 ENEUEUEW,A B' s2 Dconsolec^|j}g}|jdd}|rdtjvr|j d|ztjj dddk7r(|j dt jdd||j dtd||Dcgc]}tjd |s|}}|D]}||=|jd d}|rudtjvr|j d |z|j d td||Dcgc]}tjd |s|}}|D]}||=|jtdj|j|Scc}wcc}w)zk Given the mapping from entrypoint name to callable, return the relevant console script specs. pipNENSUREPIP_OPTIONSzpip = rV altinstallrz = zpip(\d+(\.\d+)?)?$ easy_installzeasy_install = z easy_install-zeasy_install(-\d+\.\d+)?${} = {})copyrr_rrrsrd version_inforrematchextendrrr)rscripts_to_generate pip_scriptkpip_epeasy_install_scripteasy_install_eps r>get_console_script_specsrs llnGFUD)J bjj 0  & &x*'< = ::>>-r 2l B  & &S-=-=a-@,AZL'Q R""S)@)B(C3zl#ST$K1F(J!KK A  !++nd; bjj 0  & &'8;N'N O""356c:M9N O  "((+G"KA  ! A  wy'7'7IJ +L s;F%F%F* F*c8eZdZdedededdfdZdefdZd dZ y) ZipBackedFiler6r7zip_filerBNc<||_||_||_d|_yNF)r6r7 _zip_filer8)r=r6r7rs r>__init__zZipBackedFile.__init___s! /"! r@cL|jj|jSr:)rgetinfor6r<s r>_getinfozZipBackedFile._getinfogs~~%%d&:&:;;r@c@tjj|j}t |tjj |jrtj |j|j}|jj|5}t|jd5}tj||ddddddt|rt|jyy#1swY3xYw#1swY7xYw)Nr^)r_rIrr7r*existsunlinkrrrashutil copyfileobjr0r/)r=rzipinfordests r>r?zZipBackedFile.savejsWW__T^^4 : 77>>$.. ) IIdnn %--/ ^^  ) ,Qdnnd+ ,t""1d+ , , "' * >t~~ N + , , , ,s$(D?DDD DDrA) rCrDrEr5rGrrrrr?r;r@r>rr^s9)69EL <'<Or@rceZdZddZddZy) ScriptFileNc||_|jj|_|jj|_d|_yr)_filer6r7r8)r=files r>rzScriptFile.__init__s3 #zz99-- r@cl|jjt|j|_yr:)rr?ror7r8r<s r>r?zScriptFile.saves  !$..1 r@)rr4rBNrA)rCrDrErr?r;r@r>rrs  2r@rc(eZdZdeddffd ZxZS)MissingCallableSuffixr~rBNc,t|d|dy)NzInvalid script entry point: z - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.)superr)r=r~ __class__s r>rzMissingCallableSuffix.__init__s! *;-8  r@)rCrDrErGr __classcell__rs@r>rrs C D  r@r specificationc`t|}|!|jtt|yyr:)rsuffixrrG)rentrys r>_raise_for_invalid_entrypointrs2 ] +E U\\1#CJ//2r@cFeZdZ ddedeeeefdeeffd ZxZ S)PipScriptMakerroptionsrBc:t|t| ||Sr:)rrmake)r=rrrs r>rzPipScriptMaker.makes &m4w|M733r@r:) rCrDrErGrr r rrrrs@r>rrs9FJ4 4+3DcN+C4 c44r@rr} wheel_zip wheel_pathscheme pycompilewarn_script_location direct_url requestedc ( 89:;<=>t||\}} t| r |j>n |j>i=t 9g} d,dt dt dtddf9=>fd } dt dtfd} d t d t ddffd 8d td t dtt gdff8fd } d tdtdtt gdff8fd }dt dtfd}ttt |j}t| |}t||\}}| |>}t!||}dt dtfd}t||\}}|||}t!||}t#||}t%t't)|}t+|\:fd }dt dt fd} |rt95}!t;j<5t;j>d|D]}"tAjB|"dd}#|#s| |"}$tDjFjI|$sJtd|$jKtDjFjLd}%| |%|$ ddddddtNjQ!jStUd|jV}&d|&_,dh|&_-d|&_.t_:}'tatcdjd|},tDjFj{|,d#}-|+|-5}.|.j}d$ddd| j|-|ttDjFj{|,t}/|+|/5}0|0j}|jjd%ddd| j|/|rGtDjFj{|,d&}1t|1d'5 ddd| j|1|jd(}2tatj|2j}3t|3=9| >)}4tDjFj{|,d(}5|+|5fitd*5}6tjtd+|6}7|7jt|4dddy#1swY9xYw#1swY>xYw#1swYxYw#1swYMxYw#1swYxYw#1swYyxYw)-aInstall a wheel. :param name: Name of the project to install :param wheel_zip: open ZipFile for wheel being installed :param scheme: Distutils scheme dictating the install directories :param req_description: String used in place of the requirement, for logging :param pycompile: Whether to byte-compile installed Python files :param warn_script_location: Whether to check that scripts are installed into a directory on PATH :raises UnsupportedWheel: * when the directory holds an unpacked wheel with incompatible Wheel-Version * when the .dist-info dir does not match the wheel srcfilermodifiedrBNcPt|}||<|rj|yy)z6Map archive RECORD paths to installation RECORD paths.N)rr)rrrnewpathr8rrs r>record_installedz(_install_wheel..record_installeds/%Xw7$ '  KK  r@rIc$|jdS)Nr)endswithrIs r> is_dir_pathz#_install_wheel..is_dir_paths}}S!!r@ dest_dir_path target_pathcZt||sd}t|j||y)NzRThe wheel {!r} has a file {!r} trying to install outside the target directory {!r})r.rr)rrmessager s r>assert_no_path_traversalz0_install_wheel..assert_no_path_traversals;"=+>5 $z; F  ?r@rrr4c,dtddffd }|S)NrrBr4ctjj|}tjj|}|t ||Sr:)r_rIrrr)r normed_pathr7rrrs r>make_root_scheme_filezM_install_wheel..root_scheme_file_maker..make_root_scheme_filesD''**;7K T;7I $T9 5 iB Br@)r5)rrr!rs`` r>root_scheme_file_makerz._install_wheel..root_scheme_file_makers! Cz Cf C %$r@r cvtDcic]}|t||c}dtddffd }|Scc}w)NrrBr4ctjj|} |jtjjd\}}} |}tjj||} ||t|| S#t $rdj |}t|wxYw#t$r:djt }dj |||}t|wxYw)NrzbUnexpected file in {}: {!r}. .data directory contents should be named like: '/'.rzUnknown scheme key used in {}: {} (for file {!r}). .data directory contents should be in subdirectories named with a valid scheme key ({})) r_rIrrr ValueErrorrrKeyErrorrrr) rr _ scheme_key dest_subpathr scheme_pathvalid_scheme_keysr7r scheme_pathsr rs r>make_data_scheme_filezM_install_wheel..data_scheme_file_maker..make_data_scheme_files''**;7K 1.9.?.? Q.O+:| 1*:6  [,?I $[) < iB B) 1D&[1(00  1 1$(IIf\.B$C!4&Z>OP  (00 1s.B B6 'B36AC9)r%getattrr5)rr keyr-r,rr s` @r>data_scheme_file_makerz._install_wheel..data_scheme_file_makersL>IIcWVS11I  Cz Cf C C4%$9Js6cJ|jdddjdS)Nrrr.data)rrrs r>is_data_scheme_pathz+_install_wheel..is_data_scheme_paths#zz#q!!$--g66r@c|jdd}t|dkDxr|djdxr|ddk(S)Nrrrr2rr)rrr)rIpartss r>is_script_scheme_pathz-_install_wheel..is_script_scheme_pathsB 3"5zA~V%("3"3G"<VqYAVVr@rcP|j}tjj|}|j j dr|dd}nL|j j dr|dd}n'|j j dr|dd}n|}|vxs|vS)Nz.exez -script.pyiz.pya)r7r_rIrrtr)rrIr} matchnamerguis r>is_entrypoint_wrapperz-_install_wheel..is_entrypoint_wrapper1s~~ww% ::<  (Sb I ZZ\ " "< 0Tc I ZZ\ " "6 *Sb IIG#7yC'77r@c3KttjD]X}tjj |}tjj |sC|jdsU|Zyw)Nz.py)rrrr_rIrr`r)installed_pathfull_installed_pathrrs r>pyc_source_file_pathsz-_install_wheel..pyc_source_file_pathsLsk %S)9)9);%<= &N"$'',,w"G 77>>"56&//6% %  &sA?Bc@tjj|S)z8Return the path the pyc file would have been written to.) importlibutilcache_from_sourcers r>pyc_output_pathz'_install_wheel..pyc_output_pathYs~~//55r@ignoreT)forcequietr5rrVrr:ikwargsc;Kt|fi|5}|dddtjjt |j|y#1swY@xYwwr:)r'r_chmodr}r()rIrHrgenerated_file_modes r>_generate_filez&_install_wheel.._generate_filesP t .v . !G  ,-  s A A?A AA  INSTALLERspip rW REQUESTEDr^RECORD)rr8rrwzIO[str])F)Mr1rupurelibplatlibrr5rGrHrr r&rrnamelistrr,maprr"r!rrrr?r6r7r8rr)warningscatch_warningsfilterwarnings compileall compile_filer_rIrr(rrdebuggetvaluerrclobbervariantsset_moderlistrrr make_multiplerrrr- contextlibcontextmanagerr r rrjrr#to_jsonrfra read_textcsvreader splitlinesrrZwriter writerowsr)?r}rr r r r r rinfo_dirrprrrr"r0r3paths file_pathsroot_scheme_pathsdata_scheme_pathsr!filesr6other_scheme_pathsscript_scheme_pathsr-other_scheme_files distributionr;script_scheme_filesrr?rDstdoutrIsuccesspyc_pathpyc_record_pathmakerrgui_scripts_to_generategenerated_console_scriptsmsgrL dest_info_dirinstaller_pathinstaller_filedirect_url_pathdirect_url_filerequested_path record_text record_rowsrowsr record_filerhrr8rrKr:rrs? ` @@@@@@@r>_install_wheelrsN2%Y5HhX&.... /1I"uGI>C!!'*!6:! !"*""#$ % %!$ % :,& ' %%%#)% :,& '%B7*77 j!9#5#5#7 8E[%0J+45H*+U((29gF 57HIEWJW4W/80/++39fE24FG %+ ,E* #$L#<0LGS8F8t8 +.2+&&;=PQj*=> %, -EM --t~~t||LM &9S$_#= &6c6c6    D&((* D''113DD(55d$dSG#24#8!ww~~h777*.((*:*:277;;*L+)(CD D D  V__&' 4 0EEM TEN EN37;"79+;+;SYY[#IJ % 3 34G H ./ U(()@5$-PQ/0IJ ? NN3 =?"22SCIhd>R4S GGLL(3MWW\\-=N  ''>X&' ^$'',,}6NO O , H  ! !*"4"4"6"="=g"F G H)m[A .$ '   (((2Kszz+"8"8":;req_error_contextrsE0 0o.b <(a/0s; ; 8!38;c t|d5}t|5t||||||||ddddddy#1swYxYw#1swYyxYw)NT) allowZip64)r}rr r r r r r)rrr) r}r r rr r r rzs r> install_wheelrsg  -   /  %#%9%#        s A ?A A A  A)i)TTNF)k__doc__rrXrarerAloggingos.pathr_rrrdrUbase64r email.messager itertoolsrrrtypingrr r r r r rrrrrrrrrrrzipfilerrpip._vendor.distlib.scriptsrpip._vendor.distlib.utilrpip._vendor.packaging.utilsrpip._internal.exceptionsrpip._internal.locationsrpip._internal.metadatar r!r"pip._internal.models.direct_urlr#r$pip._internal.models.schemer%r&pip._internal.utils.filesystemr'r(pip._internal.utils.miscr)r*r+r,pip._internal.utils.unpackingr-r.r/r0pip._internal.utils.wheelr1r2r4 getLoggerrCrrGr5intInstalledCSVRowrSrZrHrorurrrrrrrrrrrrrrbrrr;r@r>rs  $!11&%3596; P;EVV 2x   8 $ \3 '  CsCx89!!!5c?!>>S#X>ST(AGAA(*(uT#s(^T#s(^5S/T(E x}E #E P o & %S# 4.J...$S$3$:$tCy/J *+_Cy     / @Jd38nJcJZ%O%OP 2 2 - 000 4[4!%&*S4 S4S4S4  S4  S4  S4#S4S4 S4l 0s0y9I/J00!%&*       # r@