+
    =i&S                       R t ^ RIHt ^ RIt^ RIt^ RIHtHtHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHtHt ^ RIt^RIHt ^ R	IHt ^ R
IHt ]'       d   ^ RIHt ]P6                  P8                  tR R lt ! R R4      t ! R R4      t  ! R R] 4      t! ! R R]!4      t" ! R R] 4      t# ! R R]"4      t$ ! R R]#4      t%R R lt& ! R R4      t'R  R! lt(R" R# lt)R$ R% lt*R& R' lt+R( R) lt,R# )*u_  Automatic discovery of Python modules and packages (for inclusion in the
distribution) and other config values.

For the purposes of this module, the following nomenclature is used:

- "src-layout": a directory representing a Python project that contains a "src"
  folder. Everything under the "src" folder is meant to be included in the
  distribution when packaging the project. Example::

    .
    ├── tox.ini
    ├── pyproject.toml
    └── src/
        └── mypkg/
            ├── __init__.py
            ├── mymodule.py
            └── my_data_file.txt

- "flat-layout": a Python project that does not use "src-layout" but instead
  have a directory under the project root for each package::

    .
    ├── tox.ini
    ├── pyproject.toml
    └── mypkg/
        ├── __init__.py
        ├── mymodule.py
        └── my_data_file.txt

- "single-module": a project that contains a single Python script direct under
  the project root (no directory used)::

    .
    ├── tox.ini
    ├── pyproject.toml
    └── mymodule.py

)annotationsN)IterableIteratorMappingfnmatchcase)glob)Path)TYPE_CHECKINGClassVar)StrPath)log)convert_path)Distributionc                    V ^8  d   QhRRRR/# )   pathr   returnbool )formats   "w/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/setuptools/discovery.py__annotate__r   ?   s     1 1g 1$ 1    c                \    \         P                  P                  V 4      P                  4       # N)osr   basenameisidentifier)r   s   &r   _valid_namer   ?   s     77D!..00r   c                  >    ] tR t^DtRtR R ltR R ltR R ltRtR	# )
_Filterzw
Given a list of patterns, create a callable that will be true only if
the input matches at least one of the patterns.
c                    V ^8  d   QhRRRR/# )r   patternsstrr   Noner   )r   s   "r   r   _Filter.__annotate__J   s     1 1# 1$ 1r   c                	:    \         P                  V4      V n        R # r   )dictfromkeys	_patterns)selfr#   s   &*r   __init___Filter.__init__J   s    x0r   c                    V ^8  d   QhRRRR/# r   itemr$   r   r   r   )r   s   "r   r   r&   M   s     E ES ET Er   c                	   a \         ;QJ d)    V3R  lV P                   4       F  '       g   K   R# 	  R# ! V3R  lV P                   4       4      # )c              3  <   <"   T F  p\        SV4      x  K  	  R # 5ir   r   ).0patr0   s   & r   	<genexpr>#_Filter.__call__.<locals>.<genexpr>N   s     D^c;tS))^s   TF)anyr*   r+   r0   s   &fr   __call___Filter.__call__M   s4    sDT^^DssDsDsDT^^DDDr   c                    V ^8  d   QhRRRR/# r/   r   )r   s   "r   r   r&   P   s     & & & &r   c                	    WP                   9   # r   r*   r8   s   &&r   __contains___Filter.__contains__P   s    ~~%%r   r=   N)	__name__
__module____qualname____firstlineno____doc__r,   r9   r>   __static_attributes__r   r   r   r!   r!   D   s    
1E& &r   r!   c                  h    ] tR t^Tt$ RtR	tR]R&   R	tR]R&   ]RR R ll4       t	]R R l4       t
R	tR
# )_Finderz@Base class that exposes functionality for module/package finderszClassVar[tuple[str, ...]]ALWAYS_EXCLUDEDEFAULT_EXCLUDEc               (    V ^8  d   QhRRRRRRRR/# )r   wherer   excludezIterable[str]includer   	list[str]r   )r   s   "r   r   _Finder.__annotate__[   s2      
  
 
  
 	 

 
 
