2bi`$%SSKrSSKrSSKrSSKrSSKrSSKrSSKJrJ r SSK J r SSK J r JrJrJrJrJrJrJr SSKJrJr \R0"\5r\"SSS9r\"S S S S 9rSq\\\S '\ S\S4Sj5r"SS5r Sq!\\ \S'\ S\\ SS44Sj5r""SS5r#\#"5r$"SS5r%"SS\%5r&g)N) ExitStackcontextmanager)Path)AnyCallableDict GeneratorListOptionalTypeVarUnion)enumrmtree_T TempDirectory)boundz build-envzephem-wheel-cachez req-build) BUILD_ENVEPHEM_WHEEL_CACHE REQ_BUILD_tempdir_managerreturn)NNNc## [5n[UsnqSv UqSSS5 g!Uqf=f!,(df  g=f7fN)rr)stackold_tempdir_managers ڎ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/utils/temp_dir.pyglobal_tempdir_managerr'sB 0@%-- 3 2   3  s' A /(/ A,/ =AcJ\rSrSrSrS SjrS\S\SS4SjrS\S\4S jr S r g) TempDirectoryTypeRegistry2zManages temp directory behaviorrNc0Ulgr_should_deleteselfs r__init__"TempDirectoryTypeRegistry.__init__5s /1kindvaluec X RU'g)zKIndicate whether a TempDirectory of the given kind should be auto-deleted. Nr")r%r)r*s r set_delete$TempDirectoryTypeRegistry.set_delete8s%*D!r(c:URRUS5$)zNGet configured auto-delete flag for a given TempDirectory type, default True. T)r#get)r%r)s r get_delete$TempDirectoryTypeRegistry.get_delete>s""&&tT22r(r"rN) __name__ __module__ __qualname____firstlineno____doc__r&strboolr,r0__static_attributes__r(rrr2s7)2*s*4*D* 3s3t3r(r_tempdir_registryc#P# [n[5q[v Uqg!Uqf=f7f)zmProvides a scoped global tempdir registry that can be used to dictate whether directories should be deleted. N)r<r)old_tempdir_registrys rtempdir_registryr?Hs. -13100s&&#&c\rSrSrSrg)_DefaultVr;N)r3r4r5r6r:r;r(rrArAVsr(rAc ^\rSrSrSrS\SSS4S\\S\\ S\ 4S \S \ S \ 4 U4S jjjr \ S \4Sj5r S \4SjrS\S \4SjrS\S\S\S S4SjrS \S \4SjrSSjrSrU=r$)r]aHelper class that owns and cleans up a temporary directory. This class can be used as a context manager or as an OO representation of a temporary directory. Attributes: path Location to the created temporary directory delete Whether the directory should be deleted when exiting (when used as a contextmanager) Methods: cleanup() Deletes the temporary directory When used as a context manager, if the delete attribute is True, on exiting the context the temporary directory is deleted. NtempFTpathdeleter)globally_managedignore_cleanup_errorsc>[TU]5 U[LaUbSnOSnUcURU5nXlSUlX lX0lXPlU(a[ce[RU5 gg)NF) superr&_default_create_path_deletedrGr)rIr enter_context)r%rFrGr)rHrI __class__s rr&TempDirectory.__init__rs  X  <<<%D    %:" #/ //  * *4 0 r(rcdUR(aSUR35eUR$)Nz"Attempted to access deleted path: )rOrNr$s rrFTempDirectory.paths*==S$Ftzzl"SS zzr(cRSURRSUR<S3$)N< >)rQr3rFr$s r__repr__TempDirectory.__repr__s&4>>**+1TYYM;;r(r%cU$rr;r$s r __enter__TempDirectory.__enter__s r(excr*tbcURb URnO-[(a [RUR5nOSnU(aUR 5 gg)NT)rGr<r0r)cleanup)r%r^r*r_rGs r__exit__TempDirectory.__exit__sE ;; "[[F  &11$))[URS S 9 T(a![RS UR5 gg[UR5 g![a [URUS 9 N_f=f) z6Remove the temporary directory created and reset stateTNfunc.rFexc_valrc~>SR[R"[U5U55nUR 5nU[ R [ R[ R4;a[RSUU5 O![RSURU5 TRU5 g)z/Log a warning for a `rmtree` error and continue z2Failed to remove a temporary file '%s' due to %s. z%s failed with %s.N) join tracebackformat_exception_onlytyperstriprjunlinkremovermdirrnror5append)rrrFrs formatted_excerrorss ronerror&TempDirectory.cleanup..onerrors !II//W wGM*002M 299bhh77 I!  143D3DmT MM' "r(F) ignore_errors)onexcz[Failed to remove contents in a temporary directory '%s'. You can safely remove it manually.)rOrjrFexistsrNrrr BaseExceptionrIrOSErrorrnwarning)r%rrs @rraTempDirectory.cleanups ww~~djj)) &( #38$ # ## #  #(  % % 2tzz79JJ 4::  2tzz1 2s1CC%$C%)rOrNrGrIr)r2)r3r4r5r6r7rLr r8r r9rAr&propertyrFrYrr\rrbrMrar: __classcell__rQs@rrr]s,#.6!&&* !1sm!1dD(*+!1 !1  !1 $ !1!1Fc<#<r C    CC**r(c^\rSrSrSrSrSS\S\\SS4U4Sjjjr \ S \S\ \SS44S j5r S \S\4S jr S rU=r$)AdjacentTempDirectoryaHelper class that creates a temporary directory adjacent to a real one. Attributes: original The original directory to create a temp directory for. path After calling create() or entering, contains the full path to the temporary directory. delete Whether the directory should be deleted when exiting (when used as a contextmanager) z-~.=%0123456789NoriginalrGrcL>URS5Ul[TU] US9 g)Nz/\)rG)rzrrKr&)r%rrGrQs rr&AdjacentTempDirectory.__init__s# .  'r(namec## [S[U55HRn[R"URUS- 5H'nSSR U5-XS-nXA:wdM#Uv M) MT [[UR55HMn[R"URU5H%nSSR U5-U-nXA:wdM!Uv M' MO g7f)zGenerates a series of temporary names. The algorithm replaces the leading characters in the name with ones that are valid filesystem characters, but are not valid package names (for both Python and pip definitions of package). ~N)rangelen itertoolscombinations_with_replacement LEADING_CHARSrv)clsri candidatenew_names r_generate_names%AdjacentTempDirectory._generate_namessq#d)$A&DD!!1q5 !33d2h>#"N %s3,,-.A&DD!!1 !33d:#"N /sAC"A+C Cr)c:[RRUR5up#UR U5HXn[RR X$5n[R "U5 [RRU5n O7 [RR[R"SUS3S95n[RSU5 U$![a*nUR[R:waeSnAMSnAff=f)Nrerfrgri)rjrFsplitrrrvmkdirrkrerrnoEEXISTrlrmrnro)r%r)rootrrrFexs rrMAdjacentTempDirectory._createsWW]]4==1 --d3I77<<0D  ww''-477##H$4$4d4&N$KLD 6=  88u||+, s C&& D0DD)rr)r3r4r5r6r7rr8r r9r& classmethodr rrMr:rrs@rrrsw &&M((htn(((#3#9S$_+E##2CCr(r)'rrloggingos.pathrjrlrw contextlibrrpathlibrtypingrrrr r r r r pip._internal.utils.miscrr getLoggerr3rnr tempdir_kindsr__annotations__rrr<r?rArLrrr;r(rrs 0   2   8 $ T) ) )-(9%,3 *: ;3333&:>856= 1)$=tT$IJ 1 1   :BBJFMFr(