+
    SBi;                        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                  ^   ] 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               $    V ^8  d   QhRRRRRR/# )   warnobjectdebug_printreturnNone )formats   "C/usr/lib/python3.14/site-packages/setuptools/_distutils/filelist.py__annotate__FileList.__annotate__$   s!     # #V # #4 #    c                	"    R V n         . V n        R # Nallfilesfiles)selfr   r   s   &&&r   __init__FileList.__init__$   s     /3 "
r   c                    V ^8  d   QhRRRR/# )r   r   Iterable[str]r   r   r   )r   s   "r   r   r   *   s     ! !] !t !r   c                	    Wn         R # r   )r   )r   r   s   &&r   set_allfilesFileList.set_allfiles*   s     r   c                    V ^8  d   QhRRRR/# )r   dirstr | os.PathLike[str]r   r   r   )r   s   "r   r   r   -   s     % %1 %$ %r   c                	&    \        V4      V n        R # r   )findallr   )r   r'   s   &&r   r*   FileList.findall-   s    r   c                    V ^8  d   QhRRRR/# )r   msgr   r   r   r   )r   s   "r   r   r   0   s      v $ r   c                <    ^ 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)distutils.debugr/   print)r   r-   r/   s   && r   r   FileList.debug_print0   s     	*#J r   c                    V ^8  d   QhRRRR/# )r   itemstrr   r   r   )r   s   "r   r   r   ;   s        3  4  r   c                	<    V P                   P                  V4       R # r   )r   append)r   r4   s   &&r   r7   FileList.append;   s    

$r   c                    V ^8  d   QhRRRR/# )r   itemsr"   r   r   r   )r   s   "r   r   r   >   s     ! !M !d !r   c                	<    V P                   P                  V4       R # r   )r   extend)r   r:   s   &&r   r<   FileList.extend>   s    

% r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r   A   s     9 9d 9r   c                	   \        \        \        P                  P                  V P
                  4      4      p. V n        V F:  pV P
                  P                  \        P                  P                  ! V!  4       K<  	  R # r   )sortedmapospathsplitr   r7   join)r   sortable_files
sort_tuples   &  r   sortFileList.sortA   sO    BGGMM4:: >?
(JJJbggllJ78 )r   c                   V ^8  d   QhRR/# r?   r   )r   s   "r   r   r   J   s     " "4 "r   c                	    \        \        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_duplicatesFileList.remove_duplicatesJ   sJ    s4::*Ar2Azz!}

1q5 11JJqM 3r   c                	.   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 )    N'z#' expects <pattern1> <pattern2> ...:rM   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)rE   rP   r   r	   )r   linewordsactionpatternsr'   dir_patternws   &&      r   _parse_template_line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                    V ^8  d   QhRRRR/# )r   r_   r5   r   r   r   )r   s   "r   r   r   p   s     U U# U$ Ur   c                	   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) rW   zinclude  T)anchorz%warning: no files found matching '%s'rX   zexclude z9warning: no previously-included files found matching '%s'rY   zglobal-include Fz>warning: no files found matching '%s' anywhere in distributionrZ   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'r\   zrecursive-exclude {} {}zNwarning: no previously-included files matching '%s' found under directory '%s'r]   zgraft Nz+warning: no directories found matching '%s'r^   zprune z6no previously-included directories found matching '%s'z$this cannot happen: invalid action 'rV   )	re   r   rF   include_patternr   warningexclude_patternr   r   )r   r_   ra   rb   r'   rc   patternr-   s   &&      r   process_template_line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   ro   r5   rj   boolrk   
str | Noneis_regexzLiteral[False]r   r   )r   s   "r   r   r      <        	
 ! 
r   c                	    R # r   r   r   ro   rj   rk   rv   s   &&&&&r   rl   FileList.include_pattern        r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# 
r   ro   zstr | re.Pattern[str]rj   rt   rk   ru   rv   zLiteral[True]r   r   )r   s   "r   r   r      <      &  	   
r   c               	    R # r   r   ry   s   &&&&$r   rl   rz           r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# r}   r   )r   s   "r   r   r      <      &  	
   
r   c                	    R # r   r   ry   s   &&&&&r   rl   rz      r{   r   c          
     ,    V ^8  d   QhRRRRRRRRRR/# 	r   ro   zstr | re.Patternrj   rt   rk   ru   rv   r   r   )r   s   "r   r   r      s<     - -!- - 	-
 - 
