+
    WBi<                    B   ^ 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t^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIHtHt ^ RIt^RIHtHt ^RIHt ^RIHtHtH t  ^R	I!H"t"H#t#H$t$ ^R
IH%t% RRRRRRRRRRRRRR/t&]'PQ                  ]&R4      t)]PT                  ! R]&R7      t+R R lt,RFR R llt-RGR  R! llt.]P^                  ! 4       P`                  ^,
          t1]1^ 8:  d   ^Nt1]! ]Pd                  R"]1R#7      t3R$R/R% R& llt4R' R( lt5RHR) R* llt6R+ R, lt7R- R. lt8RIR/ R0 llt9R1 R2 lt:]Pv                  R3 R4 l4       t<R5 R6 lt=RJR7 R8 llt>RJR9 R: llt?R; R< lt@RKR= R> lltAR? R@ ltB]CRA8X  d   ]A! ]
P                  RB,          RC4       RDRE.tER# )L    )annotationsN)IteratorSequence)partial)NoReturnTextIO)ProjectBuilder_ctx)env)BuildBackendExceptionBuildExceptionFailedProcessError)ConfigSettingsDistributionStrPath)DefaultIsolatedEnvredz[91mgreenz[92myellowz[93mboldz[1mdimz[2m	underlinez[4mresetz[0m _styles)defaultc                   V ^8  d   QhRR/#    returnNone )formats   "3/usr/lib/python3.14/site-packages/build/__main__.py__annotate__r%   /   s      d     c                 f   R \         P                  9   dH   R\         P                  9   d   \        P                  ! R^R7       \        P                  \        4       M;R\         P                  9   g%   \        P                  P                  4       '       d   R# \        P                  \        4       R# )NO_COLORFORCE_COLORzLBoth NO_COLOR and FORCE_COLOR environment variables are set, disabling color)
stacklevelN)
osenvironwarningswarnr   set
_NO_COLORSsysstdoutisattyr"   r&   r$   _init_colorsr4   /   sc    RZZBJJ&MMhuvwJ	"**	$