r   c           
         T;'       g    V P                   p\        V P                  \        \	        V4      4      \        . V P                  OVO5!  \        V!  4      4      # )a  Return a list of all Python items (packages or modules, depending on
the finder implementation) found within directory ``where``.

``where`` is the root directory which will be searched.
It should be supplied as a "cross-platform" (i.e. URL-style) path;
it will be converted to the appropriate local path syntax.

``exclude`` is a sequence of names to exclude; ``*`` can be used
as a wildcard in the names.
When finding packages, ``foo.*`` will exclude all subpackages of ``foo``
(but not ``foo`` itself).

``include`` is a sequence of names to include.
If it's specified, only the named items will be included.
If it's not specified, all found items will be included.
``include`` can contain shell style wildcard patterns just like
``exclude``.
)rI   list
_find_iterr   r$   r!   rH   clsrK   rL   rM   s   &&&&r   find_Finder.findZ   sZ    4 00S00NNSZ(6++6g6!
 	
r   c               (    V ^8  d   QhRRRRRRRR/# r   rK   r   rL   r!   rM   r   zIterator[str]r   )r   s   "r   r   rO   ~   s,     " ""&-"8?"	"r   c                	    \         hr   )NotImplementedErrorrS   s   &&&&r   rR   _Finder._find_iter}   s
     "!r   r   N).r   )*)r@   rA   rB   rC   rD   rH   __annotations__rI   classmethodrU   rR   rE   r   r   r   rG   rG   T   sB    J02N-213O.3 
  
D " "r   rG   c                  J    ] tR t^tRtRt]R R l4       t]R R l4       t	Rt
R# )	PackageFinderzA
Generate a list of all Python packages found within a directory
c               (    V ^8  d   QhRRRRRRRR/# rX   r   )r   s   "r   r   PackageFinder.__annotate__   s,     ! !!&-!8?!	!r   c              #  0  "   \         P                  ! \        V4      RR7       F  w  rEpVR,          p. VR&   V F  p\         P                  P	                  WH4      p	\         P                  P                  W4      p
V
P                  \         P                  P                  R4      pRV9   g   V P                  W4      '       g   K  V! V4      '       d   V! V4      '       g   Vx  V R2V9   g   V R2V9   d   K  VP                  V4       K  	  K  	  R# 5i)za
All the packages found in 'where' that pass the 'include' filter, but
not the 'exclude' filter.
T)followlinksNNNr\   r]   .*N)
r   walkr$   r   joinrelpathreplacesep_looks_like_packageappend)rT   rK   rL   rM   rootdirsfilesall_dirsdir	full_pathrel_pathpackages   &&&&        r   rR   PackageFinder._find_iter   s      "$U!FDAwHDGGGLL3	77??9<"**277;;< #:S%<%<Y%P%P 7##GG,<,<!M Ya=G+'"~/H C '   "Gs   CDD!5Dc               $    V ^8  d   QhRRRRRR/# )r   r   r   _package_namer$   r   r   r   )r   s   "r   r   rc      s&     A A' A# A$ Ar   c                |    \         P                  P                  \         P                  P                  V R4      4      # )z%Does a directory look like a package?__init__.py)r   r   isfileri   )r   ry   s   &&r   rm   !PackageFinder._looks_like_package   s&     ww~~bggll4?@@r   r   N)ez_setupz*__pycache__)r@   rA   rB   rC   rD   rH   r_   rR   staticmethodrm   rE   r   r   r   ra   ra      s7     2N! !B A Ar   ra   c                  ,    ] tR t^t]R R l4       tRtR# )PEP420PackageFinderc               $    V ^8  d   QhRRRRRR/# )r   _pathr   ry   r$   r   r   r   )r   s   "r   r    PEP420PackageFinder.__annotate__   s!      7 3 4 r   c                	    R # )Tr   )r   ry   s   &&r   rm   'PEP420PackageFinder._looks_like_package   s    r   r   N)r@   rA   rB   rC   r   rm   rE   r   r   r   r   r      s     r   r   c                  @    ] tR t^tRt]R R l4       t]! ]4      t	Rt
R# )ModuleFinderzQFind isolated Python modules.
This function will **not** recurse subdirectories.
c               (    V ^8  d   QhRRRRRRRR/# rX   r   )r   s   "r   r   ModuleFinder.__annotate__   s,     
 

&-
8?
	
r   c              #  	d  "   \        \        P                  P                  VR 4      4       F~  p\        P                  P	                  \        P                  P                  V4      4      w  rVV P                  V4      '       g   KZ  V! V4      '       g   Kj  V! V4      '       d   Kz  Vx  K  	  R# 5i)z*.pyN)r   r   r   ri   splitextr   _looks_like_module)rT   rK   rL   rM   filemodule_exts   &&&&   r   rR   ModuleFinder._find_iter   st      eV45D77++BGG,<,<T,BCLF))&11vwv 6s   BB0B0&
B0r   N)r@   rA   rB   rC   rD   r_   rR   r   r   r   rE   r   r   r   r   r      s(     
 
 &k2r   r   c                  \    ] tR t^tRt]! ]! R ] 4       4      4      t ]R R l4       t	Rt
