
    Ji=                    ,   S SK Jr  S SKrS SKrS SK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 SKJr  S SKJr  S SKJr  S	S
KJrJr  S	SKJr  S	SKJr  S SKJs  Jr  S SKr S SK!J"r"  Sr#SS jr$ " S S\R:                  5      rS r% " S S5      r&g)    )annotationsN)IterableIterator)partial)glob)Path)Any)unique_everseen   )StrPathStrPathT)Distribution)SetuptoolsDeprecationWarning)convert_path)z*.pyizpy.typedc                    [         R                  " U [         R                  " U 5      R                  [        R                  -  5        g N)oschmodstatst_modeS_IWRITE)targets    ]/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/setuptools/command/build_py.pymake_writabler      s'    HHVRWWV_,,t}}<=    c                  R  ^  \ rS rSr% SrS\S'   SrS\S'   SrS	\S
'   S!S jr    S"             S#U 4S jjjr	S!S jr
S$S jrS rS%S jrS&S jrS rS'S(U 4S jjjrS)S jrS*S j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,S jrS r\S-S j5       rS rU =r$ ).build_py    aD  Enhanced '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.
r   distributionFbooleditable_modeNzStrPath | Noneexisting_egg_info_dirc                    [         R                  R                  U 5        U R                  R                  U l        U R                  R
                  =(       d    0 U l        SU R                  ;   a  U R                  S	 g g )N
data_files)origr   finalize_optionsr   package_dataexclude_package_data__dict__selfs    r   r&   build_py.finalize_options.   s^    &&t, --::$($5$5$J$J$Pb!4==(l+ )r   c                   > U(       aD  [        [        U5      R                  5       5      n[        [        U5      R                  5       5      n[        TU ]  XX4XV5      $ r   )strr   resolvesuper	copy_file)r+   infileoutfilepreserve_modepreserve_timeslinklevel	__class__s          r   r1   build_py.copy_file5   sO     f--/0F$w-//12Gw ]D
 	
r   c                j   U R                   (       d  U R                  (       a  U R                  (       a  gU R                   (       a  U R                  5         U R                  (       a   U R	                  5         U R                  5         U R                  [        R                  R                  U SS95        g)z?Build modules, packages, and copy data files to build directoryNF)include_bytecode)

py_modulespackagesr!   build_modulesbuild_packagesbuild_package_databyte_compiler%   r   get_outputsr*   s    r   runbuild_py.runF   sp    4==T5G5G?? ==!##% 	$--33D53QRr   c                    US:X  a!  U R                  5       U l        U R                  $ [        R                  R	                  X5      $ )zlazily compute data filesr$   )_get_data_filesr$   r%   r   __getattr__)r+   attrs     r   rG   build_py.__getattr__W   s9    <"224DO??"}}((44r   c                    U R                  5         [        [        U R                  U R                  =(       d    S5      5      $ )z?Generate list of '(package,src_dir,build_dir,filenames)' tuples )analyze_manifestlistmap_get_pkg_data_filesr=   r*   s    r   rF   build_py._get_data_files^   s/    C00$--2E2FGGr   c                    U R                   R                  S0 5        [        [        U R                  U R
                  =(       d    S5      5      $ )z
Generate list of ``(package,src_dir,build_dir,filenames)`` tuples,
but without triggering any attempt to analyze or build the manifest.
manifest_filesrK   )r)   
setdefaultrM   rN   rO   r=   r*   s    r   get_data_files_without_manifest(build_py.get_data_files_without_manifestc   s:     	  !126C00$--2E2FGGr   c                &   U R                  U5      n[        R                  R                  " U R                  /UR                  S5      -   6 nU R                  X5       Vs/ s H"  n[        R                  R                  XB5      PM$     nnXX54$ s  snf N.)get_package_dirr   pathjoin	build_libsplitfind_data_filesrelpath)r+   packagesrc_dir	build_dirfile	filenamess         r   rO   build_py._get_pkg_data_filesm   s    &&w/ GGLLDNN#3gmmC6H#HJ	
 ,,W>
> GGOOD*> 	 
 55	
s   )Bc                ~   U R                  U R                  UU[        S9n[        [	        [
        SS9U5      n[        R                  R                  U5      n[        [        R                  R                  U5      n[        R                  " U R                  R                  U/ 5      U5      nU R                  XU5      $ )z6Return filenames for package's data files in 'src_dir')extra_patternsT)	recursive)_get_platform_patternsr'   _IMPLICIT_DATA_FILESrN   r   r   	itertoolschainfrom_iterablefilterr   rZ   isfilerR   getexclude_data_files)r+   r`   ra   patternsglobs_expandedglobs_matches
glob_filesfiless           r   r^   build_py.find_data_files{   s    ../	 / 
 WTT:HE!55nEBGGNNM:
##GR0
 &&w??r   c                   > U R                   (       a'  [        U R                  5       R                  5       5      $ [        TU ]  U5      $ )1See :class:`setuptools.commands.build.SubCommand`)r!   rM   get_output_mappingkeysr0   rB   )r+   r;   r8   s     r   rB   build_py.get_outputs   s:    //166899w"#344r   c                    [         R                  " U R                  5       U R                  5       5      n[	        [        U[        R                  " S5      S95      $ )ry   r   )key)rk   rl    _get_package_data_output_mapping_get_module_mappingdictsortedoperator
itemgetter)r+   mappings     r   rz   build_py.get_output_mapping   sG    //113$$&
 F7(;(;A(>?@@r   c              #     #    U R                  5        H8  u  pnUR                  S5      nU R                  U R                  X5      nXC4v   M:     g7f)z5Iterate over all modules producing (dest, src) pairs.rX   N)find_all_modulesr]   get_module_outfiler\   )r+   r`   modulemodule_filefilenames        r   r   build_py._get_module_mapping   sK     ,0,A,A,C(G[mmC(G..t~~wOH)) -Ds   AAc              #     #    U R                    HR  u  pp4U HF  n[        R                  R                  X55      n[        R                  R                  X%5      nXg4v   MH     MT     g7f)z6Iterate over package data producing (dest, src) pairs.N)r$   r   rZ   r[   )r+   r`   ra   rb   rd   r   r   srcfiles           r   r   )build_py._get_package_data_output_mapping   sP     6:oo2Gi%i:'',,w9'' & 7Fs   A$A&c                    U R                  5        HQ  u  pU R                  [        R                  R	                  U5      5        U R                  X!5      u  p4[        U5        MS     g)z$Copy data files into build directoryN)r   mkpathr   rZ   dirnamer1   r   )r+   r   r   _outf_copieds        r   r@   build_py.build_package_data   sI    #DDFOFKK/0!^^G<NE&!  Gr   c                   0 U l         U R                  R                  (       d  g 0 nU R                  =(       d    S H  nX![	        U R                  U5      5      '   M!     U R                  (       a_  [        U R                  S5      R                  5       (       a6  U R                  n[        US5      nUR                  SS9R                  5       nODU R                  S5        U R                  S5      nUR                  nUR                  R                  n[!        5       nU R#                  XS5       GH  n[$        R&                  R)                  [	        U5      5      u  pS nU
nU	(       a_  X:w  aZ  X;  aU  U	n[$        R&                  R)                  U	5      u  p[$        R&                  R+                  X5      n
U	(       a  X:w  a  X;  a  MU  X;   d  M  X:X  a  UR-                  U
5      (       a  M  O,UR/                  X   U
5      nU(       a  UR1                  U5        U R                   R3                  X   / 5      R5                  U5        GM     g )NrK   zSOURCES.txtzutf-8)encodingegg_info)rR   r   include_package_datar=   assert_relativerY   r"   r   exists	read_text
splitlinesrun_commandget_finalized_commandr   filelistrv   _IncludePackageDataAbuse_filter_build_filesr   rZ   r]   r[   	is_moduleimportable_subpackagewarnrS   append)r+   src_dirsr`   egg_info_dirmanifestrv   ei_cmdcheckrZ   dfprevoldfdf
importables                  r   rL   build_py.analyze_manifest   s   46  55#%}}**GGN_T%9%9'%BCD +
 &&T//?FFHH55LL-8H&&&8CCEEZ(//
;F!??LOO))E(*,,UAD77==!67DADD	a&7a(GGLL' 	a&7 }9q))  * "'!<!<X[!!LJ!

:.##..x{B?FFtL! Br   c              #    ^#    U R                  S5      nX R                  UR                  UR                  4nU Vs/ s H*  oU(       d  M  [        R
                  R                  U5      PM,     nnU Hf  n[        R
                  R                  U5      m[        R
                  R                  U5      (       a  [        U4S jU 5       5      (       d  Mb  Uv   Mh     gs  snf 7f)aM  
``build_meta`` may try to create egg_info outside of the project directory,
and this can be problematic for certain plugins (reported in issue #3500).

Extensions might also include between their sources files created on the
``build_lib`` and ``build_temp`` directories.

This function should filter this case of invalid files out.
buildc              3  ,   >#    U  H	  oT;  v   M     g 7fr   rK   ).0r   	norm_paths     r   	<genexpr>/build_py._filter_build_files.<locals>.<genexpr>   s     -T)Qy.@)s   N)	r   r\   
build_temp
build_baser   rZ   normpathisabsall)	r+   rv   r   r   
build_dirsp	norm_dirsrc   r   s	           @r   r   build_py._filter_build_files   s      **730@0@%BRBRS
2<B*Q(RWW%%a(*	BD((.I77==&&#-T)-T*T*T
  Cs   9C!
C
#C-A"C!C!c                    g r   rK   r*   s    r   get_data_filesbuild_py.get_data_files   s    r   c                (    U R                   U   $ ! [         a     Of = f[        R                  R	                  XU5      nX0R                   U'   U(       a  U R
                  R                  (       d  U$ U R
                  R                   H#  nXA:X  d  UR                  US-   5      (       d  M#    O   U$ [        US5       nUR                  5       nSSS5        O! , (       d  f       O= fSW;  a#  [        R                  R                  SU S35      eU$ )z8Check namespace packages' __init__ for declare_namespacerX   rbNs   declare_namespacezNamespace 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_checkedKeyErrorr%   r   check_packager   namespace_packages
startswithopenread	distutilserrorsDistutilsError)r+   r`   package_dirinit_pypkgr   contentss          r   r   build_py.check_package   s    	((11 		 ----d[I)0g&d//BBN$$77C~#!>!> 8 N'4 AvvxH !  x/""11-gY 78 8  s    
>C
C&c                l    0 U l         [        R                  R                  U 5        SU l        S U l        g )NF)r   r%   r   initialize_optionsr!   r"   r*   s    r   r   build_py.initialize_options  s,     "((."%)"r   c                    [         R                  R                  X5      nU R                  R                  b4  [
        R                  R                  U R                  R                  U5      $ U$ r   )r%   r   rY   r   src_rootr   rZ   r[   )r+   r`   ress      r   rY   build_py.get_package_dir  sN    mm++D:%%177<< 1 1 : :C@@
r   c                  ^^ [        T5      mU R                  U R                  UU5      nU4S jU 5       n[        R                  R                  U5      n[        U5      mU4S jT 5       n[        [        U5      5      $ )z6Filter filenames for package's data files in 'src_dir'c              3  R   >#    U  H  n[         R                  " TU5      v   M     g 7fr   )fnmatchrn   )r   patternrv   s     r   r   .build_py.exclude_data_files.<locals>.<genexpr>$  s     Oh7ug66hs   $'c              3  6   >#    U  H  oT;  d  M
  Uv   M     g 7fr   rK   )r   fnbads     r   r   r   (  s     7"322s   		)rM   ri   r(   rk   rl   rm   setr
   )	r+   r`   ra   rv   rr   match_groupsmatcheskeepersr   s	      `    @r   rq   build_py.exclude_data_files  so    U..%%

 PhO////='l77OG,--r   c                   ^ [         R                  " UU R                  S/ 5      U R                  U/ 5      5      nU4S jU 5       $ )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.
 c              3  v   >#    U  H.  n[         R                  R                  T[        U5      5      v   M0     g 7fr   )r   rZ   r[   r   )r   r   ra   s     r   r   2build_py._get_platform_patterns.<locals>.<genexpr>9  s1      
 ( GGLL,w"788's   69)rk   rl   rp   )specr`   ra   rg   raw_patternss     `  r   ri   build_py._get_platform_patterns,  sF     !HHRHHWb!


 (
 	
r   )r$   r!   r(   r"   rR   r'   r   returnNone)TTN   )r2   r   r3   r   r4   r    r5   r    r6   z
str | Noner7   objectr   ztuple[StrPathT | str, bool])rH   r.   r   r	   )r   z%list[tuple[str, str, str, list[str]]])r`   r.   r   ztuple[str, str, str, list[str]])T)r;   r    r   z	list[str])r   zdict[str, str])r   zIterator[tuple[str, str]])rv   zIterable[str]r   r   r   zIterator[str])r`   r.   r   r.   )rK   ) __name__
__module____qualname____firstlineno____doc____annotations__r!   r"   r&   r1   rC   rG   rF   rT   rO   r^   rB   rz   r   r   r@   rL   r   r   r   r   rY   rq   staticmethodri   __static_attributes____classcell__)r8   s   @r   r   r       s    M4,0>0, ##

 
 	

 
 
 
 
%
 
"S"5H
H6@$5 5A*("'MR".5	*<*.  
 
r   r   c                    [         R                  R                  U 5      (       d  U $ SSKJn  [
        R                  " S5      R                  5       U -  nU" U5      e)Nr   )DistutilsSetupErrorz
        Error: setup script specifies an absolute path:

            %s

        setup() arguments must *always* be /-separated paths relative to the
        setup.py directory, *never* absolute paths.
        )r   rZ   r   distutils.errorsr  textwrapdedentlstrip)rZ   r  msgs      r   r   r   @  sS    77==4 			
 &(

	  c
""r   c                  J    \ rS rSrSr " S S\5      rSS jrS rS r	S r
S	rg
)r   iU  z>Inform users that package or module is included as 'data file'c                      \ rS rSrSrSrSrg)!_IncludePackageDataAbuse._WarningiX  zU
        Package {importable!r} is absent from the `packages` configuration.
        a|  
        ############################
        # Package would be ignored #
        ############################
        Python recognizes {importable!r} as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that {importable!r} is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want {importable!r} to be distributed and are
        already explicitly excluding {importable!r} via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        rK   N)r   r   r   r   _SUMMARY_DETAILSr   rK   r   r   _Warningr
  X  s    "r   r  c                2    [         [           " 5       U l        g r   )r   r.   _already_warnedr*   s    r   __init__!_IncludePackageDataAbuse.__init__  s    "3xzr   c                l    UR                  S5      =(       a    US [        S5      *  R                  5       $ )Nz.py)endswithlenisidentifier)r+   rc   s     r   r   "_IncludePackageDataAbuse.is_module  s,    }}U#J]E
{(;(H(H(JJr   c                    [        U5      R                  n[        [        R                  " [
        R                  UR                  5      5      nU(       a  SR                  U/UQ5      $ g rW   )	r   parentrM   rk   	takewhiler.   r  partsr[   )r+   r  rc   r   r  s        r   r   ._IncludePackageDataAbuse.importable_subpackage  sO    4jY(()9)9399EF88V,e,--r   c                    XR                   ;  a5  U R                  R                  US9  U R                   R                  U5        g g )N)r   )r  r  emitadd)r+   r   s     r   r   _IncludePackageDataAbuse.warn  s<    111MM*5  $$Z0 2r   )r  Nr   )r   r   r   r   r   r   r  r  r   r   r   r   rK   r   r   r   r   U  s(    H'/ 'V*K1r   r   r   )'
__future__r   r   rk   r   r   r   r  collections.abcr   r   	functoolsr   r   pathlibr   typingr	   more_itertoolsr
   _pathr   r   distr   warningsr   distutils.command.build_pycommandr   r%   r  r   distutils.utilr   rj   r   r   r   rK   r   r   <module>r,     sn    "    	   .     * %  3 ) )  ', >]
t}} ]
@	#*>1 >1r   