Jd#7 ddlmZddlmZddlmZddlmcmZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlZddlZddlmZddlmZmZmZmZmZmZddlmZddlmZd ZGd d ejZd Z Gd dZ!dS))partial)glob) convert_pathN)Path)DictIterableIteratorListOptionalTuple)SetuptoolsDeprecationWarning)unique_everseencxtj|tj|jtjzdSN)oschmodstatst_modeS_IWRITE)targets N/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/build_py.py make_writablers,HVRWV__,t}<=====cxeZdZUdZdZeed<dZee ed<dZ d fd Z d Z d Z d Zd Zd ZdZdZd!dee ffd Zdee e ffdZdeee e ffdZdeee e ffdZdZdZdee de dee fdZdZdZ dZ!dZ"dZ#e$dZ%xZ&S)"build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. F editable_modeNexisting_egg_info_dirctj||jj|_|jjpi|_d|jvr|jd=g|_dS)N data_files)origrfinalize_options distribution package_dataexclude_package_data__dict___build_py__updated_filesselfs rr!zbuild_py.finalize_options$s^ &&t,,, -:$($5$J$Pb! 4= ( ( l+!rc |r\tt|}tt|}t||||||Sr)strrresolvesuper copy_file)r(infileoutfile preserve_modepreserve_timeslinklevel __class__s rr.zbuild_py.copy_file,st  3f--//00F$w--//1122Gww  -!%u.. .rc0|js|jr|jrdS|jr||jr(|||tj |ddS)z?Build modules, packages, and copy data files to build directoryNr)include_bytecode) py_modulespackagesr build_modulesbuild_packagesbuild_package_data byte_compiler r get_outputsr's rrunz build_py.run5s 4= T5G  F ? !    = &    ! ! !  # # % % % $-33D13MMNNNNNrc|dkr ||_|jStj||S)zlazily compute data filesr)_get_data_filesrr r __getattr__)r(attrs rrBzbuild_py.__getattr__Es@ <  "2244DO? "}((t444rctj||||\}}|r|j|||fSr)r r build_moduler&append)r(module module_filepackager0copieds rrEzbuild_py.build_moduleLsK-44T6;PWXX  1  ' ' 0 0 0rc||tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples)analyze_manifestlistmap_get_pkg_data_filesr9r's rrAzbuild_py._get_data_filesRs6 C0$-2E2FFGGGrc|jditt|j|jpdS)z Generate list of ``(package,src_dir,build_dir,filenames)`` tuples, but without triggering any attempt to analyze or build the manifest. manifest_filesrL)r% setdefaultrNrOrPr9r's rget_data_files_without_manifestz(build_py.get_data_files_without_manifestWs?   !12666C0$-2E2FFGGGrc||tjj|jg|dz}fd||D}|||fS)N.cPg|]"}tj|#SrL)rpathrelpath).0filesrc_dirs r z0build_py._get_pkg_data_files..is9    GOOD' * *   r)get_package_dirrrXjoin build_libsplitfind_data_files)r(rI build_dir filenamesr\s @rrPzbuild_py._get_pkg_data_filesas&&w//GLDN#3gmmC6H6H#HJ     ,,Wg>>   I55rc||j||}tttd|}t j|}ttj j |}t j|j |g|}||||S)z6Return filenames for package's data files in 'src_dir'T) recursive)_get_platform_patternsr#rOrr itertoolschain from_iterablefilterrrXisfilerRgetexclude_data_files)r(rIr\patternsglobs_expanded globs_matches glob_filesfiless rrbzbuild_py.find_data_filesos..       WTT:::HEE!55nEE BGNM::    # #GR 0 0   &&w???rreturnc|jr3t|St |S)1See :class:`setuptools.commands.build.SubCommand`)rrNget_output_mappingkeysr-r>)r(r7r5s rr>zbuild_py.get_outputssM   ://11668899 9ww""#3444rctj||}t t |dS)rvc|dS)NrrL)xs rz-build_py.get_output_mapping..s !A$r)key)rhri _get_package_data_output_mapping_get_module_mappingdictsorted)r(mappings rrwzbuild_py.get_output_mappingsP/  1 1 3 3  $ $ & &  F7777888rc#K|D]=\}}}|d}||j||}||fV>dS)z5Iterate over all modules producing (dest, src) pairs.rVN)find_all_modulesraget_module_outfiler`)r(rIrGrHfilenames rrzbuild_py._get_module_mappingsp.2.C.C.E.E * * *WfkmmC((G..t~wOOH[) ) ) ) ) * *rc#K|jD]R\}}}}|D]H}tj||}tj||}||fVISdS)z6Iterate over package data producing (dest, src) pairs.N)rrrXr_)r(rIr\rcrdrrsrcfiles rr~z)build_py._get_package_data_output_mappings|6:o ( ( 2GWi% ( (i::',,w99w''''' ( ( (rc|D]_\}}|tj||||\}}t |`dS)z$Copy data files into build directoryN)r~mkpathrrXdirnamer.r)r(rr_outf_copieds rr<zbuild_py.build_package_datass#DDFF " "OFG KK// 0 0 0!^^GV<.s-BBBQBRW%%a((BBBrc3 K|]}|vV dSrrL)rZr norm_paths r z/build_py._filter_build_files..s(-T-TQay.@-T-T-T-T-T-TrN) rr` build_temp build_baserrXrisabsall)r(rsrr build_dirs norm_dirsr[rs @rrzbuild_py._filter_build_filess**7330@%BRS BB*BBB   D((..I7==&& #-T-T-T-T)-T-T-T*T*T    rcdSrrLr's rget_data_fileszbuild_py.get_data_filess rc |j|S#t$rYnwxYwtj|||}||j|<|r |jjs|S|jjD]"}||ks||dzrn#|Stj |d5}| }dddn #1swxYwYd|vr#tj d|d|S)z8Check namespace packages' __init__ for declare_namespacerVrbNsdeclare_namespacezNamespace package problem: z is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")packages_checkedKeyErrorr r check_packager"namespace_packages startswithioopenread distutilserrorsDistutilsError)r(rI package_dirinit_pypkgrcontentss rrzbuild_py.check_packagesk (1 1    D ---dG[II)0g& d/B N$7  Cg~~# !>!>~N WWd # # qvvxxH               x / /"111.s/OO7ug66OOOOOOrc3$K|] }|v|V dSrrL)rZfnbads rrz.build_py.exclude_data_files..s'77"3277r)rNrgr$rhrirjsetr) r(rIr\rsro match_groupsmatcheskeepersrs ` @rrnzbuild_py.exclude_data_files sU ..  %     POOOhOOO /// =='ll7777777OG,,---rctj|dg||g}fd|DS)z yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. c3rK|]1}tjt|V2dSr)rrXr_r)rZrr\s rrz2build_py._get_platform_patterns..)sQ   GLL,w"7"7 8 8      r)rhrirm)specrIr\ raw_patternss ` rrgzbuild_py._get_platform_patternsse! HHR   HHWb ! !      (    r)r)r)Nr))r))'__name__ __module__ __qualname____doc__rbool__annotations__rr r+r!r.r?rBrErArTrPrbr r>rrwr r rr~r<rMrrrrrr^rn staticmethodrg __classcell__)r5s@rrrsV M4+/8C=///"""JK#$......OOO 555 HHH HHH 6 6 6@@@"55c555555 9DcN9999*XeCHo%>****((5c?2K(((("""'<'<'Inform users that package or module is included as 'data file'a Installing {importable!r} as data is deprecated, please list it in `packages`. !! ############################ # Package would be ignored # ############################ Python recognizes {importable!r} as an importable package, but it is not listed in the `packages` configuration of setuptools. {importable!r} has been automatically added to the distribution only because it may contain data files, but this behavior is likely to change in future versions of setuptools (and therefore is considered deprecated). Please make sure that {importable!r} is included as a package by using the `packages` configuration field or the proper discovery methods (for example by using `find_namespace_packages(...)`/`find_namespace:` instead of `find_packages(...)`/`find:`). You can read more about "package discovery" and "data files" on setuptools documentation page. !! c,t|_dSr)r_already_warnedr's r__init__z!_IncludePackageDataAbuse.__init___s"uurc|do)|dtd S)Nz.py)endswithlen isidentifier)r(r[s rrz"_IncludePackageDataAbuse.is_modulebs6}}U##I\s5zzk\(:(G(G(I(IIrct|j}ttjt j|j}|rd|g|SdS)NrV) rparentrNrh takewhiler+rpartsr_)r(rr[rrs rrz._IncludePackageDataAbuse.importable_subpackageesV4jjY()939EEFF  .88V,e,-- -trc||jvretj|j|}t j|td|j|dSdS)N)r) stacklevel) rrrMESSAGEformatwarningsrr add)r(rrs rrz_IncludePackageDataAbuse.warnlso T1 1 1/$,//66*6MMC M#; J J J J  $ $Z 0 0 0 0 0 2 1rN) rrrrrrrrrrLrrrrEs`HHG.%%%JJJ11111rr)" functoolsrrdistutils.utilrdistutils.command.build_pycommandrr rrrrrrrhrrpathlibrtypingrrr r r r setuptools._deprecation_warningr setuptools.extern.more_itertoolsrrrrrLrrr s'''''')))))))))   BBBBBBBBBBBBBBBBHHHHHH<<<<<<>>>U U U U U t}U U U p###*+1+1+1+1+1+1+1+1+1+1r