(9(9(;(;KK
r&   c               (    V ^8  d   QhRRRRRRRR/# )r   fmtstrmsgfileTextIO | Noner    r!   r"   )r#   s   "r$   r%   r%   9   s.     C C C C C Cr&   c                h    \        V P                  ! V3/ \        P                  4       B VR R7       R# )T)r9   flushN)printr#   r   get)r6   r8   r9   s   &&&r$   _cprintr?   9   s"    	#**S
*GKKM
*TBr&   c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r   messagezWarning | strcategoryztype[Warning]filenamer7   linenointr9   r:   line
str | Noner    r!   r"   )r#   s   "r$   r%   r%   =   sN     7 777 7 	7
 7 7 
7r&   c                0    \        R \        V 4      4       R# )z{yellow}WARNING{reset} {}N)r?   r7   )rA   rB   rC   rD   r9   rF   s   &&&&&&r$   _showwarningrI   =   s     'W6r&     )subsequent_indentwidthoriginc               $    V ^8  d   QhRRRRRR/# )r   rA   r7   rM   ztuple[str, ...] | Noner    r!   r"   )r#   s   "r$   r%   r%   P   s'     ] ]# ]"8 ]D ]r&   c          	        VfJ   V P                  4       vr#\        R\        VRR7      4       V F  p\        \        VRR7      4       K  	  R # V^ ,          R8X  dd   V^,          R8X  d   RMRpV^,          R	8X  d   \        P
                  MR pV P                  4        F  p\        R
\        WER7      VR7       K  	  R # R # )Nz{bold}{}{reset}z* )initial_indentrJ   
subprocesscmdz> z< stderrz{dim}{}{reset})r9   )
splitlinesr?   _fillr=   r1   rS   )rA   rM   firstrestrF   rP   r9   s   &$     r$   _logrX   P   s    ~ ++-!5t#DED%T23  
l	"!'e!3#AY(2szz&&(D$eD&PW[\ ) 
#r&   c                    V ^8  d   QhRRRR/# )r   	verbosityrE   r    r!   r"   )r#   s   "r$   r%   r%   ^   s     " "S "T "r&   c                <   \         \        n        \        P                  ! 4       R 8X  d    ^ RIpVP                  4        \        4        \        P                  P                  \        4       \        P                  P                  V 4       R#   \         d     L[i ; i)WindowsN)rI   r-   showwarningplatformsystemcoloramainitModuleNotFoundErrorr4   r
   LOGGERr/   rX   	VERBOSITY)rZ   r`   s   $ r$   
_setup_clire   ^   sg    'HI%	MMO NKKOODNNy! # 		s   B BBc               $    V ^8  d   QhRRRRRR/# )r   r8   r7   coderE   r    r   r"   )r#   s   "r$   r%   r%   o   s!       3 x r&   c                0    \        RV 4       \        V4      h)z
Print an error message and exit. Will color the output when writing to a TTY.

:param msg: Error message
:param code: Error code
z{red}ERROR{reset} {})r?   
SystemExit)r8   rg   s   &&r$   _errorrj   o   s     "C(
T
r&   c                    V ^8  d   QhRRRR/# )r   	dep_chainSequence[str]r    r7   r"   )r#   s   "r$   r%   r%   z   s     K K K3 Kr&   c                2    R P                  R V  4       4      # )z -> c              3  l   "   T F*  qP                  R 4      ^ ,          P                  4       x  K,  	  R# 5i);N)	partitionstrip).0deps   & r$   	<genexpr>$_format_dep_chain.<locals>.<genexpr>{   s(     J	}}S)!,2244	s   24)join)rl   s   &r$   _format_dep_chainrx   z   s    ;;J	JJJr&   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   srcdirr   outdirdistributionr   config_settingsConfigSettings | None	installer_env.Installerr    r7   r"   )r#   s   "r$   r%   r%   ~   sL     J JJJ J +	J
 J 	Jr&   c           	     V   \        VR 7      ;_uu_ 4       p\        P                  ! WP4      pVP                  VP                  4       TP                  TP                  Y#;'       g    / 4      4       TP                  Y!T;'       g    / 4      uuRRR4       #   + '       g   i     R# ; i))r   N)r   r	   from_isolated_envinstallbuild_system_requiresget_requires_for_buildbuild)rz   r{   r|   r}   r   r   builders   &&&&&  r$   _build_in_isolated_envr   ~   sx     
i	0	0C 223?G112G22<AVAVTVWX}}\?3H3HbI 
1	0	0	0s   A0BBB(	c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   rz   r   r{   r|   r   r}   r~   skip_dependency_checkboolr    r7   r"   )r#   s   "r$   r%   r%      sL     F FFF F +	F
  F 	Fr&   c                   \        V 4      pV'       gT   TP                  Y#;'       g    / 4      pV'       d1   R P                  R V 4       4      p\        4        \	        RV 24       TP                  Y!T;'       g    / 4      # )r   c              3     "   T F8  q^ ,          \        VR,          4      3 F  q"'       g   K  RV,           x  K  	  K:  	  R# 5i)r      NNz
	N)rx   )rs   depsrt   s   &  r$   ru   (_build_in_current_env.<locals>.<genexpr>   s:     "}GDUVPWYjkoprksYtOuy|<6C<<Ou<Gs
   &AAzMissing dependencies:)r	   check_dependenciesrw   r?   rj   r   )rz   r{   r|   r}   r   r   missingdependenciess   &&&&&   r$   _build_in_current_envr      sn     V$G ,,\;P;PbQ77"}G"}}LI*<.9:==/D/D"EEr&   c               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# )r   	isolationr   rz   r   r{   r|   r   r}   r~   r   r   r   r    r7   r"   )r#   s   "r$   r%   r%      sb     k kkk k 	k
 +k  k k 	kr&   c                F    V '       d   \        WW4V4      # \        WW4V4      # N)r   r   )r   rz   r{   r|   r}   r   r   s   &&&&&&&r$   _buildr      s'     %flU^__$V\Tijjr&   c                   V ^8  d   QhRR/# )r   r    zIterator[None]r"   )r#   s   "r$   r%   r%      s      ^ r&   c               #  T  "    R x  R #   \         \        3 d    p \        \        T 4      4        R p ? R # R p ? i\         Ed
   p \        T P                  \        P                  4      '       d   \        4        \        \        T 4      4       T P                  '       d`   \        P                  ! T P                  ^ ,          T P                  ^,          T P                  ^,          RR7      pRP                  T4      pM\        P                  ! R4      p\        RTP                  R4      4       \        \        T 4      4        R p ? R # R p ? i\          dP   p \        P                  ! 4       P                  R4      p\        RT4       \        \        T 4      4        R p ? R # R p ? ii ; i5i)N)limitr   z
{dim}{}{reset}

)r   r   rj   r7   r   
isinstance	exceptionrQ   CalledProcessErrorr?   exc_info	tracebackformat_exceptionrw   
format_excrr   	Exception)etb_linestbs      r$   _handle_build_errorr      s    ./ s1v  akk:#@#@AAI3q6N::: 11

