+
    kGj ,                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI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 ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHtHtH t  ^ RI!H"t"H#t# ^ RI$H%t% ^ RI&H't' ^ RI(H)t) ]PT                  ! ]+4      t,R t-R R lt.R 3R lt/R t0R R R llt1R!R R llt2R"R R llt3R R lt4R#R R llt5R# )$zH
Create .conda packages from wheels.

Create wheels from pypa projects.
)annotationsN)PathDistribution)Path)Iterable)ProjectBuilder)on_win)win_path_to_unix)conda_builder)parse_wheel_filename)dependencies	installerpaths)PathTypesha256_checksum)copy_into_info_licenses)CondaMetadata)sha256_as_base64urlc                    V P                   P                  R4      '       d   R# ^ ;V n        V n        R;V n        V n        V # )z1
Anonymize uid/gid and exclude .git directories.
.gitN )nameendswithuidgidunamegname)tarinfos   &0lib/python3.14/site-packages/conda_pypi/build.pyfilterr   &   s=     ||V$$ !!GK'+$&&GMGMN    c                   V ^8  d   QhRR/# )   basez
Path | str )formats   "r   __annotate__r%   2   s      Z r   c                    \        V 4      p V P                  \        P                  4      '       g   V \        P                  ,           p R\	        \        W 4      R R7      R^/# )zB
Build simple paths.json with only 'hardlink' or 'symlink' types.
r   c                    V R ,          # _pathr#   entrys   &r   <lambda>paths_json.<locals>.<lambda><   s    eGnr   keypaths_version)strr   ossepsorted_paths)r"   s   &r   
paths_jsonr6   2   sP     t9D==  bff} 	t*0LM r   c                     V P                   R 8g  # )r   )r   )xs   &r   r,   r,   A   s    &(8r   c           
   #    "   \         P                  ! V4       EFA  pVP                  \        V 4      R  p\        '       d   \        V4      pVR8X  g   V! V4      '       g   KJ  VP                  4       '       d"   \        WP                  VR7       R j  xL
  K  VP                  4       '       g   VP                  4       '       d|    VP                  4       P                  pRTR\        VP                  4       '       d   \        P                  M\        P                   4      R\#        VP                  V4      RV/x  EK(  \$        P'                  RV R24       EKD  	  R #  L  \         d    ^ p Li ; i5i)	Ninfo)r   r)   	path_typesha256size_in_byteszNot regular file '')r2   scandirpathlenr   r   is_dirr5   is_file
is_symlinkstatst_sizeFileNotFoundErrorr1   r   softlinkhardlinkr   logdebug)r"   r@   r   r+   relative_pathrF   s   &&&   r   r5   r5   A   s    D!