R# )FlatLayoutPackageFinderc              #  	.   "   T F  qV R 23x  K  	  R# 5i)rg   Nr   )r3   ps   & r   r5   !FlatLayoutPackageFinder.<genexpr>   s     &GhaS8}hs   c               $    V ^8  d   QhRRRRRR/# )r   r   r   package_namer$   r   r   r   )r   s   "r   r   $FlatLayoutPackageFinder.__annotate__   s&     T T7 T# T$ Tr   c                	*   VP                  R 4      pV^ ,          P                  4       ;'       g    V^ ,          P                  R4      pT;'       dC    \        ;QJ d#    R VR,           4       F  '       d   K   R# 	  R# ! R VR,           4       4      # )r\   -stubsc              3  @   "   T F  qP                  4       x  K  	  R # 5ir   )r   )r3   names   & r   r5   >FlatLayoutPackageFinder._looks_like_package.<locals>.<genexpr>  s     (S):):)<)<s   :   NNFT)splitr   endswithall)r   r   namesroot_pkg_is_valids   &&  r   rm   +FlatLayoutPackageFinder._looks_like_package   su    ""3'!!H113RRuQx7H7H7R SSSS(Sr(SSSSSSS(Sr(S%SSr   r   N)#cibindebiandocdocsdocumentationmanpagesnewsnewsfragments	changelogtesttests	unit_test
unit_testsexampleexamplesscriptstoolsutilutilspythonbuilddistvenvenvrequirementstasksfabfile
site_scons	benchmark
benchmarksexercise	exerciseshtmlcov[._]*)r@   rA   rB   rC   _EXCLUDEtuple
chain_iterrI   r   rm   rE   r   r   r   r   r      s8    'HR J&Gh&GGHO T Tr   r   c                      ] tR tRtRtRtR# )FlatLayoutModuleFinderi  r   N)setupconftestr   r   r   r   r   toxfilenoxfilepavementdodor   r   z[Ss][Cc]onstruct	conanfilemanager   r   r   r   r   )r@   rA   rB   rC   rI   rE   r   r   r   r   r     s    O4 *r   r   c               $    V ^8  d   QhRRRRRR/# )r   root_pkgr$   pkg_dirr   r   rN   r   )r   s   "r   r   r   %  s&     B BC B' Bi Br   c                    \         P                  V4      pV .V Uu. uF  pR P                  W34      NK  	  up,           # u upi )r\   )r   rU   ri   )r   r   nestedns   &&  r   _find_packages_withinr   %  s<     %%g.F:&A&Q8-0&AAAAs   A c                      ] tR tRtRtR R ltR tR t]R R l4       t	]R	 R
 l4       t