1

1

1	H "B%%b)B$bhhtn5s1v !!#))$/$b)s1vs`   F(
 F(F%5F(F%F%AEB$EF(F%F%AF F( F%%F(c                    V ^8  d   QhRRRR/# )r   elementsrm   r    r7   r"   )r#   s   "r$   r%   r%      s     

 

] 

s 

r&   c                    \        V 4      ^ 8X  d   Rp\        V4      h\        V 4      ^8X  d
   V ^ ,          # RP                  RP                  V RR 4      V R,          4      # )r   zno elementsz	{} and {}z, Nr   )len
IndexErrorr#   rw   )r   r8   s   & r$   _natural_language_listr      s_    
8}o	X!	{!!IIhsm$RL
 	
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   rz   r   r{   distributionszSequence[Distribution]r}   r~   r   r   r   r   r   r    rm   r"   )r#   s   "r$   r%   r%      sX       * +	
     r&   c           
         . pV F?  p\        W@WW5V4      p	VP                  \        P                  P	                  V	4      4       KA  	  V# )a`  
Run the build process.

:param srcdir: Source directory
:param outdir: Output directory
:param distribution: Distribution to build (sdist or wheel)
:param config_settings: Configuration settings to be passed to the backend
:param isolation: Isolate the build in a separate environment
:param skip_dependency_check: Do not perform the dependency check
)r   appendr+   pathbasename)
rz   r{   r   r}   r   r   r   builtr|   outs
   &&&&&&&   r$   build_packager      sF    & E%YofopRWW%%c*+ & Lr&   c               8    V ^8  d   QhRRRRRRRRRR	R
R	RRRR/# r   r"   )r#   s   "r$   r%   r%      sX     *  * * *  **  +	* 
 *   *  *  * r&   c                   ^RI Hp RV9   d   Rp\        V4      h\        W@VRW5V4      p	\        P
                  P                  V	4      p
\        P                  ! RR7      p. pV'       d   VP                  P                  V	4      ;_uu_ 4       pVP                  V4        \        P                  ! R\        V4       R24       \        P
                  P                  WR\!        R	4      )  4      p V F?  p\        W@WW5V4      pVP#                  \        P
                  P                  V4      4       KA  	  \$        P&                  ! VR
R7        RRR4       V
.VO#   \$        P&                  ! TR
R7       i ; i  + '       g   i     L2; i)a  
Build a sdist and then the specified distributions from it.

:param srcdir: Source directory
:param outdir: Output directory
:param distribution: Distribution to build (only wheel)
:param config_settings: Configuration settings to be passed to the backend
:param isolation: Isolate the build in a separate environment
:param skip_dependency_check: Do not perform the dependency check
)tarfilesdistz=Only binary distributions are allowed but sdist was specifiedzbuild-via-sdist-)prefixz	Building z from sdistNz.tar.gzT)ignore_errors)_compatr   
ValueErrorr   r+   r   r   tempfilemkdtempTarFileopen
extractallr
   logr   rw   r   r   shutilrmtree)rz   r{   r   r}   r   r   r   r   r8   r   