-r   c                ^   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'rV   z adding T)translate_patternr   ro   r   r*   searchr   r7   )r   ro   rj   rk   rv   files_found
pattern_renames   &&&&&   r   rl   rz      s    @ &wI
=j>P>P=QQRST == LLNMMD  &&  d!23

!!$'"	 "
 r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# rs   r   )r   s   "r   r   r     rw   r   c                	    R # r   r   ry   s   &&&&&r   rn   FileList.exclude_pattern  r{   r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# r}   r   )r   s   "r   r   r     r~   r   c               	    R # r   r   ry   s   &&&&$r   rn   r     r   r   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# r}   r   )r   s   "r   r   r   "  r   r   c                	    R # r   r   ry   s   &&&&&r   rn   r   !  r{   r   c          
     ,    V ^8  d   QhRRRRRRRRRR/# r   r   )r   s   "r   r   r   )  s<      !  	
  
r   c                   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'rV   z
 removing TrN   )r   r   ro   rO   rP   r   r   )r   ro   rj   rk   rv   r   r   rQ   s   &&&&&   r   rn   r   )  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$   rC   curdirr*   r   r7   r<   rI   rR   re   rp   r   rl   rn   __static_attributes__r   r   r   r   r      s    #! 57II % !9"4<Up      -^       r   r   c                    \         P                  \        P                  ! V RR7      4      pR V 4       p\        \        P                  P
                  V4      # )z
Find all files under 'path'
T)followlinksc              3  v   "   T F/  w  rq3 F$  p\         P                  P                  W4      x  K&  	  K1  	  R # 5ir   )rC   rD   rF   ).0basedirsr   files   &    r   	<genexpr>#_find_all_simple.<locals>.<genexpr>I  s3      :D%6TQVT  QV *s   79)_UniqueDirsfilterrC   walkrD   isfile)rD   
all_uniqueresultss   &  r   _find_all_simpler   D  sE     ##BGGDd$CDJ:DG "''..'**r   c                  0    ] tR tRtRtR t]R 4       tRtR# )r   iO  zv
Exclude previously-seen dirs from walk results,
avoiding infinite recursion.
Ref https://bugs.python.org/issue44497.
c                    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)rC   statst_devst_inoadd)r   	walk_itemr   r   r   r   	candidatefounds   &&      r   __call___UniqueDirs.__call__V  sS     &Ewwt}KK,	!Qyr   c                	$    \        V ! 4       V4      # r   )r   )clsr:   s   &&r   r   _UniqueDirs.filtere  s    ceU##r   r   N)	r   r   r   r   r   r   classmethodr   r   r   r   r   r   r   O  s      $ $r   r   c                   V ^8  d   QhRR/# )r   r'   r(   r   )r   s   "r   r   r   j  s     	 	' 	r   c                    \        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)	r   rC   r   	functoolspartialrD   relpathrB   list)r'   r   make_rels   &  r   r*   r*   j  sH    
 S!E
bii$$RWW__C@H$;r   c                    \         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((?<!\\)(\\\\)*)\.)fnmatch	translaterC   sepresub)ro   r   r   escapeds   &   r   
glob_to_rer   v  sU     ""7+J &&C	vv~ cU!nG-wCJr   c                   V'       d/   \        V \        4      '       d   \        P                  ! V 4      # V # \	        R4      P                  R4      w  rEpV '       d=   \	        V 4      pVP                  V4      '       d   VP                  V4      '       g   Q hMRpVe   \	        V4      pVP                  V4      '       d   VP                  V4      '       g   Q h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).
_ Nr   z\\z\Az.*)
isinstancer5   r   compiler   	partition
startswithendswithrP   rC   r   )
ro   rj   rk   rv   r   r   endr   	prefix_rer   s
   &&&&      r   r   r     sT    gs##::g&&N sO--c2MEc(
$$U++
0C0CC0H0HHH0H
v&	##E**y/A/A#/F/FFFc%j3y>CH+DE	ff66T>CE
S_s3x-GH
r)SEJ<uE
"G2jU&>%?@J::j!!r   r   )r   
__future__r   r   r   rC   r   collections.abcr   typingr   r   _logr   errorsr   r   utilr	   r   r   setr   r   r*   r   r   r   r   r   <module>r      s`    #   	 	 $ $  B i i^	+$# $6 +-)) 	.""r   