+
     h8A  c                   s    R 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Ht ^RIHt  ! R R]4      tR# )	zHdistutils.command.build_py

Implements the Distutils 'build_py' command.N)log)ClassVar)Command)DistutilsFileErrorDistutilsOptionError)convert_pathc                   s  a  ] tR t^t o Rt. R"OtRR.tRR/tR tV 3R lR lt	V 3R	 lR
 lt
R tR tV 3R lR ltR tR tR tR tR tR tR tR tR#V 3R lR lltR tV 3R lR ltV 3R lR ltV 3R lR ltV 3R  ltR!tV tR# )$build_pyz5"build" pure Python modules (copy to build directory)compile
no-compileNforcec                sv    R V n         R V n        R V n        R V n        R V n        RV n        ^ V n        R V n        R # )NF)	build_lib
py_modulespackagepackage_datapackage_dirr   optimizer	   self   &K/usr/lib/python3.14/site-packages/setuptools/_distutils/command/build_py.pyinitialize_optionsZbuild_py.initialize_options$   s<     
    c                   < V ^8  d   QhRR/#    returnN Zformat__classdict__   "r   __annotate__build_py.__annotate__.   s     J J$ Jr   c                s   V P                  R RR4       V P                  P                  V n        V P                  P                  V n        V P                  P                  V n        / V n        V P                  P
                  '       dF   V P                  P
                  P                  4        F  w  r\        V4      V P
                  V&   K  	  V P                  4       V n	        \        V P                  \        4      '       g    \        V P                  4      V n        R# R#   \        \        3 d    \        R4      hi ; i)Zbuildzoptimize must be 0, 1, or 2N)r
   r
   )r	   r	   )Zset_undefined_optionsdistributionpackagesr   r   r   Zitemsr   get_data_files
data_files
isinstancer   ZintZ
ValueErrorZAssertionErrorr   )r   Znamepaths   &  r   finalize_optionsZbuild_py.finalize_options.   s   ""/1C	
 ))22++66 --::((("//;;AAC
)5d);  & D--/ $----J #DMM 2 . / J*+HIIJs   D! !D>c                r   r   r   r   r   r   r   r   G   s     D DT Dr   c                s    V P                   '       d   V P                  4        V P                  '       d!   V P                  4        V P	                  4        V P                  V P                  R R7      4       R# )F)include_bytecodeN)r   build_modulesr!   build_packagesbuild_package_databyte_compileget_outputsr   r   r   runZbuild_py.runG   sV    , ??? ===!##%$**E*BCr   c                s   . pV P                   '       g   V# V P                    F  pV P                  V4      p\        P                  P                  ! V P
                  .VP                  R4      ,           !  p^ pV'       d   \        V4      ^,           pV P                  W#4       Uu. uF  qfVR NK	  	  ppVP                  W#WG34       K  	  V# u upi )z?Generate list of '(package,src_dir,build_dir,filenames)' tuples.N)
r!   get_package_dirosr%   joinr
   splitZlenfind_data_filesappend)r   Zdatar   src_dir	build_dirZplenZfile	filenamess   &       r   r"   Zbuild_py.get_data_filese   s    }}}K}}G**73G '7'--:L'LNI D7|a' 261E1Eg1WX1Wde1WIXKK9@A %  Ys   %Cc           	     s   V P                   P                  R. 4      V P                   P                  V. 4      ,           p. pV F  p\        P                  ! \        P                  P                  \        P                  ! V4      \        V4      4      4      pTP                  V Uu. uF4  qwV9  g   K  \        P                  P                  V4      '       g   K2  VNK6  	  up4       K  	  V# u upi )z6Return filenames for package's data files in 'src_dir' )