sdist_name	sdist_outr   tr|   r   s   &&&&&&&         r$   build_package_via_sdistr      s8   & !-Mo9fg_hiE!!%(J  (:;IE__!!%((ALL#=9%;M%J$K;WXi<Ms9~o1NO$1L F/r{|CLL!1!1#!67 %2 it< )  it< )(s%   E7 BE4E7E44E77F	c                   V ^8  d   QhRR/# )r   r    zargparse.ArgumentParserr"   )r#   s   "r$   r%   r%   !  s     x x, xr&   c                    \        \        P                  \        \        ^4      R7      p \
        P                  RB8  d   \        V RR7      p \        \        P                  \        P                  ! \        P                  ! R4      P                  4       R4      V R7      p\
        P                  RB8  d   \        VRRR7      pV! 4       pVP                  R\        R	\        P                  ! 4       R
R7       VP                  RRRR\         P"                   RRP%                  \         P&                  4       R2R7       VP                  RRRR^ RR7       VP                  RRRRRRR 7       VP                  R!R"RRR#R$R 7       VP                  R%R&\        R'\        P(                   R(2R)R*7       VP                  R+R,R-R.R/7       VP+                  4       pVP                  R0R1R-R2R/7       VP                  R3\,        P.                  R4R57       VP+                  4       pVP                  R6R7R8R9R:R;R<7       VP                  R=R>R?R@RA7       V# )Cz
Construct the main parser.
)rL   T)colora  
                A simple, correct Python build frontend.

                By default, a source distribution (sdist) is built from {srcdir}
                and a binary distribution (wheel) is built from the sdist.
                This is recommended as it will ensure the sdist can be used
                to build wheels.

                Pass -s/--sdist and/or -w/--wheel to build a specific distribution.
                If you do this, the default behavior will be disabled, and all
                artifacts will be built from {srcdir} (even if you combine
                -w/--wheel with -s/--sdist, the wheel will be built from {srcdir}).
                z    )descriptionformatter_class)suggest_on_errorr   rz   ?z0source directory (defaults to current directory))typenargsr   helpz	--versionz-Vversionzbuild z (,))actionr   z	--verbosez-vrZ   countzincrease verbosity)destr   r   r   z--sdistz-sr   append_constr   z;build a source distribution (disables the default behavior))r   r   constr   z--wheelz-wwheelz-build a wheel (disables the default behavior)z--outdirz-oz&output directory (defaults to {srcdir}zdist)PATH)r   r   metavarz--skip-dependency-checkz-x
