+
     h;  c                  s    R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
Ht ^RIHt ^RIHtHt ^RIHt  ! R R	4      tR
 t ! R R]4      t]P.                  3R R lltR tRR ltR# )zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
)annotationsN)Iterable)Literaloverload)log)DistutilsInternalErrorDistutilsTemplateError)convert_pathc                  s^   ] tR t^tRtR'R R lltR R lt]P                  3R R llt	R	 R
 lt
R R ltR R ltR R ltR R ltR tR R lt]R(R R ll4       t]R)R R ll4       t]R R l4       tR(R R llt]R(R R ll4       t]R)R  R! ll4       t]R" R# l4       tR(R$ R% lltR&tR# )*FileLista  A list of files built by on exploring the filesystem and filtered by
applying various patterns to what we find there.

Instance attributes:
  dir
    directory from which files will be taken -- only used if
    'allfiles' not supplied to constructor
  files
    list of filenames currently being built/filtered/manipulated
  allfiles
    complete list of files under consideration (ie. without any
    filtering applied)
Nc               s$    V ^8  d   QhRRRRRR/# )   warnobjectdebug_printreturnNone format   "C/usr/lib/python3.14/site-packages/setuptools/_distutils/filelist.py__annotate__FileList.__annotate__$   s!     # #V # #4 #    c                	s"    R V n         . V n        R # Nallfilesfiles)selfr
   r   s   &&&r   __init__ZFileList.__init__$   s     /3 "
r   c                    V ^8  d   QhRRRR/# )r	   r   Iterable[str]r   r   r   r   r   r   r   r   *   s     ! !] !t !r   c                	s    Wn         R # r   )r   )r   r      &&r   set_allfilesZFileList.set_allfiles*   s     r   c               r   )r	   dirstr | os.PathLike[str]r   r   r   r   r   r   r   r   -   s     % %1 %$ %r   c                	s&    \        V4      V n        R # r   )findallr   )r   r!   r   r   r#   ZFileList.findall-   s    r   c               r   )r	   msgr   r   r   r   r   r   r   r   r   0   s      v $ r   c                s<    ^ RI Hp V'       d   \        V4       R# R# )znPrint 'msg' to stdout if the global DEBUG (taken from the
DISTUTILS_DEBUG environment variable) flag is true.
)DEBUGN)Zdistutils.debugr%   Zprint)r   r$   r%   s   && r   r   ZFileList.debug_print0   s     	*#J r   c               r   )r	   itemstrr   r   r   r   r   r   r   r   ;   s        3  4  r   c                	<    V P                   P                  V4       R # r   )r   append)r   r&   r   r   r)   ZFileList.append;   s    

$r   c               r   )r	   itemsr   r   r   r   r   r   r   r   r   >   s     ! !M !d !r   c                	r(   r   )r   extend)r   r*   r   r   r+   ZFileList.extend>   s    

% r   c                   V ^8  d   QhRR/# r	   r   r   r   r   r   r   r   r   A   s     9 9d 9r   c                	s   \        \        \        P                  P                  V P
                  4      4      p. V n        V F:  pV P
                  P                  \        P                  P                  ! V!  4       K<  	  R # r   )Zsortedmapospathsplitr   r)   join)r   Zsortable_filesZ
sort_tuple   &  r   sortZFileList.sortA   sO    BGGMM4:: >?
(JJJbggllJ78 )r   c               r,   r-   r   r   r   r   r   r   J   s     " "4 "r   c                	s    \        \        V P                  4      ^,
          ^ R4       FB  pV P                  V,          V P                  V^,
          ,          8X  g   K5  V P                  V KD  	  R# )   N)rangelenr   )r   is   & r   remove_duplicatesZFileList.remove_duplicatesJ   sJ    s4::*Ar2Azz!}