R%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 R 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$# )&ConfigDiscoveryi*  z}Fill-in metadata and options that can be automatically derived
(from other metadata/options, the file system or conventions)
c                    V ^8  d   QhRRRR/# )r   distributionr   r   r%   r   )r   s   "r   r   ConfigDiscovery.__annotate__/  s     ' '\ 'd 'r   c                	<    Wn         R V n        R V n        R V n        R# )FN)r   _called	_disabled_skip_ext_modules)r+   r   s   &&r   r,   ConfigDiscovery.__init__/  s     	!&r   c                    RV n         R# )z+Internal API to disable automatic discoveryTN)r   r+   s   &r   _disableConfigDiscovery._disable5  s	    r   c                    RV n         R# )a  Internal API to disregard ext_modules.

Normally auto-discovery would not be triggered if ``ext_modules`` are set
(this is done for backward compatibility with existing packages relying on
``setup.py`` or ``setup.cfg``). However, ``setuptools`` can call this function
to ignore given ``ext_modules`` and proceed with the auto-discovery if
``packages`` and ``py_modules`` are not given (e.g. when using pyproject.toml
metadata).
TN)r   r   s   &r   _ignore_ext_modules#ConfigDiscovery._ignore_ext_modules9  s     "&r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   F  s     / /7 /r   c                	^    V P                   P                  ;'       g    \        P                  # r   )r   src_rootr   curdirr   s   &r   	_root_dirConfigDiscovery._root_dirE  s      yy!!..RYY.r   c                   V ^8  d   QhRR/# )r   r   dict[str, str]r   )r   s   "r   r   r   K  s     % %n %r   c                	b    V P                   P                  f   / # V P                   P                  # r   )r   package_dirr   s   &r   _package_dirConfigDiscovery._package_dirJ  s'    99  (Iyy$$$r   c               (    V ^8  d   QhRRRRRRRR/# )r   forcer   r   ignore_ext_modulesr   r%   r   )r   s   "r   r   r   P  s,      )-JN	r   c                    VRJ d'   V P                   '       g   V P                  '       d   R# V P                  V4       V'       d   V P                  4        RV n         R# )ay  Automatically discover missing configuration fields
and modifies the given ``distribution`` object in-place.

Note that by default this will only have an effect the first time the
``ConfigDiscovery`` object is called.

To repeatedly invoke automatic discovery (e.g. when the project
directory changes), please use ``force=True`` (or create a new
``ConfigDiscovery`` instance).
FNT)r   r   _analyse_package_layoutanalyse_name)r+   r   r   r   s   &&&&r   r9   ConfigDiscovery.__call__P  sC     E>t|||t~~~$$%78r   c                    V ^8  d   QhRRRR/# r   r   r   r   r   )r   s   "r   r   r   g  s     
 
 
 