3t9;/6,];MF"&--<<>>dJJv>>>]]__ 0 0 2 2**,.. Se6F6F6H6H!2!2hN_N_`/%**e<	  II*5'34) " ? % sI   AE6!E69E6E!E60E6E#!BE6#E30E62E33E6c                4    \         P                  ! V ^RR7      # )z
Consistent json formatting.
T)indent	sort_keys)jsondumps)objects   &r   
json_dumpsrS   Z   s     ::fQ$77r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r!   tarztarfile.TarFiler   r1   databytesmodeintreturnNoner#   )r$   s   "r   r%   r%   a   s0     , ,_ ,C ,u ,C ,TX ,r   c                    \         P                  ! V4      p\        V4      Vn        W4n        V P                  V\        P                  ! V4      4       R # )N)tarfileTarInforA   sizerX   addfileioBytesIO)rU   r   rV   rX   tar_infos   &&&& r   _add_to_tarrd   a   s7    t$HIHMMKK"**T*+r   c               $    V ^8  d   QhRRRRRR/# )r!   r@   r   prefixyesboolr#   )r$   s   "r   r%   r%   i   s(     ( (
( (
 
(r   c                  aa \        \        P                  ! S4      4      p\        WR7      pVV3R lpVP                  p\
        P                  RV 24       V! V4       VP                  V4      p	\
        P                  RV RV	 24       V! V	4       VP                  W14      p
\
        P                  RV
 24       V
# )z/
Args:
    distribution: "editable" or "wheel"
)python_executablec                2  < \        ^4       F@  p \        P                  ! V SR7      pV'       d   \        P                  ! VSSR7       K?   R# 	  R#   \        P                   d/   p\        P                  ! TP                  SSR7        Rp?K  Rp?ii ; i)zW
Check if requirements are missing. If so, invoke conda to install into target prefix.
rf   )rf   rg   N)ranger   check_dependenciesensure_requirementsMissingDependencyError)requirements_retrymissingerf   rg   s   &   r   install_missing#build_pypa.<locals>.install_missingx   s{     AhFY&99,vV 44WVQTU   66 Y00TWXXYs   9AB(#BBz&Ensure requirements for build system: zAdditional requirements for z: zThe wheel is at )	r1   r   get_python_executabler   build_system_requiresrJ   rK   get_requires_for_buildbuild)r@   output_pathrf   distributionrg   rj   builderru   rx   rq   editable_files   &&f&f      r   
build_pypar   i   s     E77?@TGGY $99II67L6MNO)*11,?LII,\N"\NKLL!MM,<MII 01r   c               8    V ^8  d   QhRRRRRRRRRRRR	R
RRR/# )r!   whlr   
build_pathr{   project_pathPath | Nonetest_dirpypi_to_conda_name_mappingdict | NonechannelsIterable[str]rZ   r#   )r$   s   "r   r%   r%      sb     j, j,	j,j, j,
 j, j, !,j, j, 
j,r   c	                P	   VP                  4       '       g   VP                  4        \        P                  ! V 4      ;_uu_ 4       p	\        P
                  ! R R7      ;_uu_ 4       p
\        V P                  4      pVP                   RVP                   R2p\        V
4      pV R2pV	P                  4        F7  pVP                  P                  V4      '       g   K&  V	P                  W4       K9  	  W,          pV	P                  4        \         P"                  ! \%        V4      VVR7      pVP&                  P)                  4       pVR,           RVR,           RVR,           2p\+        VV4      ;_uu_ 4       p\,        P.                  ! W0V4      p\1        VR	\3        V4      P5                  R
4      4       \1        VR\3        VP6                  4      P5                  R
4      4       VR,          p\9        VVVP:                  4       VR,          pVP                  4       '       dw   \=        VP?                  R4      4       FX  pVPA                  4       '       g   K  VPC                  V4      PE                  4       p\1        VRV 2VPG                  4       4       KZ  	  VPI                  4       ;p'       d&   \1        VR\3        V4      P5                  R
4      4       V'       d   VPK                  4       PM                  4       p\N        PP                  ! RRV/RV/4      P5                  R
4      pRV R2p\1        VVV4       VPS                  RVR\U        \V        PX                  4      R\Z        P\                  ! V4      P_                  4       R\a        V4      /4       V'       dw   \=        VP?                  R4      4       FX  pVPA                  4       '       g   K  VPC                  V4      PE                  4       p\1        VRV 2VPG                  4       4       KZ  	  \3        R\=        VR R7      R^/4      P5                  R
4      p\1        VRV4       R R R 4       R R R 4       R R R 4       VX R!2,          #   + '       g   i     L,; i  + '       g   i     L7; i  + '       g   i     LB; i)"z	dist-inforl   -z
.dist-info/)r   r   versionrz   zinfo/index.jsonutf-8zinfo/about.jsonr:   licenses*zinfo/zinfo/link.jsondir_infoeditableurlzsite-packages/z/direct_url.jsonr)   r;   r<   r=   z
info/test/r   c                    V R ,          # r(   r#   r*   s   &r   r,   build_conda.<locals>.<lambda>   s    U7^r   r.   r0   zinfo/paths.jsonNz.conda)1existsmkdirzipfileZipFiletempfileTemporaryDirectoryr
   r   r|   r   r   infolistfilename