1q5 11JJqM 3r   c                	s.   VP                  4       pV^ ,          pR;p;rVVR	9   dB   \        V4      ^8  d   \        RV R24      hVR,           Uu. uF  p\        V4      NK  	  ppMVR
9   dT   \        V4      ^8  d   \        RV R24      h\        V^,          4      pVR,           Uu. uF  p\        V4      NK  	  ppMHVR9   d3   \        V4      ^8w  d   \        RV R24      h\        V^,          4      pM\        RV R24      hW4WV3# u upi u upi )i    N'z#' expects <pattern1> <pattern2> ...:r5   NNz)' expects <dir> <pattern1> <pattern2> ...:r	   NNz ' expects a single <dir_pattern>zunknown action ')includeexcludeglobal-includeglobal-exclude)recursive-includerecursive-exclude)graftprune)r1   r8   r   r   )r   lineZwordsactionpatternsr!   dir_patternZw   &&      r   _parse_template_lineZFileList._parse_template_lineR   s5   

q'+++3OO5zA~,xBC  27r;AQH;HAA5zA~,xHI  uQx(C16r;AQH;H))5zQ,x?@  'uQx0K(+;F81)EFF#33# < <s   D*Dc               r   )r	   rD   r'   r   r   r   r   r   r   r   r   p   s     U U# U$ Ur   c                	s   V P                  V4      w  r#rEVR 8X  de   V P                  RRP                  V4      ,           4       V F5  pV P                  VRR7      '       d   K  \        P
                  ! RV4       K7  	  R# VR8X  de   V P                  RRP                  V4      ,           4       V F5  pV P                  VRR7      '       d   K  \        P
                  ! RV4       K7  	  R# VR	8X  de   V P                  R
RP                  V4      ,           4       V F5  pV P                  VRR7      '       d   K  \        P
                  ! RV4       K7  	  R# VR8X  de   V P                  RRP                  V4      ,           4       V F5  pV P                  VRR7      '       d   K  \        P
                  ! RV4       K7  	  R# VR8X  do   V P                  RP                  VRP                  V4      4      4       V F6  pV P                  WdR7      '       d   K  Rp\        P
                  ! WvV4       K8  	  R# VR8X  dn   V P                  RP                  VRP                  V4      4      4       V F5  pV P                  WdR7      '       d   K  \        P
                  ! RVV4       K7  	  R# VR8X  dM   V P                  RV,           4       V P                  RVR7      '       g   \        P
                  ! RV4       R# R# VR8X  dM   V P                  RV,           4       V P                  RVR7      '       g   \        P
                  ! RV4       R# R# \        RV R24      h) r<   zinclude Z T)anchorz%warning: no files found matching '%s'r=   zexclude z9warning: no previously-included files found matching '%s'r>   zglobal-include Fz>warning: no files found matching '%s' anywhere in distributionr?   zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr@   zrecursive-include {} {})prefixz:warning: no files found matching '%s' under directory '%s'rA   zrecursive-exclude {} {}zNwarning: no previously-included files matching '%s' found under directory '%s'rB   zgraft Nz+warning: no directories found matching '%s'rC   zprune z6no previously-included directories found matching '%s'z$this cannot happen: invalid action 'r;   )	rI   r   r2   include_patternr   Zwarningexclude_patternr   r   )r   rD   rE   rF   r!   rG   patternr$   rH   r   process_template_lineZFileList.process_template_linep   s    04/H/H/N,3
 YZ#((8*<<=#++GD+AAKK GQ $ y Z#((8*<<=#++GD+AAKKS $ ''.(1CCD#++GE+BBKK7   $ ''.(1CCD#++GE+BBKKB   $ **6==c388HCUVW#++G+@@VCKKc2 $
 **6==c388HCUVW#++G+@@KK>   $ wX34''['AAI;W B wX34''['AAM B )6vha@ r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# 
r	   rN   r'   rJ   boolrK   
str | Noneis_regexzLiteral[False]r   r   r   r   r   r   r      <        	
 ! 
r   c                	    R # r   r   r   rN   rJ   rK   rT      &&&&&r   rL   FileList.include_pattern        r   c          
     rP   
