
    ff                        d dl mZ d dlZd dlmZ d dlmZ d dlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ e
j                  j!                  d      ZdddZddZdhZ	 	 	 	 	 	 	 	 ddZy)    )annotationsN)Path)Iterable)Iterator   )_entrypoints)_log)_types)Configurationdiscoverc              #  \   K   t        |       } |  |r| j                  E d{    yy7 w)z
    Iterate though a path and each of its parents.
    :param root: File path.
    :param search_parents: If ``False`` the parents are not considered.
    N)r   parents)rootsearch_parentss     o/var/dept/share/cheung/public_html/OutSchool/python/env/lib/python3.12/site-packages/setuptools_scm/discover.pywalk_potential_rootsr      s.      :D
J<< s   !,*,c                    t         j                  j                  t         j                  j                  | |            r6t         j                  j	                  |      syt
        j                  d|       y)z
    Consider a ``root`` as entry-point.
    :param root: File path.
    :param name: Subdirectory name.
    :return: ``True`` if a subdirectory ``name`` exits in ``root``.
    Tzignoring bad ep %sF)ospathexistsjoinisabslogdebug)r   names     r   match_entrypointr      sH     
ww~~bggll4./ww}}T"		&-    z setuptools_scm_git_archive:parsec              #  .  K   t         j                  d||        ddlm} t	        | |j
                        D ][  } ||      D ]N  }|j                  t        v rt        ||j                        s-t         j                  d||       ||_
        | P ] yw)a  
    Consider different entry-points in ``root`` and optionally its parents.
    :param root: File path.
    :param entrypoint: Entry-point to consider.
    :param config: Configuration,
        read ``search_parent_directories``, write found parent to ``parent``.
    zlooking for ep %s in %sr   )iter_entry_pointszfound ep %s in %sN)r   r   r   r   r   search_parent_directoriesvalue_BLOCKED_EP_TARGETSr   r   parent)r   
entrypointconfigr   wdeps         r   iter_matching_entrypointsr(   1   s      II'T:/"4)I)IJ #J/ 	Bxx..BGG,		-r26 "	s   A+B.'B)T)r   _t.PathTr   boolreturnzIterator[Path])r   r)   r   strr+   r*   )r   r)   r$   r,   r%   r   r+   z!Iterable[_entrypoints.EntryPoint])
__future__r   r   pathlibr   typingr   r    r   r	   r
   _t_configr   r   getChildr   r   r"   r(    r   r   <module>r5      sn    " 	       "
hh
#	 " :: 
 #-:&r   