startswithextractcloser   from_distributionr   package_recordto_index_jsonr	   r   install_installer_to_tarrd   rS   encodeaboutr   metadatar4   rglobrC   relative_toas_posix
read_bytes	link_jsonabsoluteas_urirP   rQ   appendr1   r   rI   hashlibr<   	hexdigestrA   ) r   r   r{   rj   r   r   is_editabler   r   	wheel_zipdist_info_tmpparseddist_info_namedist_info_tmp_pathrf   zip_info	dist_infor   recordfile_idrU   package_pathsinfo_tmplicenses_dirlicense_pathrelr   
direct_urldirect_url_bytesdirect_url_member	test_path
paths_datas    &&&&&&&&&                       r   build_condar      s     		##;77=%chh/"//0&..1AL!-0"#1%!**,H  ++F33!!(? - '7	
 !22Y'&

 ((668F^$AfY&7%8&/9JK 7K00C%>>?PWZ[M
 .
60B0I0I'0RS.
8>>0J0Q0QRY0Z[!F*H#Ix9J9JK#j0L""$$$*<+=+=c+B$CL'//11 &228<EEGCuSE]L4K4K4MN	 %D %..00y0C!1:i3H3O3OPW3XY )224;;=
#'::*k!:E:N$&/ ! '5^4DDT$U!C!24DE$$!2#S):):%; '..1A"B"L"L"N'-=)>	 !'s(;!<I$,,.. #//9BBDCz#%79M9M9OP	 "= $VM7ST#Q
 fWo  .
;s 1? 	8 	v G9F+++w 10? 	87 	sY    R%A3R	BR	9D8Q/2,Q/B>Q/B-Q/R	R/Q?:R	RRR%	c               $    V ^8  d   QhRRRRRR/# )r!   record_pathr   	base_pathchanged_pathr#   )r$   s   "r   r%   r%     s!     & &t & &D &r   c                R   V P                  4       p\        \        P                  ! VP	                  4       4      4      p\        VP                  V4      4      P                  \        P                  R4      pV FK  pV^ ,          V8X  g   K  VP                  4       pR\        V4       2V^&   \        \        V4      4      V^&   KM  	  V P                  RRRR7      ;_uu_ 4       p\        P                  ! V4      p	V	P                  V4       RRR4       R#   + '       g   i     R# ; i)z:
Rewrite RECORD with new size, checksum for updated_file.
r   zsha256=wr   r   )rX   newlineencodingN)	read_textlistcsvreader
splitlinesr1   r   replacer2   r3   r   r   rA   openwriter	writerows)
r   r   r   record_textrecord_rowsrelpathrowrV   record_filer   s
   &&&       r   update_RECORDr     s    
 '')Kszz+"8"8":;<K,**956>>rvvsKGq6W**,D2489:CFT^CF	  
		sB		A	A[K(% 
B	A	A	As   #(DD&	c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r!   rf   r   r{   r   r   r   r   r   r   rg   rh   r#   )r$   s   "r   r%   r%     sF     + ++ 	+
 + !,+ + 
+r   c                   \        V 4      p V'       g0   V R ,          pVP                  4       '       g   VP                  4        \        P                  ! RR7      ;_uu_ 4       p\        V4      p\        \        V 4      VVVVR7      p	VR ,          p
\        \        V	4      T
T;'       g    T\        P                  V VVR8H  VVR7	      pRRR4       V#   + '       g   i     X# ; i)rz   condarl   )rf   r|   rg   r   )r   r   r   r   r   N)	r   r   r   r   r   r   r   sys
executable)projectrf   r|   r{   r   r   r   rg   tmp_pathnormal_wheelr   package_condas   &&&&&&&&    r   pypa_to_condar     s     7mG '!!##		$	$G	4	4>!M%
 '
###8NN $
2'A

 
52 3 
5	42 s   "A&CC#	)i  )r   T)NNFNr#   )r   NNNr#   T)6__doc__
__future__r   r   r   ra   rP   loggingr2   r   r]   r   r   importlib.metadatar   pathlibr   typingr   rz   r   conda.common.compatr   conda.common.path.windowsr   conda_package_streaming.creater	   installer.utilsr
   
conda_pypir   r   r   conda_pypi.conda_build_utilsr   r   conda_pypi.license_filesr   conda_pypi.translater   conda_pypi.utilsr   	getLogger__name__rJ   r   r6   r5   rS   rd   r   r   r   r   r#   r   r   <module>r      s    # 
  	   	 
    /     & 6 8 0 5 5 B < . 0! 9 528,(Vj,Z&(+ +r   