r	   rN   zstr | re.Pattern[str]rJ   rR   rK   rS   rT   zLiteral[True]r   r   r   r   r   r   r      <      &  	   
r   c               	rV   r   r   rW      &&&&$r   rL   rY           r   c          
     rP   r[   r   r   r   r   r   r      <      &  	
   
r   c                	rV   r   r   rW   rX   r   rL   rY      rZ   r   c          
     ,    V ^8  d   QhRRRRRRRRRR/# 	r	   rN   zstr | re.PatternrJ   rR   rK   rS   rT   r   r   r   r   r   r   r      s<     - -!- - 	-
 - 
-r   c                s^   Rp\        WW44      pV P                  RVP                   R24       V P                  f   V P	                  4        V P                   FQ  pVP                  V4      '       g   K  V P                  RV,           4       V P                  P                  V4       RpKS  	  V# )a  Select strings (presumably filenames) from 'self.files' that
match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
are not quite the same as implemented by the 'fnmatch' module: '*'
and '?'  match non-special characters, where "special" is platform-
dependent: slash on Unix; colon, slash, and backslash on
DOS/Windows; and colon on Mac OS.

If 'anchor' is true (the default), then the pattern match is more
stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
'anchor' is false, both of these will match.

If 'prefix' is supplied, then only filenames starting with 'prefix'
(itself a pattern) and ending with 'pattern', with anything in between
them, will match.  'anchor' is ignored in this case.

If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
'pattern' is assumed to be either a string containing a regex or a
regex object -- no translation is done, the regex is just compiled
and used as-is.

Selected strings will be added to self.files.

Return True if files are found, False otherwise.
Fz"include_pattern: applying regex r'r;   z adding T)translate_patternr   rN   r   r#   searchr   r)   )r   rN   rJ   rK   rT   files_found
pattern_reZname   &&&&&   r   rL   rY      s    @ &wI
=j>P>P=QQRST == LLNMMD  &&  d!23

!!$'"	 "
 r   c          
     rP   rQ   r   r   r   r   r   r     rU   r   c                	rV   r   r   rW   rX   r   rM   FileList.exclude_pattern  rZ   r   c          
     rP   r[   r   r   r   r   r   r     r\   r   c               	rV   r   r   rW   r]   r   rM   rg     r^   r   c          
     rP   r[   r   r   r   r   r   r   "  r_   r   c                	rV   r   r   rW   rX   r   rM   rg   !  rZ   r   c          
     r`   ra   r   r   r   r   r   r   )  s<      !  	
  
r   c                s   Rp\        WW44      pV P                  RVP                   R24       \        \	        V P
                  4      ^,
          RR4       Fe  pVP                  V P
                  V,          4      '       g   K-  V P                  RV P
                  V,          ,           4       V P
                  V RpKg  	  V# )zRemove strings (presumably filenames) from 'files' that match
'pattern'.  Other parameters are the same as for
'include_pattern()', above.
The list 'self.files' is modified in place.
Return True if files are found, False otherwise.
Fz"exclude_pattern: applying regex r'r;   z
 removing Tr6   )rb   r   rN   r7   r8   r   rc   )r   rN   rJ   rK   rT   rd   re   r9   rf   r   rM   rg   )  s     &wI
=j>P>P=QQRSTs4::*B3A  A//  

1!=>JJqM"	 4
 r   r   )NNTNF)TN)__name__
__module____qualname____firstlineno____doc__r   r    r/   curdirr#   r   r)   r+   r4   r:   rI   rO   r   rL   rM   __static_attributes__r   r   r   r   r      s    #! 57II % !9"4<Up      -^       r   r   c                s    \         P                  \        P                  ! V RR7      4      pR V 4       p\        \        P                  P
                  V4      # )z
Find all files under 'path'
T)Zfollowlinksc              3  sv   "   T F/  w  rq3 F$  p\         P                  P                  W4      x  K&  	  K1  	  R # 5ir   )r/   r0   r2   )Z.0basedirsr   Zfiles   &    r   Z	<genexpr>Z#_find_all_simple.<locals>.<genexpr>I  s3      :D%6TQVT  QV *s   79)_UniqueDirsfilterr/   Zwalkr0   Zisfile)r0   Z
all_uniqueZresultsr3   r   _find_all_simplert   D  sE     ##BGGDd$CDJ:DG "''..'**r   c                  s0    ] tR tRtRtR t]R 4       tRtR# )rr   iO  zv
Exclude previously-seen dirs from walk results,
avoiding infinite recursion.
Ref https://bugs.python.org/issue44497.
c                s    Vw  r#p\         P                  ! V4      pVP                  VP                  3pW`9   pV'       d   VR V P	                  V4       V'       * # )z
Given an item from an os.walk result, determine
if the item represents a unique dir for this instance
and if not, prevent further traversal.
:NNN)r/   statZst_devZst_inoZadd)r   Z	walk_itemrp   rq   r   ru   Z	candidateZfoundrH   r   __call__Z_UniqueDirs.__call__V  sS     &Ewwt}KK,	!Qyr   c                	s$    \        V ! 4       V4      # r   )rs   )Zclsr*   r   r   rs   Z_UniqueDirs.filtere  s    ceU##r   r   N)	ri   rj   rk   rl   rm   rv   Zclassmethodrs   ro   r   r   r   rr   rr   O  s      $ $r   rr   c               r,   )r	   r!   r"   r   r   r   r   r   r   j  s     	 	' 	r   c                s    \        V 4      pV \        P                  8X  d<   \        P                  ! \        P
                  P                  V R7      p\        W!4      p\        V4      # )z