r   c                x   T;'       g    V P                   pV P                  P                  RJ ;'       g    T'       * pV P                  P                  RJ;'       g_    V P                  P                  RJ;'       g?    T;'       g5    \        V P                  R4      ;'       d    V P                  P                  # )zF``True`` if the user has specified some form of package/module listingNconfiguration)r   r   ext_modulespackages
py_moduleshasattrr  )r+   r   r  s   && r   _explicitly_specified%ConfigDiscovery._explicitly_specifiedg  s    /II43I3I9900D8NN<NOIId* ( (yy##4/( (( ( tyy/2 ( (		''	
r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r   t  s     
 
$ 
4 
r   c                	    V P                  V4      '       d   R # \        P                  ! R4       V P                  4       ;'       g)    V P	                  4       ;'       g    V P                  4       # )TzLNo `packages` or `py_modules` configuration, performing automatic discovery.)r	  r   debug_analyse_explicit_layout_analyse_src_layout_analyse_flat_layout)r+   r   s   &&r   r   'ConfigDiscovery._analyse_package_layoutt  sk    %%&899 		#	
 ))+ + +'')+ + ((*		
r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r     s      $ r   c                  a V P                   P                  4       pVP                  RR4       V P                  oV'       g   R# \        P
                  ! RV 24       \        V3R lVP                  4        4       4      p\        V4      V P                  n
        \        P
                  ! RV P                  P                   24       R# )zAThe user can explicitly give a package layout via ``package_dir`` NFz(`explicit-layout` detected -- analysing c              3  |   <"   T F1  w  r\        V\        P                  P                  SV4      4      x  K3  	  R # 5ir   )r   r   r   ri   )r3   pkg
parent_dirroot_dirs   &  r   r5   ;ConfigDiscovery._analyse_explicit_layout.<locals>.<genexpr>  s3      
#6 "#rww||Hj'IJJ#6s   9<discovered packages -- T)r   copypopr   r   r  r   itemsrQ   r   r  )r+   r   pkgsr  s   &  @r   r  (ConfigDiscovery._analyse_explicit_layout  s    '',,.D!>>		<[MJK 
#.#4#4#6
 
 "$Z				+DII,>,>+?@Ar   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r     s      T r   c                   V P                   p\        P                  P                  V P                  VP                  RR4      4      p\        P                  P                  V4      '       g   R# \        P                  ! RV 24       VP                  R\        P                  P                  V4      4       WP                  n        \        P                  V4      V P                  n        \         P                  V4      V P                  n        \        P                  ! RV P                  P                   24       \        P                  ! RV P                  P"                   24       R# )av  Try to find all packages or modules under the ``src`` directory
(or anything pointed by ``package_dir[""]``).

The "src-layout" is relatively safe for automatic discovery.
We assume that everything within is meant to be included in the
distribution.

If ``package_dir[""]`` is not given, but the ``src`` directory exists,
this function will set ``package_dir[""] = "src"``.
r  srcFz#`src-layout` detected -- analysing r  discovered py_modules -- T)r   r   r   ri   r   getisdirr   r  
setdefaultr   r   r   r   rU   r  r   r  )r+   r   src_dirs   &  r   r  #ConfigDiscovery._analyse_src_layout  s     '''',,t~~{r5/IJww}}W%%		7yABr277#3#3G#<= +		055g>		+009				+DII,>,>+?@A		-dii.B.B-CDEr   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r     s     M Md Mr   c                    \         P                  ! RV P                   24       V P                  4       ;'       g    V P	                  4       # )a  Try to find all packages and modules under the project root.

Since the ``flat-layout`` is more dangerous in terms of accidentally including
extra files/directories, this function is more conservative and will raise an
error if multiple packages or modules are found.

This assumes that multi-package dists are uncommon and refuse to support that
use case in order to be able to prevent unintended errors.
z$`flat-layout` detected -- analysing )r   r  r   _analyse_flat_packages_analyse_flat_modulesr   s   &r   r  $ConfigDiscovery._analyse_flat_layout  s=     			88HIJ**,LL0J0J0LLr   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r     s       r   c                	B   \         P                  V P                  4      V P                  n        \        \        V P                  P                  4      4      p\        P                  ! R V P                  P                   24       V P                  VR4       \        V4      # )r  r  )r   rU   r   r   r  remove_nested_packagesremove_stubsr   r  _ensure_no_accidental_inclusionr   )r+   	top_levels   & r   r,  &ConfigDiscovery._analyse_flat_packages  so    499$..I		*<		8J8J+KL			+DII,>,>+?@A,,Y
CIr   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r     s     * *t *r   c                	B   \         P                  V P                  4      V P                  n        \
        P                  ! R V P                  P                   24       V P                  V P                  P                  R4       \        V P                  P                  4      # )r$  modules)	r   rU   r   r   r  r   r  r3  r   r   s   &r   r-  %ConfigDiscovery._analyse_flat_modules  sk    5::4>>J				-dii.B.B-CDE,,TYY-A-A9MDII(())r   c                    V ^8  d   QhRRRR/# )r   detectedrN   kindr$   r   )r   s   "r   r   r     s     7 7	 7 7r   c                	r    \        V4      ^8  d'   ^ RIHp ^ RIHp RV RV RV R2pV! V! V4      4      hR# )r   )cleandoc)PackageDiscoveryErrorzMultiple top-level z discovered in a flat-layout: z.

            To avoid accidental inclusion of unwanted files or directories,
            setuptools will not proceed with this build.

            If you are trying to create a single distribution with multiple a  
            on purpose, you should not rely on automatic discovery.
            Instead, consider the following options:

            1. set up custom discovery (`find` directive with `include` or `exclude`)
            2. use a `src-layout`
            3. explicitly set `py_modules` or `packages` with a list of names

            To find more information, look for "package discovery" on setuptools docs.
            N)leninspectr>  setuptools.errorsr?  )r+   r;  r<  r>  r?  msgs   &&&   r   r3  /ConfigDiscovery._ensure_no_accidental_inclusion  sU    x=1(?)$/MhZ XM
 NRF 	SC (66) r   c                   V ^8  d   QhRR/# )r   r   r%   r   )r   s   "r   r   r     s     + +d +r   c                R   V P                   P                  P                  '       g   V P                   P                  '       d   R# \        P                  ! R4       V P                  4       ;'       g    V P                  4       pV'       d   WP                   P                  n        R# R# )zThe packages/modules are the essential contribution of the author.