store_truez2do not check that build dependencies are installed)r   r   z--no-isolationz-nzdisable building the project in an isolated virtual environment. Build dependencies must be installed separately when this option is usedz--installerz1Python package installer to use (defaults to pip))choicesr   z--config-settingz-Cr}   r   zsettings to pass to the backend.  Multiple settings can be provided. Settings beginning with a hyphen will erroneously be interpreted as options to build if separated by a space character; use ``--config-setting=--my-setting -C--my-other-setting``zKEY[=VALUE])r   r   r   r   z--config-jsonconfig_jsonzsettings to pass to the backend as a JSON object. This is an alternative to --config-setting that allows complex nested structures. Cannot be used together with --config-settingJSON_STRING)r   r   r   )      )r   argparseRawDescriptionHelpFormattermin_max_terminal_widthr1   version_infoArgumentParsertextwrapindentdedentrr   add_argumentr7   r+   getcwdr   __version__rw   __path__sepadd_mutually_exclusive_group_env
INSTALLERS)r   make_parserparser	env_groupconfig_groups        r$   main_parserr   !  s    hBB#NacfJghO
7"!/>OOOO eg!
( (-K0 7"kDM]F
		?   **+2chhu~~.F-GqI	   !   J   <   7xuE   !A	   335IS	   @  
 668L[   	 8    Mr&   c               $    V ^8  d   QhRRRRRR/# )r   cli_argsrm   progrG   r    r!   r"   )r#   s   "r$   r%   r%     s&     <L <L= <L
 <Ld <Lr&   c                   \        4       pV'       d   Wn        VP                  V 4      p\        VP                  R7       / pVP
                  '       dD    \        P                  ! VP
                  4      p\        V\        4      '       g   \        R4       MVP                  '       dr   VP                   Fa  pVP                  R4      w  rxp	Wt9  d   WV&   K#  \        WG,          \        4      '       g   WG,          .WG&   WG,          P                  V	4       Kc  	  VP                   f+   \"        P$                  P'                  VP(                  R4      MVP                   p
VP*                  pV'       d   \,        pM	\.        pR.p\1        4       ;_uu_ 4        V! VP(                  V
VVVP2                  '       * VP4                  VP6                  4      p\9        V Uu. uF(  pRP:                  ! V3/ \<        P?                  4       B NK*  	  up4      p\A        R	V4       RRR4       R#   \        P                   d   p\        RT 24        Rp?EL3Rp?ii ; iu upi   + '       g   i     R# ; i)
z
Parse the CLI arguments and invoke the build process.

:param cli_args: CLI arguments
:param prog: Program name to show in help text
)rZ   zN--config-json must contain a JSON object (dict), not a list or primitive valuezInvalid JSON in --config-json: N=distr   z!{underline}{}{reset}{bold}{green}z){bold}{green}Successfully built {}{reset})!r   r  
parse_argsre   rZ   r   jsonloadsr   dictrj   JSONDecodeErrorr}   rq   listr   r{   r+   r   rw   rz   r   r   r   r   no_isolationr   r   r   r#   r   r>   r?   )r  r  r   argsr}   r   argsetting_valuer{   r   
build_callr   artifactartifact_lists   &&              r$   mainr    s    ]FX&D(O 	:"jj)9)9:Oot44gh
 
			''C #c 2G-+0(!/":DAA0?0H/IO,(//6 ( 37++2ERWW\\$++v.4;;F(,(:(:M"
,
 				KK!!!&&NN
 /chichW_077RGKKMRchi
 	;]K 
	3 ## 	:4QC899	:H j 
		s8   AH$ AI.II$I9IIII+	c                   V ^8  d   QhRR/# r   r"   )r#   s   "r$   r%   r%     s      D r&   c                 F    \        \        P                  R ,          4       R# )r   N)r  r1   argvr"   r&   r$   
entrypointr    s    "r&   __main__r   zpython -m buildr  r   )r   r   N)NN)r   )F)NTFpipr   )F
__future__r   r   
contextlibcontextvarsr  r+   r^   r   rQ   r1   r   r   r   r-   collections.abcr   r   	functoolsr   typingr   r   r   r   r	   r
   r   r   _exceptionsr   r   r   _typesr   r   r   r   _COLORSr
  fromkeysr0   
ContextVarr   r4   r?   rI   get_terminal_sizecolumnsr   fillrU   rX   re   rj   rx   r   r   r   contextmanagerr   r   r   r   r   r  r  __name__r  __all__r"   r&   r$   <module>r.     s   #     	    
     .  #  "  R R 9 9 # 
9Yi
H	8X ]]7B'
 
 
 G
<C7 ..0881< ! 	=PQ]4 ]""KJ F&k  8

4* Zxv<L~ z"() r&   