+
    3j                        R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^ RIHtHt ^ RIt^ RIHt ^ RIHt ^RIHt ^R	IHt ^R
IHtHt ^tRt^t^t ! R R]4      tR# )z
The 'new' conda format, introduced in late 2018/early 2019.

https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html
)annotationsN)Callable)closing)
ZIP_STOREDZipFile)stream_conda_component)conda_reader_for_url)utils)AbstractBaseFormat)_extract_listc                      ] tR t^#tRt]R 4       t]R 4       t]RR l4       t]RRRRR/R R	 lll4       t	]R
 4       t
]RR l4       t]RR l4       tRtR# )CondaFormat_v2zIf there's another conda format or breaking changes, please create a new class and keep this
one, so that handling of v2 stays working.c                	$    V P                  R 4      # ).conda)endswith)fns   &@lib/python3.14/site-packages/conda_package_handling/conda_fmt.py	supportedCondaFormat_v2.supported'   s    {{8$$    c                	   \         P                  ! VP                  R 4      4      ;'       g    Rp\        P                  P                  V 4      '       gQ   \        P                  P                  \        P                  P                  \        P                  ! 4       V 4      4      p \        P                  P                  V4      '       g   \        P                  ! V4       \        \        V 4      \        V4      VR7       R# )
componentsr   Ninfopkg)r	   ensure_listgetospathisabsnormpathjoingetcwdisdirmakedirsr   str)r   dest_dirkwr   s   &&, r   extractCondaFormat_v2.extract+   s    &&rvvl';<OO
ww}}R  !!"'',,ryy{B"?@Bww}}X&&KK!R#h-J?r   Nc                	2    \         P                  WR .R7      # )r   r   )r   r*   )r   r(   s   &&r   extract_infoCondaFormat_v2.extract_info5   s    %%bx%HHr   
compressorcompression_tuplec                   V ^8  d   QhRR/# )   r/   z-Callable[[], zstandard.ZstdCompressor] | None )formats   "r   __annotate__CondaFormat_v2.__annotate__:   s     [ [ B[r   c               	f  a Vf   \         P                  ! 4       p\         P                  P                  V4      '       d?   \         P                  P	                  V4      p\         P                  P                  V4      p\         P                  P                  W24      pVR \        R4      )  p. . rV F2  p\        P                  ! V4      '       d   T
MT	P                  V4       K4  	  V'       d   VR8w  d   \        R4      hVf.   R pVw  roS'       d   SP                  R4      '       d   V3R lp ! R R4      p\        VR\        R	7      ;_uu_ 4       p\        P                  ! V 4      ;_uu_ 4        R
\         /pVP#                  R\$        P&                  ! V4      4       RV R2V	3RV R2V
33pV! 4       pV EF  w  pp\(        P*                  ! V! 4       RR7      ;_uu_ 4       pV F$  pVP-                  V\        P.                  R7       K&  	  R R R 4       XP0                  P2                  pVP5                  VRRR7      ;_uu_ 4       pVP7                  VVRR7      p\(        P*                  ! VRR7      pV F$  pVP-                  V\        P.                  R7       K&  	  VP9                  4        VP9                  4        R R R 4       EK  	  R R R 4       R R R 4       V#   + '       g   i     L; i  + '       g   i     EKL  ; i  + '       g   i     LB; i  + '       g   i     T# ; i)Nr   z<Supply one of compressor= or (deprecated) compression_tuple=c                 B    \         P                  ! \        \        R 7      # )levelthreads)	zstandardZstdCompressorZSTD_COMPRESS_LEVELZSTD_COMPRESS_THREADSr3   r   r   <lambda>'CondaFormat_v2.create.<locals>.<lambda>S   s    !9!9)-"r   zzstd:compression-level=c                 |   < \         P                  ! \        S P                  R ^4      R,          4      \        R7      # )=r9   )r<   r=   intsplitr?   )filter_optss   r   r@   rA   [   s-    Y%=%=k//Q7;<1&r   c                  ,    ] tR t^`tRtR tR tR tRtR# ))CondaFormat_v2.create.<locals>.NullWriterz4
zstd uses less memory on extract if size is known.
c                	    ^ V n         R# )    Nsizeselfs   &r   __init__2CondaFormat_v2.create.<locals>.NullWriter.__init__e   s	    	r   c                	\    V ;P                   \        V4      ,          un         \        V4      # N)rM   len)rO   bytess   &&r   write/CondaFormat_v2.create.<locals>.NullWriter.writeh   s    		SZ'	5z!r   c                	    V P                   # rS   rL   rN   s   &r   tell.CondaFormat_v2.create.<locals>.NullWriter.telll   s    yy r   rL   N)	__name__
__module____qualname____firstlineno____doc__rP   rV   rY   __static_attributes__r3   r   r   
NullWriterrI   `   s    "!r   ra   w)compressionconda_pkg_format_versionzmetadata.jsonzpkg-.tar.zstzinfo-)fileobjmode)filterT)force_zip64F)rM   closefdNNN)r   r$   r    r!   dirnamebasenamer#   rT   r	   is_info_member_pathappend
ValueError
startswithr   r   	tmp_chdirCONDA_PACKAGE_FORMAT_VERSIONwritestrjsondumpstarfileTarFileaddanonymize_tarinforf   rM   openstream_writerclose)prefix	file_listout_fn
out_folderr/   r0   r)   conda_pkg_fnfile_id	pkg_files
info_filesfextcomp_filterra   
conda_filepkg_metadatacomponents_filescompress	componentfilessizerfilerM   component_filecomponent_streamcomponent_tarrG   s   &&&&$$,                    @r   createCondaFormat_v2.create9   s    J77==  0JWW%%f-Fww||J7)CM>* "B:A 44Q77ZYNNqQ  ,0BB[\\J ->)Ck{556OPP

	! 	!  L#:>>*OOF##68TULL1IJ y)95G9H-  "|H$4 	5 __Z\DD %		$u/F/F	G !& E }}))__Y_FF.'/'='=&T5 (> ($ %,OO<LSV$WM %%))$u7N7N)O !& "'')$**, GF %5 $ ?J % ED
 GFF/ $# ?>J sV   L5A4L	)+K$:L	A7K7L	L$K4/L	7L	
L	LLL0	c                	    \         P                  ! V 4      pVP                  p\        P                  ! V R4      w  r4RVR VRV/# )md5sha256rM   )r   r   )r   statst_sizer	   	checksums)in_filestat_resultrM   r   r   s   &    r   get_pkg_detailsCondaFormat_v2.get_pkg_details   sA    ggg&""oog/@AeS(F;;r   c                	:   \         P                  ! VP                  R 4      4      ;'       g    RpRV9   d   V P                  WVR7      # \        P
                  P                  V4      '       g    \        P
                  P                  V4      p\        WVR7       R# )r   z://)r   verboseNr   )	r	   r   r   _list_remote_contentsr   r    r!   abspathr   )clsr   r   r)   r   s   &&&, r   list_contentsCondaFormat_v2.list_contents   sp    &&rvvl';<OO
B;,,RPW,XXww}}R  $Bb9r   c                   \         P                  ! T;'       g    R4      p/ p\        V 4      w  rE\        V4      ;_uu_ 4        \	        WERR7       EF  w  rgVP
                  VP                  4       '       d   RMR,           pRV9   d   Rp	V'       d   \        P                  ! VP                  4       RVP                  ;'       g    VP                   RVP                  ;'       g    VP                   RVP                  R R2p	V	\        P                   ! R\        P"                  ! VP$                  4      4      ,          p	W,           W8&   RV9   g   EK  VP
                  R	8X  g   EK  \&        P(                  ! VP+                  V4      P-                  4       P/                  4       4      p
V
P1                  R
^4      ^8X  g   Q V
4       hV
P1                  RR4       F5  pRp	V'       d   VR,          pRVR R2p	WR,          ,           W8R,          &   K7  	  EK  	  RRR4       \3        \5        VP7                  4       4       UU	u. uF  w  rV	NK	  	  up	pRR/  R#   + '       g   i     LH; iu up	pi )z
List contents of a remote .conda artifact (by URL). It only fetches the 'info' component
and uses the metadata to infer details of the 'pkg' component. Some fields like
modification time or permissions will be missing in verbose mode.
r   r   )r   /  10dz%Y-%m-%d %H:%M:%S zinfo/paths.jsonpaths_versionpathssize_in_bytesz?????????? ?/? z ????-??-?? ??:??:?? _pathNsep
r   r3   )r	   r   r   r   r   namer%   r   filemoderg   unameuidgnamegidrM   timestrftime	localtimemtimeru   loadsextractfilereaddecoder   printsorteditems)urlr   r   linesfilenamecondatarmemberr    linedatarM   _s   &&&          r   r   $CondaFormat_v2._list_remote_contents   s    &&z'D'D_E
.s3U^^5hQWXX{{V\\^^cDZ'D#}}V[[9:!%||99vzz:!FLL<V<VFJJ;WWX%{{3/q2 
 .BDNNSYS_S_D` aa"&+EKJ&6;;:K+K::coof&=&B&B&D&K&K&MND88OQ71<BdB< $" 5!"#'#8D%4T#J>S#TD/37m/C7m, !6  Y , 	F5;;=$9:$9$9:EE- ^, ;s3   AI3I I(A(II*B/II,
I)	r3   rS   rk   )F)Fr   )r[   r\   r]   r^   r_   staticmethodr   r*   r-   r   r   classmethodr   r   r`   r3   r   r   r   r   #   s    2 % % @ @ I I [ EI[ -[ [z < < : : F Fr   r   )re   zstdzzstd:compression-level=19) r_   
__future__r   ru   r   r   rw   r   collections.abcr   
contextlibr   zipfiler   r   r<   )conda_package_streaming.package_streamingr   conda_package_streaming.urlr   r   r	   	interfacer
   	streamingr   r   rs   DEFAULT_COMPRESSION_TUPLEr>   r?   r   r3   r   r   <module>r      sd    #  	    $  '  L <  ) &  M    eF' eFr   