Therefore the name of the distribution can be derived from them.
Nz7No `name` configuration, performing automatic discovery)r   metadatar   r   r  #_find_name_single_package_or_module_find_name_from_packages)r+   r   s   & r   r   ConfigDiscovery.analyse_name  sy     99"""diinnn		KL 446 / /,,. 	 &*II# r   c                   V ^8  d   QhRR/# r   r   
str | Noner   )r   s   "r   r   r     s      Z r   c                    R Fi  p\        V P                  VR4      ;'       g    . pV'       g   K.  \        V4      ^8X  g   K@  \        P                  ! RV^ ,           24       V^ ,          u # 	  R# )zExactly one module or packageNz&Single module/package detected, name: )r  r  )getattrr   r@  r   r  )r+   fieldr  s   &  r   rH  3ConfigDiscovery._find_name_single_package_or_module  s[    /EDIIud399rEuUq		B58*MNQx	 0 r   c                   V ^8  d   QhRR/# rL  r   )r   s   "r   r   r     s      * r   c                |   V P                   P                  '       g   R# \        \        V P                   P                  \        R7      4      pV P                   P
                  ;'       g    / p\        WV P                  4      pV'       d   \        P                  ! RV 24       V# \        P                  ! R4       R# )z<Try to find the root package that is not a PEP 420 namespaceNkeyz&Common parent package detected, name: z7No parent package detected, impossible to derive `name`)r   r  r2  sortedr@  r   find_parent_packager   r   r  warn)r+   r  r   
parent_pkgs   &   r   rI  (ConfigDiscovery._find_name_from_packages  s    yy!!!tyy'9'9s CDii++11r(O
II>zlKLJKr   )r   r   r   r   N)FTF)r@   rA   rB   rC   rD   r,   r   r   propertyr   r   r9   r	  r   r  r  r  r,  r-  r3  r   rH  rI  rE   r   r   r   r   r   *  s    '
& / / % %
.

$$2M*7.+" r   r   c                    V ^8  d   QhRRRR/# r   r  rN   r   r   )r   s   "r   r   r     s      Y 9 r   c                N  a \        V \        R7      pVR,          p\        V4      p\        \        V4      4       Ff  w  po\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       g   KH  VP                  W4,
          ^,
          4       Kh  	  V# )zRemove nested packages from a list of packages.

>>> remove_nested_packages(["a", "a.b1", "a.b2", "a.b1.c1"])
['a']
>>> remove_nested_packages(["a", "b", "c.d", "c.d.e.f", "g.h", "a.a1"])
['a', 'b', 'c.d', 'g.h']
rT  rf   c              3  L   <"   T F  pSP                  V R 24      x  K  	  R# 5ir\   N
startswith)r3   otherr   s   & r   r5   )remove_nested_packages.<locals>.<genexpr>  s#     Ct%{++s   !$TF)rV  r@  	enumeratereversedr7   r  )r  r  r4  sizeir   s   &    @r   r1  r1    su     ($DQIt9DXd^,43CC333CCCCMM$(Q,' - r   c                    V ^8  d   QhRRRR/# r]  r   )r   s   "r   r   r      s     Q Q9 Q Qr   c                    V  Uu. uF3  qP                  R4      ^ ,          P                  R4      '       d   K1  VNK5  	  up# u upi )zRemove type stubs (:pep:`561`) from a list of packages.

