_i RdZddlZddlZddlZddlmZddlmZdZ GddeZ y) zkdistutils.command.install_lib Implements the Distutils 'install_lib' command (install all Python modules).N)Command)DistutilsOptionErrorz.pycdeZdZdZgdZgdZddiZdZdZdZ d Z d Z d Z d Z d ZdZdZy) install_libz7install all Python modules (extensions and pure Python)))z install-dir=dzdirectory to install to)z build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))compileczcompile .py to .pyc [default]) no-compileNzdon'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-buildNzskip the build steps)r r rrr cXd|_d|_d|_d|_d|_d|_y)Nr) install_dir build_dirr r optimize skip_buildselfs /builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/_distutils/command/install_lib.pyinitialize_optionszinstall_lib.initialize_options6s-   c N|jddddddd|jd|_|jd |_t|jts0 t |j|_|jd vrt yy#t t f$r td wxYw) Ninstall) build_libr)rr)r r )r r )rr)rrTF)rrzoptimize must be 0, 1, or 2)set_undefined_optionsr r isinstanceintAssertionError ValueErrorrrs rfinalize_optionszinstall_lib.finalize_options?s ""  & *  " $ (  << DL == !DM$--- J #DMM 2 == 1((2. / J*+HII Js .B B$c|j|j}|-|jjr|j |yyyN)buildr distributionhas_pure_modules byte_compileroutfiless rrunzinstall_lib.runZsH <<>  D$5$5$F$F$H   h '%I rc|jsX|jjr|jd|jj r|jdyyy)Nbuild_py build_ext)rr(r) run_commandhas_ext_modulesrs rr'zinstall_lib.buildjsS  113  ,  002  -3rctjj|jr(|j |j|j }|S|j d|jzy)Nz3'%s' does not exist -- no Python modules to install)ospathisdirr copy_treerwarnr+s rrzinstall_lib.installqsV 77== (~~dnnd6F6FGH  IIEV  rcptjr|jdyddlm}|j dj }|jr!||d|j||j|jdkDr7|||j|j||j|jyy)Nz%byte-compiling is disabled, skipping.r)r*rr)rr prefixdry_run)rr r:verboser;) sysdont_write_bytecoder8utilr*get_finalized_commandrootr r r;rr<)rfilesr* install_roots rr*zinstall_lib.byte_compile{s  " " II= > ' 11)<AA << jj#   ==1  jj#    rc (|sgS|j|}|j}t||}t|ttj z}g}|D]4} |j tjj|| |d6|Sr&) r@ get_outputsgetattrlenr4sepappendr5join) rhas_any build_cmd cmd_option output_dir build_filesr prefix_lenoutputsfiles r_mutate_outputszinstall_lib._mutate_outputssI..y9 ++- Iz2 ^c"&&k1 D NN277<< D4EF G rcg}|D]}tjjtjj|d}|tk7rL|j r0|j tjj|d|jdkDs|j tjj||j|S)Nr) optimizationr) r4r5splitextnormcasePYTHON_SOURCE_EXTENSIONr rI importlibr?cache_from_sourcer)r py_filenamesbytecode_filespy_fileexts r_bytecode_filenameszinstall_lib._bytecode_filenamess#G''""277#3#3G#<=a@C--||%%NN44W24N}}q %%NN44dmm5$$rc*|j|jjdd|j}|jr|j |}ng}|j|jj dd|j}||z|zS)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. r/rr0)rSr(r)rr r`r2)r pure_outputsbytecode_outputs ext_outputss rrEzinstall_lib.get_outputss ++    . . 0       <<#77 E ! **    - - /       ..<rus1!   ) ['[r