r   getglobr0   r%   r1   escaper   extendisfile)r   r   r5   ZglobsfilesZpatternZfilelistZfns   &&&     r   r3   Zbuild_py.find_data_files{   s    !!%%b"-0A0A0E0Egr0RRGyyT[[1<3HIH LL%%r5RWW^^B=OX   s   %C,
2"C,
C,
c                r   r   r   r   r   r   r   r      s      D r   c                s@   V P                    F  w  rr4V F  p\        P                  P                  W54      pV P	                  \        P                  P                  V4      4       V P                  \        P                  P                  W%4      VRR7       K  	  K  	  R# )z$Copy data files into build directoryFZpreserve_modeN)r#   r0   r%   r1   mkpathdirname	copy_file)r   Z_packager5   r6   r7   filenameZtarget   &      r   r*   Zbuild_py.build_package_data   sp    7;3Hy%i:BGGOOF34GGLL3V5   & 8Gr   c                s`   VP                  R4      pV P                  '       g)   V'       d   \        P                  P                  ! V!  # R# . pV'       dT    V P                  RP	                  V4      ,          pVP                  ^ V4       \        P                  P                  ! V!  # V P                  P                  R4      pVe   VP                  ^ V4       V'       d   \        P                  P                  ! V!  # R#   \         d!    TP                  ^ TR,          4       TR  K  i ; i)zReturn the directory, relative to the top of the source
distribution, where package 'package' should be found
(at least according to the 'package_dir' option, if any).r.   r8   )r2   r   r0   r%   r1   ZinsertKeyErrorr9   )r   r   r%   ZtailZpdirs   &&   r   r/   Zbuild_py.get_package_dir   s     }}S!ww||T**D/++CHHTN;D
 KK4(77<<.. ''++B/#KK4(77<<..+   !KK48,R!s   "D 'D-,D-c                s   VR 8w  di   \         P                  P                  V4      '       g   \        RV R24      h\         P                  P	                  V4      '       g   \        RV R24      hV'       dH   \         P                  P                  VR4      p\         P                  P                  V4      '       d   V# R# )r8   zpackage directory 'z' does not existzsupposed package directory 'z ' exists, but is not a directoryz__init__.pyN)r0   r%   Zexistsr   Zisdirr1   r=   )r   r   r   init_pys   &&& r   check_packageZbuild_py.check_package   s    
 "77>>+..()+6FG  77==--(2;- @- -  ggll;>Gww~~g&& r   c                s    \         P                  P                  V4      '       g   \        P                  ! R W!4       R# R# )z!file %s (for module %s) not foundFT)r0   r%   r=   r    Zwarning)r   modulemodule_files   &&&r   check_moduleZbuild_py.check_module   s*    ww~~k**KK;[Qr   c                sV   V P                  W4       \        P                  ! \        P                  P	                  \        P
                  ! V4      R 4      4      p. p\        P                  P                  V P                  P                  4      pV F  p\        P                  P                  V4      pWu8w  dY   \        P                  P                  \        P                  P                  V4      4      ^ ,          pVP                  WV34       K  V P                  RV 24       K  	  V# )z*.pyz
excluding )rH   r:   r0   r%   r1   r;   Zabspathr    Zscript_nameZsplitextZbasenamer4   Zdebug_print)	r   r   r   Zmodule_filesmodulesZsetup_scriptfZabs_frI   s	   &&&      r   find_package_modulesZbuild_py.find_package_modules   s    70yydkk+.F!OPwwt'8'8'D'DEAGGOOA&E$))"''*:*:1*=>qA34  :l^!<=  r   c                s   / p. pV P                    F  pVP                  R4      pRP                  V^ R 4      pVR,          p W,          w  rxV'       g4   V P                  WW4      p	V^3W&   V	'       d   VP                  VRV	34       \        P                  P                  WvR,           4      p
V P                  W:4      '       g   K  VP                  WVV
34       K  	  V#   \         d    T P	                  T4      pRp Li ; i)a  Finds individually-specified Python modules, ie. those listed by
module name in 'self.py_modules'.  Returns a list of tuples (package,
module_base, filename): 'package' is a tuple of the path through
package-space to the module; 'module_base' is the bare (no
packages, no dots) module name, and 'filename' is the path to the
".py" file (relative to the distribution root) that implements the
module.
r.   FZ__init__.pyrE   )
r   r2   r1   rF   r/   rH   r4   r0   r%   rK   )r   r!   rL   rI   r%   r   Zmodule_baser   ZcheckedrG   rJ   s   &          r   find_modulesZbuild_py.find_modules   s       ooF<<$DhhtAbz*Gr(K )1):&
 ,,WB%0!$4!NNGZ#AB
 '',,{%4GHK$$V99NNG+>?1 &4 '   "227; s   
C  D Dc                s   . pV P                   '       d    VP                  V P                  4       4       V P                  '       dG   V P                   F6  pV P	                  V4      pV P                  W#4      pVP                  V4       K8  	  V# )a  Compute the list of all modules that will be built, whether
they are specified one-module-at-a-time ('self.py_modules') or
by whole packages ('self.packages').  Return a list of tuples
(package, module, module_file), just like 'find_modules()' and
'find_package_modules()' do.)r   r<   rP   r!   r/   rN   )r   rL   r   r   Zm   &    r   find_all_modulesZbuild_py.find_all_modules  sq     ???NN4,,./====="227;--gCq! ) r   c                sX    V P                  4        Uu. uF  qR,          NK  	  up# u upi )i   rE   )rR   )r   rI   s   & r   get_source_filesZbuild_py.get_source_files/  s)    )-)>)>)@A)@vr

)@AAAs   'c                s    V.\        V4      ,           VR ,           .,           p\        P                  P                  ! V!  # )rO   )listr0   r%   r1   )r   r6   r   rI   Zoutfile_paths   &&&& r   get_module_outfileZbuild_py.get_module_outfile2  s1    !{T']2fun5EEww||\**r   c                s6   < V ^8  d   QhRS[ RS[S[,          /# )r   r'   r   )ZboolrT   strr   r   r   r   r   6  s      D DI r   c                s   V P                  4       p. pV F  w  rEpVP                  R 4      pV P                  V P                  WE4      pVP	                  V4       V'       g   KN  V P
                  '       d1   VP	                  \        P                  P                  VRR7      4       V P                  ^ 8  g   K  VP	                  \        P                  P                  WpP                  R7      4       K  	  TV P                   UUU	U
Uu. uF.  w  rHrV
 F"  p\        P                  P                  W4      NK$  	  K0  	  upp
p	pp,          pV# u upp
p	ppi )r.   r8   )Zoptimization)rR   r2   rU   r
   r4   r   	importlibutilZcache_from_sourcer   r#   r0   r%   r1   )r   r'   rL   Zoutputsr   rI   Z_module_filerC   r5   r6   r7   s   &&         r   r,   Zbuild_py.get_outputs6  s   '')-4)G\mmC(G..t~~wOHNN8$<<<NN!88PR8S ==1$NN!88$== 9  .5  	:>//