>>> remove_stubs(["a", "a.b", "a-stubs", "a-stubs.b.c", "b", "c-stubs"])
['a', 'a.b', 'b']
r\   r   )r   r   )r  r  s   & r   r2  r2     s6     $P8C99S>!+<+E+Eh+OCC8PPPs
   .AAc               (    V ^8  d   QhRRRRRRRR/# )	r   r  rN   r   Mapping[str, str]r  r   r   rM  r   )r   s   "r   r   r   )  s,      &7CJr   c                  a \        V \        R7      p . p\        V 4       Fk  w  po\        ;QJ d(    V3R lW^,           R  4       F  '       d   K   RM	  RM! V3R lW^,           R  4       4      '       g    MVP	                  S4       Km  	  V FX  o\        SW4      p\        P                  P                  VR4      p\        P                  P                  V4      '       g   KV  Su # 	  R# )z0Find the parent package that is not a namespace.rT  c              3  J   <"   T F  qP                  S R 24      x  K  	  R# 5ir`  ra  )r3   r   r   s   & r   r5   &find_parent_package.<locals>.<genexpr>0  s#     G5F<<4&
++5Fs    #NFTr{   )
rV  r@  re  r   rn   find_package_pathr   r   ri   r|   )r  r   r  common_ancestorsrh  pkg_pathinitr   s   &&&    @r   rW  rW  )  s     hC(HX&4sGX!eg5FGsssGX!eg5FGGG
 % ' !$T;Aww||Hm477>>$K	 ! r   c               (    V ^8  d   QhRRRRRRRR/# )r   r   r$   r   rl  r  r   r   r   )r   s   "r   r   r   A  s,     > >
>->9@>>r   c                   V P                  R4      p\        \        V4      ^ R4       FK  pRP                  VRV 4      pWQ9   g   K  W,          p\        P
                  P                  ! W&.W4R O5!  u # 	  VP                  R4      ;'       g    Rp\        P
                  P                  ! V.VP                  R4      OVO5!  # )a_  Given a package name, return the path where it should be found on
disk, considering the ``package_dir`` option.

>>> path = find_package_path("my.pkg", {"": "root/is/nested"}, ".")
>>> path.replace(os.sep, "/")
'./root/is/nested/my/pkg'

>>> path = find_package_path("my.pkg", {"my": "root/is/nested"}, ".")
>>> path.replace(os.sep, "/")
'./root/is/nested/pkg'

>>> path = find_package_path("my.pkg", {"my.pkg": "root/is/nested"}, ".")
>>> path.replace(os.sep, "/")
'./root/is/nested'

>>> path = find_package_path("other.pkg", {"my.pkg": "root/is/nested"}, ".")
>>> path.replace(os.sep, "/")
'./other/pkg'
r\   Nr  /)r   ranger@  ri   r   r   r%  )r   r   r  partsrh  partial_nameparents   &&&    r   rp  rp  A  s    , JJsOE3u:q"%xxbq	*& .F77<<=59== & __R &&BF77<<=6<<#4=u==r   c               $    V ^8  d   QhRRRRRR/# )r   r  rN   package_pathr   r   r   r   )r   s   "r   r   r   c  s&     N NI NW N Nr   c           
         \        V 4      p\        V4      P                  pV Uu/ uF'  qDR P                  . VOVP	                  R4      O4      bK)  	  up# u upi )rv  r\   )r1  r	   ry  ri   r   )r  r}  parent_pkgsprefixr  s   &&   r   construct_package_dirr  c  sS    (2K,%%FALM#4F4SYYs^455MMMs   -A)-rD   
__future__r   	itertoolsr   collections.abcr   r   r   fnmatchr   r   pathlibr	   typingr
   r   _distutils_hack.override_distutils_hackr   r   	distutilsr   distutils.utilr   
setuptoolsr   chainfrom_iterabler   r   r!   rG   ra   r   r   r   r   r   r   r1  r2  rW  rp  r  r   r   r   <module>r     s   %N #  	 7 7    *    ''__**
1
& & -" -"`,AG ,A^- 37 322T1 2Tj*\ *<B
a aH$Q0>DNr   