Find all files under 'dir' and return the list of full filenames.
Unless dir is '.', return full filenames with dir prepended.
)start)	rt   r/   rn   	functoolsZpartialr0   Zrelpathr.   Zlist)r!   r   Zmake_relr3   r   r#   r#   j  sH    
 S!E
bii$$RWW__C@H$;r   c                s    \         P                  ! V 4      p\        P                  p\        P                  R8X  d   RpRV R2p\        P
                  ! RW14      pV# )zTranslate a shell-like glob pattern to a regular expression; return
a string containing the regex.  Differs from 'fnmatch.translate()' in
that '*' does not match "special characters" (which are
platform-specific).
\z\\\\z\1[^Z]z((?<!\\)(\\\\)*)\.)fnmatchZ	translater/   sepreZsub)rN   re   r{   Zescapeds   &   r   
glob_to_rer}   v  sU     ""7+J &&C	vv~ cU!nG-wCJr   c                s\   V'       d/   \        V \        4      '       d   \        P                  ! V 4      # V # \	        R4      P                  R4      w  rEpV '       d   \	        V 4      pMRpVe   \	        V4      pV\        V4      \        V4      \        V4      ,
           p\        P                  p	\        P                  R8X  d   Rp	V\        V4      \        V4      \        V4      ,
           pV RV V	 RV V 2pMV'       d   V RV\        V4      R  2p\        P                  ! V4      # )zTranslate a shell-like wildcard pattern to a compiled regular
expression.  Return the compiled regex.  If 'is_regex' true,
then 'pattern' is directly compiled to a regex (if it's a string)
or just returned as-is (assumes it's a regex object).
_Z Nry   z\\z\Az.*)	Z
isinstancer'   r|   Zcompiler}   Z	partitionr8   r/   r{   )
rN   rJ   rK   rT   rw   r~   Zendre   Z	prefix_rer{   s
   &&&&      r   rb   rb     s    gs##::g&&N sO--c2MEc(
 
v&	c%j3y>CH+DE	ff66T>CE
S_s3x-GH
r)SEJ<uE
"G2jU&>%?@J::j!!r   rh   )rm   Z
__future__r    rz   rx   r/   r|   Zcollections.abcr   Ztypingr   r   Z_logr   Zerrorsr   r   Zutilr   r   rt   Zsetrr   rn   r#   r}   rb   r   r   r   <module>r      s`    #   	 	 $ $  B i i^	+$# $6 +-)) 	.""r   