:I6)% GGLL-% .:I
 	
 
s   4Ec                s^   \        V\        4      '       d   VP                  R 4      pM'\        V\        \        34      '       g   \        R4      hV P                  V P                  W14      p\        P                  P                  V4      pV P                  V4       V P                  W$RR7      # )r.   z:'package' must be a string (dot-separated), list, or tupleFr?   )r$   rV   r2   rT   ZtupleZ	TypeErrorrU   r
   r0   r%   rA   r@   rB   )r   rI   rJ   r   ZoutfileZdirs   &&&&  r   build_moduleZbuild_py.build_moduleQ  s    gs##mmC(GGdE]33L  ))$..'Jggoog&C~~k%~HHr   c                r   r   r   r   r   r   r   r   a  s     < <t <r   c                sb    V P                  4       pV F  w  r#pV P                  W4V4       K  	  R # N)rP   rY   )r   rL   r   rI   rJ   rQ   r   r(   Zbuild_py.build_modulesa  s1    ##%,3(G[
 f7; -4r   c                r   r   r   r   r   r   r   r   j  s     @ @ @r   c                s    V P                    FC  pV P                  V4      pV P                  W4      pV F  w  rEpV P                  WVV4       K  	  KE  	  R # rZ   )r!   r/   rN   rY   )r   r   r   rL   Zpackage_rI   rJ   rD   r   r)   Zbuild_py.build_packagesj  sS    }}G ..w7K//EG 29-+!!&w? 29 %r   c                r   r   r   r   r   r   r   r   ~  s      T r   c                s   \         P                  '       d   V P                  R 4       R# ^RIHp V P
                  pVR,          \        P                  8w  d   V\        P                  ,           pV P                  '       d!   V! V^ V P                  W0P                  R7       V P                  ^ 8  d.   V! VV P                  V P                  VV P                  R7       R# R# )z%byte-compiling is disabled, skipping.N)r+   )r   r	   prefixdry_runrE   )sysZdont_write_bytecodeZwarnrX   r+   r
   r0   Zsepr   r	   r\   r   )r   r>   r+   r[   s   &&  r   r+   Zbuild_py.byte_compile~  s    """II=>'":bff_F
 <<<FLL ==1jj r   c                sx   < V ^8  d   Qh/ S[ S[S[,          ,          ;R&   S[ S[S[S[3,          ,          ;R&   # )r   boolean_optionsnegative_opt)r   rT   rV   Zdictr   r   r   r   r      s5       d3i(?! " 4S>*F# r   )
r
   r   r#   r	   r   r   r   r   r!   r   ))z
build-lib=Zdzdirectory to "build" (copy) to)r   Zczcompile .py to .pyc)r   Nz!don't compile .py files [default])z	optimize=ZOzlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])r	   rM   z2forcibly build everything (ignore file timestamps))T)Z__name__Z
__module__Z__qualname__Z__firstlineno__ZdescriptionZuser_optionsr^   r_   r   r&   r-   r"   r3   r*   r/   rH   rK   rN   rP   rR   rS   rU   r,   rY   r(   r)   r+   Z__annotate_func__Z__static_attributes__Z__classdictcell__)r   s   @r   r   r      s     KKL -6w+?O.:I-FLJ J2D D<, %N42h B+ 6I < <@ @( [  r   r   )Z__doc__r:   Zimportlib.utilrW   r0   r]   Zdistutils._logr    Ztypingr   Zcorer   Zerrorsr   r   rX   r   r   r   r   r   <module>r`      s5   0   	 
    = Fw Fr   