
    n&ph!                    n    S r SSKJr  SSKrSSKrSSKrSSKJrJ	r	  SSK
Jr  SSKJr  Sr " S	 S
\5      rg)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).    )annotationsN)AnyClassVar   )Command)DistutilsOptionErrorz.pyc                      \ rS rSr% Sr/ SQr/ SQrS\S'   SS0rS	\S
'   S r	SS jr
SS jrSS jrSS jrSS jrS rS rS rS rSrg)install_lib   z7install all Python modules (extensions and pure Python)))zinstall-dir=dzdirectory to install to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))compileczcompile .py to .pyc [default])
no-compileNzdon't compile .py files)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])
skip-buildNzskip the build steps)r   r   r   zClassVar[list[str]]boolean_optionsr   r   zClassVar[dict[str, str]]negative_optc                X    S U l         S U l        SU l        S U l        S U l        S U l        g )NF)install_dir	build_dirr   r   optimize
skip_buildselfs    \/var/www/html/venv/lib/python3.13/site-packages/setuptools/_distutils/command/install_lib.pyinitialize_optionsinstall_lib.initialize_options8   s-    
    c           	     N   U R                  SSSSSSS5        U R                  c  SU l        U R                  c  S	U l        [        U R                  [        5      (       d7   [	        U R                  5      U l        U R                  S
;  a  [        S5      eg g ! [
         a     N)f = f)Ninstall)	build_libr   )r
   r   )r   r   )r   r   )r   r   )r   r   TF)r      r   zoptimize must be 0, 1, or 2)set_undefined_optionsr   r   
isinstanceint
ValueErrorr   r   s    r   finalize_optionsinstall_lib.finalize_optionsA   s     	""&*"$(	
 <<DL== !DM$---- #DMM 2 }}I-*+HII . .  s    B 
B$#B$c                    U R                  5         U R                  5       nUb2  U R                  R                  5       (       a  U R	                  U5        g g g N)buildr#   distributionhas_pure_modulesbyte_compiler   outfiless     r   runinstall_lib.run\   sK    


 <<> D$5$5$F$F$H$Hh' %Ir!   c                    U R                   (       db  U R                  R                  5       (       a  U R                  S5        U R                  R	                  5       (       a  U R                  S5        g g g )Nbuild_py	build_ext)r   r/   r0   run_commandhas_ext_modulesr   s    r   r.   install_lib.buildl   sY      1133  ,  0022  - 3 r!   c                    [         R                  R                  U R                  5      (       a(  U R	                  U R                  U R
                  5      nU$ U R                  SU R                   S35        g )N'z0' does not exist -- no Python modules to install)ospathisdirr   	copy_treer   warnr2   s     r   r#   install_lib.installt   s_    77==((~~dnnd6F6FGH 	 IIDNN##ST r!   c           	     z   [         R                  (       a  U R                  S5        g SSKJn  U R                  S5      R                  nU R                  (       a  U" USU R                  UU R                  S9  U R                  S:  a4  U" UU R                  U R                  UU R                  U R                  S9  g g )Nz%byte-compiling is disabled, skipping.r   )r1   r#   r   )r   r   prefixdry_run)r   r   rE   verboserF   )sysdont_write_bytecoderB   utilr1   get_finalized_commandrootr   r   rF   r   rG   )r   filesr1   install_roots       r   r1   install_lib.byte_compile~   s    ""II=>' 11)<AA<<jj# ==1jj# r!   c           	     (   U(       d  / $ U R                  U5      nUR                  5       n[        X#5      n[        U5      [        [        R
                  5      -   nU Vs/ s H%  n[        R                  R                  XHUS  5      PM'     n	nU	$ s  snf r-   )rK   get_outputsgetattrlenr>   sepr?   join)
r   has_any	build_cmd
cmd_option
output_dirbuild_filesr   
prefix_lenfileoutputss
             r   _mutate_outputsinstall_lib._mutate_outputs   s{    I..y9	++-I2	^c"&&k1
KVW;4277<<
,=>;W Xs   ,Bc                   / nU H  n[         R                  R                  [         R                  R                  U5      5      S   nU[        :w  a  MN  U R
                  (       a-  UR                  [        R                  R                  USS95        U R                  S:  d  M  UR                  [        R                  R                  X0R                  S95        M     U$ )Nr%    )optimizationr   )r>   r?   splitextnormcasePYTHON_SOURCE_EXTENSIONr   append	importlibrJ   cache_from_sourcer   )r   py_filenamesbytecode_filespy_fileexts        r   _bytecode_filenamesinstall_lib._bytecode_filenames   s    #G ''""277#3#3G#<=a@C--||%%NN44W24N }}q %%NN44mm 5  $$ r!   c                2   U R                  U R                  R                  5       SSU R                  5      nU R                  (       a  U R                  U5      nO/ nU R                  U R                  R                  5       SSU R                  5      nX-   U-   $ )zReturn the list of files that would be installed if this command
were actually run.  Not affected by the "dry-run" flag or whether
modules have actually been built yet.
r7   r$   r8   )r^   r/   r0   r   r   rm   r:   )r   pure_outputsbytecode_outputsext_outputss       r   rQ   install_lib.get_outputs   s    
 ++..0	
 <<#77E!**--/	
 .<<r!   c                F   / nU R                   R                  5       (       a0  U R                  S5      nUR                  UR	                  5       5        U R                   R                  5       (       a0  U R                  S5      nUR                  UR	                  5       5        U$ )zGet the list of files that are input to this command, ie. the
files that get installed as they are named in the build tree.
The files in this list correspond one-to-one to the output
filenames returned by 'get_outputs()'.
r7   r8   )r/   r0   rK   extendrQ   r:   )r   inputsr7   r8   s       r   
get_inputsinstall_lib.get_inputs   s     --//11*=HMM(..01,,..22;?IMM)//12r!   )r   r   r   r   r   r   N)returnNone)ry   zlist[str] | Any)__name__
__module____qualname____firstlineno__descriptionuser_optionsr   __annotations__r   r   r*   r4   r.   r#   r1   r^   rm   rQ   rw   __static_attributes__ r!   r   r
   r
      s`    KK"L ,NO(M.:I-FL*FJ6( .B2=2r!   r
   )__doc__
__future__r   importlib.utilrg   r>   rH   typingr   r   corer   errorsr   re   r
   r   r!   r   <module>r      s7   !
 #  	 
    )   Z' Zr!   