ó
    Eñi&S  ã                  óî  • S r SSKJr  SSKrSSKrSSKJrJr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rS	S
KJr  SSKJr  SSKJr  \(       a  SSKJr  \R6                  R8                  rS%S jr " S S5      r " S S5      r  " S S\ 5      r! " S S\!5      r" " S S\ 5      r# " S S\"5      r$ " S S\#5      r%S&S jr& " S S5      r'S'S  jr(S'S! jr)        S(S" jr*        S)S# jr+S*S$ jr,g)+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                ó\   • [         R                  R                  U 5      R                  5       $ ©N)ÚosÚpathÚbasenameÚisidentifier)r   s    ÚQ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/setuptools/discovery.pyÚ_valid_namer   ?   s    € ä�7‰7×Ñ˜DÓ!×.Ñ.Ó0Ð0ó    c                  ó6   • \ rS rSrSrSS jrS	S jrS	S jrSrg)
Ú_FilteréD   zw
Given a list of patterns, create a callable that will be true only if
the input matches at least one of the patterns.
c                ó8   • [         R                  U5      U l        g r   )ÚdictÚfromkeysÚ	_patterns)ÚselfÚpatternss     r   Ú__init__Ú_Filter.__init__J   s   € ÜŸ™ xÓ0ˆ�r   c                óB   ^• [        U4S jU R                   5       5      $ )Nc              3  ó<   >#   • U  H  n[        TU5      v •  M     g 7fr   r   )Ú.0ÚpatÚitems     €r   Ú	<genexpr>Ú#_Filter.__call__.<locals>.<genexpr>N   s   øé € ÐD²^¨c”;˜t S×)Ð)²^ùs   ƒ)Úanyr!   ©r"   r*   s    `r   Ú__call__Ú_Filter.__call__M   s   ø€ ÜÔD°T·^²^ÓDÓDÐDr   c                ó   • XR                   ;   $ r   ©r!   r.   s     r   Ú__contains__Ú_Filter.__contains__P   s   € Ø—~‘~Ñ%Ð%r   r2   N)r#   ÚstrÚreturnÚNone)r*   r5   r6   Úbool)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r$   r/   r3   Ú__static_attributes__© r   r   r   r   D   s   † ñô
1ôE÷&r   r   c                  ó†   • \ rS rSr% SrSrS\S'   SrS\S'   \   S
       SS jj5       r	\        SS j5       r
Srg	)Ú_FinderéT   z@Base class that exposes functionality for module/package findersr?   zClassVar[tuple[str, ...]]ÚALWAYS_EXCLUDEÚDEFAULT_EXCLUDEc           	     ó¾   • U=(       d    U R                   n[        U R                  [        [	        U5      5      [        / U R                  QUQ76 [        U6 5      5      $ )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``.
)rD   ÚlistÚ
_find_iterr   r5   r   rC   ©ÚclsÚwhereÚexcludeÚincludes       r   ÚfindÚ_Finder.findZ   sW   € ð4 ×0˜S×0Ñ0ˆÜØ�N‰NÜœS ›ZÓ(ÜÐ6˜×+Ñ+Ð6¨gÒ6Ü˜Ð!óó
ð 	
r   c                ó   • [         er   )ÚNotImplementedErrorrH   s       r   rG   Ú_Finder._find_iter}   s
   € ô "Ð!r   N)Ú.r?   )Ú*)rJ   r   rK   úIterable[str]rL   rT   r6   ú	list[str]©rJ   r   rK   r   rL   r   r6   zIterator[str])r9   r:   r;   r<   r=   rC   Ú__annotations__rD   ÚclassmethodrM   rG   r>   r?   r   r   rA   rA   T   s“   ‡ ÙJà02€NÐ-Ó2Ø13€OÐ.Ó3àð Ø!#Ø!'ð	 
àð 
ð ð 
ð ð	 
ð
 
ô 
ó ð 
ðD ð"Øð"Ø&-ð"Ø8?ð"à	ó"ó ó"r   rA   c                  óT   • \ rS rSrSrSr\        SS j5       r\S	S j5       r	Sr
g)
ÚPackageFinderé„   zA
Generate a list of all Python packages found within a directory
)Úez_setupz*__pycache__c              #  ó  #   • [         R                  " [        U5      SS9 Hâ  u  pEnUSS n/ USS& U HÌ  n[         R                  R	                  XH5      n	[         R                  R                  X‘5      n
U
R                  [         R                  R                  S5      nSU;   d  U R                  X›5      (       d  M‰  U" U5      (       a  U" U5      (       d  Uv •  U S3U;   d	  U S3U;   a  M»  UR                  U5        MÎ     Mä     g7f)za
All the packages found in 'where' that pass the 'include' filter, but
not the 'exclude' filter.
T)ÚfollowlinksNrR   rS   ú.*)
r   Úwalkr5   r   ÚjoinÚrelpathÚreplaceÚsepÚ_looks_like_packageÚappend)rI   rJ   rK   rL   ÚrootÚdirsÚfilesÚall_dirsÚdirÚ	full_pathÚrel_pathÚpackages               r   rG   ÚPackageFinder._find_iter‹   sæ   é € ô "$§¢¬¨U«ÀÔ!FÑˆD˜à™A�wˆHØˆD‘ˆGã�ÜŸG™GŸL™L¨Ó3�	ÜŸ7™7Ÿ?™?¨9Ó<�Ø"×*Ñ*¬2¯7©7¯;©;¸Ó<�ð ˜#“: S×%<Ñ%<¸Y×%PÑ%PÙñ ˜7×#Ñ#©G°G×,<Ñ,<Ø!’Mð �Y˜a�= GÓ+°'°¸"¨~ÀÓ/HÙð —‘˜CÖ ó'  ò "Gùs   ‚DDc                ó|   • [         R                  R                  [         R                  R                  U S5      5      $ )z%Does a directory look like a package?ú__init__.py)r   r   Úisfilera   )r   Ú_package_names     r   re   Ú!PackageFinder._looks_like_package­   s&   € ô �w‰w�~‰~œbŸg™gŸl™l¨4°Ó?Ó@Ð@r   r?   NrV   )r   r   rs   r5   r6   r8   )r9   r:   r;   r<   r=   rC   rX   rG   Ústaticmethodre   r>   r?   r   r   rZ   rZ   „   sW   † ñð 2€Nàð!Øð!Ø&-ð!Ø8?ð!à	ó!ó ð!ðB óAó óAr   rZ   c                  ó(   • \ rS rSr\SS j5       rSrg)ÚPEP420PackageFinderé³   c                ó   • g)NTr?   )Ú_pathrs   s     r   re   Ú'PEP420PackageFinder._looks_like_package´   s   € àr   r?   N)rz   r   rs   r5   r6   r8   )r9   r:   r;   r<   ru   re   r>   r?   r   r   rw   rw   ³   s   † Øóó ór   rw   c                  óL   • \ rS rSrSr\        SS j5       r\" \5      r	Sr
g)ÚModuleFinderé¹   zQFind isolated Python modules.
This function will **not** recurse subdirectories.
c              #  ó\  #   • [        [        R                  R                  US5      5       H{  n[        R                  R	                  [        R                  R                  U5      5      u  pVU R                  U5      (       d  MY  U" U5      (       d  Mh  U" U5      (       a  Mw  Uv •  M}     g 7f)Nz*.py)r	   r   r   ra   Úsplitextr   Ú_looks_like_module)rI   rJ   rK   rL   ÚfileÚmoduleÚ_exts          r   rG   ÚModuleFinder._find_iter¾   st   é € ô œŸ™Ÿ™ e¨VÓ4Ö5ˆDÜŸ7™7×+Ñ+¬B¯G©G×,<Ñ,<¸TÓ,BÓC‰LˆFà×)Ñ)¨&×1Ñ1Ùá�v�‹¡w¨v§£Ø”ò 6ùs   ‚BB,ÂB,Â#	B,r?   NrV   )r9   r:   r;   r<   r=   rX   rG   ru   r   r�   r>   r?   r   r   r}   r}   ¹   sH   † ñð ð
Øð
Ø&-ð
Ø8?ð
à	ó
ó ð
ñ & kÓ2Ór   r}   c                  óX   • \ rS rSrSr\" \" S \ 5       5      5      r \SS j5       r	Sr
g)ÚFlatLayoutPackageFinderéÒ   )#Ú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ú[._]*c              #  ó.   #   • U  H  oU S 34v •  M     g7f)r_   Nr?   )r(   Úps     r   r+   Ú!FlatLayoutPackageFinder.<genexpr>ü   s   é € Ð&Gºh¸¨a¨S°¨8¥}ºhùs   ‚c                ó¼   • UR                  S5      nUS   R                  5       =(       d    US   R                  S5      nU=(       a    [        S USS   5       5      $ )NrR   r   ú-stubsc              3  ó@   #   • U  H  oR                  5       v •  M     g 7fr   )r   )r(   Únames     r   r+   Ú>FlatLayoutPackageFinder._looks_like_package.<locals>.<genexpr>  s   é € Ð(SÊÀ×):Ñ):×)<Ð)<Êùs   ‚r   )Úsplitr   ÚendswithÚall)rz   Úpackage_nameÚnamesÚroot_pkg_is_valids       r   re   Ú+FlatLayoutPackageFinder._looks_like_packageÿ   sU   € à×"Ñ" 3Ó'ˆà! !™H×1Ñ1Ó3×R°u¸Q±x×7HÑ7HÈÓ7RÐØ ×S¤SÑ(SÈÈqÈrÉÓ(SÓ%SÐSr   r?   N)rz   r   r·   r5   r6   r8   )r9   r:   r;   r<   Ú_EXCLUDEÚtupleÚ
chain_iterrD   ru   re   r>   r?   r   r   r‡   r‡   Ò   s8   † ð'€HñR ™JÑ&G¹hÓ&GÓGÓH€OØ àóTó óTr   r‡   c                  ó   • \ rS rSrSrSrg)ÚFlatLayoutModuleFinderi  )ÚsetupÚconftestr“   r”   r—   r˜   rž   ÚtoxfileÚnoxfileÚpavementÚdodor£   r¤   z[Ss][Cc]onstructÚ	conanfileÚmanager¦   r§   r¨   r©   r«   r?   N)r9   r:   r;   r<   rD   r>   r?   r   r   r¿   r¿     s   † ð€Oò4 *r   r¿   c                ó„   • [         R                  U5      nU /U Vs/ s H  nSR                  X45      PM     sn-   $ s  snf )NrR   )rw   rM   ra   )Úroot_pkgÚpkg_dirÚnestedÚns       r   Ú_find_packages_withinrÍ   %  s<   € Ü ×%Ñ% gÓ.€FØˆ:¹&ÓAº&°Q˜Ÿ™ 8 -Ö0¹&ÑAÑAÐAùÒAs   œ=c                  óâ   • \ rS rSrSrSS jrS rS r\SS j5       r	\SS j5       r
 S       SS 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S jrSS jrSS jrSS jrSrg) ÚConfigDiscoveryi*  z}Fill-in metadata and options that can be automatically derived
(from other metadata/options, the file system or conventions)
c                ó:   • Xl         SU l        SU l        SU l        g )NF)rŸ   Ú_calledÚ	_disabledÚ_skip_ext_modules)r"   Údistributions     r   r$   ÚConfigDiscovery.__init__/  s   € Ø Œ	ØˆŒØˆŒØ!&ˆÕr   c                ó   • SU l         g)z+Internal API to disable automatic discoveryTN)rÒ   ©r"   s    r   Ú_disableÚConfigDiscovery._disable5  s	   € àˆ�r   c                ó   • SU l         g)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                ó\   • U R                   R                  =(       d    [        R                  $ r   )rŸ   Úsrc_rootr   Úcurdirr×   s    r   Ú	_root_dirÚConfigDiscovery._root_dirE  s   € ð �y‰y×!Ñ!×.¤R§Y¡YÐ.r   c                ó`   • U R                   R                  c  0 $ U R                   R                  $ r   )rŸ   Úpackage_dirr×   s    r   Ú_package_dirÚConfigDiscovery._package_dirJ  s'   € à�9‰9× Ñ Ñ(ØˆIØ�y‰y×$Ñ$Ð$r   c                ó²   • USL a#  U R                   (       d  U R                  (       a  gU R                  U5        U(       a  U R                  5         SU l         g)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"   Úforcer²   Úignore_ext_moduless       r   r/   ÚConfigDiscovery.__call__P  s?   € ð �EŠ>˜tŸ|Ÿ|¨t¯~¯~àà×$Ñ$Ð%7Ô8ÞØ×ÑÔàˆ�r   c                ól  • U=(       d    U R                   nU R                  R                  SL =(       d    U(       + nU R                  R                  SL=(       d[    U R                  R                  SL=(       d<    U=(       d3    [        U R                  S5      =(       a    U R                  R                  $ )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°4×3IÑ3IÐØŸ9™9×0Ñ0°DÐ8×NÐ<NÔOˆà�I‰I×Ñ dÐ*÷ (Ø�y‰y×#Ñ#¨4Ð/÷(à÷(ô �t—y‘y /Ó2÷ (Ø—	‘	×'Ñ'ð	
r   c                óØ   • U R                  U5      (       a  g[        R                  " S5        U R                  5       =(       d'    U R	                  5       =(       d    U R                  5       $ )NTzLNo `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  sa   € Ø×%Ñ%Ð&8×9Ñ9ð ä�	Š	ð#ô	
ð ×)Ñ)Ó+÷ +Ø×'Ñ'Ó)÷+ð ×(Ñ(Ó*ð		
r   c                óŒ  ^• U R                   R                  5       nUR                  SS5        U R                  mU(       d  g[        R
                  " SU 35        [        U4S jUR                  5        5       5      n[        U5      U R                  l
        [        R
                  " SU R                  R                   35        g)zAThe user can explicitly give a package layout via ``package_dir``Ú NFz(`explicit-layout` detected -- analysing c              3  ó|   >#   • U  H1  u  p[        U[        R                  R                  TU5      5      v •  M3     g 7fr   )rÍ   r   r   ra   )r(   ÚpkgÚ
parent_dirÚroot_dirs      €r   r+   Ú;ConfigDiscovery._analyse_explicit_layout.<locals>.<genexpr>�  s3   øé € ð 
â#6‘�ô " #¤r§w¡w§|¡|°H¸jÓ'I×JÐJÚ#6ùs   ƒ9<údiscovered packages -- T)rä   ÚcopyÚpoprà   r   rõ   r½   ÚitemsrF   rŸ   rï   )r"   rã   Úpkgsrÿ   s      @r   rö   Ú(ConfigDiscovery._analyse_explicit_layout†  sœ   ø€ à×'Ñ'×,Ñ,Ó.ˆØ�‰˜˜DÔ!Ø—>‘>ˆæØä�	Š	Ð<¸[¸MÐJÔKÜô 
à#.×#4Ñ#4Ô#6ó
ó 
ˆô " $›Zˆ�	‰	ÔÜ�	Š	Ð+¨D¯I©I×,>Ñ,>Ð+?Ð@ÔAØr   c                óÎ  • U R                   n[        R                  R                  U R                  UR                  SS5      5      n[        R                  R                  U5      (       d  g[        R                  " SU 35        UR                  S[        R                  R                  U5      5        XR                  l        [        R                  U5      U R                  l        [         R                  U5      U R                  l        [        R                  " SU R                  R                   35        [        R                  " SU R                  R"                   35        g)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   ra   rà   ÚgetÚisdirr   rõ   Ú
setdefaultr   rŸ   rã   rw   rM   rï   r}   rð   )r"   rã   Úsrc_dirs      r   r÷   Ú#ConfigDiscovery._analyse_src_layout˜  sô   € ð ×'Ñ'ˆÜ—'‘'—,‘,˜tŸ~™~¨{¯©¸rÀ5Ó/IÓJˆÜ�w‰w�}‰}˜W×%Ñ%Øä�	Š	Ð7¸°yÐAÔBØ×Ñ˜r¤2§7¡7×#3Ñ#3°GÓ#<Ô=Ø +�	‰	ÔÜ0×5Ñ5°gÓ>ˆ�	‰	ÔÜ+×0Ñ0°Ó9ˆ�	‰	ÔÜ�	Š	Ð+¨D¯I©I×,>Ñ,>Ð+?Ð@ÔAÜ�	Š	Ð-¨d¯i©i×.BÑ.BÐ-CÐDÔEØr   c                ó–   • [         R                  " SU R                   35        U R                  5       =(       d    U R	                  5       $ )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°×0JÑ0JÓ0LÐLr   c                óB  • [         R                  U R                  5      U R                  l        [        [        U R                  R                  5      5      n[        R                  " SU R                  R                   35        U R                  US5        [        U5      $ )Nr  rï   )r‡   rM   rà   rŸ   rï   Úremove_nested_packagesÚremove_stubsr   rõ   Ú_ensure_no_accidental_inclusionr8   )r"   Ú	top_levels     r   r  Ú&ConfigDiscovery._analyse_flat_packages¾  so   € Ü4×9Ñ9¸$¿.¹.ÓIˆ�	‰	ÔÜ*¬<¸¿	¹	×8JÑ8JÓ+KÓLˆ	Ü�	Š	Ð+¨D¯I©I×,>Ñ,>Ð+?Ð@ÔAØ×,Ñ,¨Y¸
ÔCÜ�I‹Ðr   c                óB  • [         R                  U R                  5      U R                  l        [
        R                  " SU R                  R                   35        U R                  U R                  R                  S5        [        U R                  R                  5      $ )Nr	  Úmodules)	r¿   rM   rà   rŸ   rð   r   rõ   r  r8   r×   s    r   r  Ú%ConfigDiscovery._analyse_flat_modulesÅ  sk   € Ü5×:Ñ:¸4¿>¹>ÓJˆ�	‰	ÔÜ�	Š	Ð-¨d¯i©i×.BÑ.BÐ-CÐDÔEØ×,Ñ,¨T¯Y©Y×-AÑ-AÀ9ÔMÜ�D—I‘I×(Ñ(Ó)Ð)r   c                ón   • [        U5      S:”  a&  SSKJn  SSKJn  SU SU SU S3nU" U" U5      5      eg )	Nr   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.
            )ÚlenÚinspectr  Úsetuptools.errorsr  )r"   ÚdetectedÚkindr  r  Úmsgs         r   r  Ú/ConfigDiscovery._ensure_no_accidental_inclusionË  sU   € Üˆx‹=˜1ÓÝ(å?à)¨$¨Ð/MÈhÈZð XMð
 NRÈFð 	SðˆCñ (©°«Ó6Ð6ð) r   c                óD  • U R                   R                  R                  (       d  U R                   R                  (       a  g[        R                  " S5        U R                  5       =(       d    U R                  5       nU(       a  XR                   R                  l        gg)z„The 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â  so   € ð �9‰9×Ñ×"×" d§i¡i§n§nàä�	Š	ÐKÔLð ×4Ñ4Ó6÷ /Ø×,Ñ,Ó.ð 	ö Ø&*�I‰I×ÑÕ#ð r   c                óÌ   • S H^  n[        U R                  US5      =(       d    / nU(       d  M,  [        U5      S:X  d  M=  [        R                  " SUS    35        US   s  $    g)zExactly one module or package)rï   rð   Nr   z&Single module/package detected, name: r   )ÚgetattrrŸ   r  r   rõ   )r"   Úfieldr  s      r   r(  Ú3ConfigDiscovery._find_name_single_package_or_moduleó  sX   € ã/ˆEÜ˜DŸI™I u¨dÓ3×9°rˆEßˆuœ˜U› q�Ü—	’	ÐBÀ5ÈÁ8À*ÐMÔNØ˜Q‘x’ñ	 0ð r   c                ól  • U R                   R                  (       d  g[        [        U R                   R                  [        S95      nU R                   R
                  =(       d    0 n[        XU R                  5      nU(       a  [        R                  " SU 35        U$ [        R                  " S5        g)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ï   r  Úsortedr  rã   Úfind_parent_packagerà   r   rõ   Úwarn)r"   rï   rã   Ú
parent_pkgs       r   r)  Ú(ConfigDiscovery._find_name_from_packagesý  s~   € à�y‰y×!×!Øä¤ t§y¡y×'9Ñ'9¼sÑ CÓDˆØ—i‘i×+Ñ+×1¨rˆä(¨ÀÇÁÓOˆ
ÞÜ�IŠIÐ>¸z¸lÐKÔLØÐä�ŠÐJÔKØr   )rÑ   rÒ   rÓ   rŸ   N)rÔ   r   r6   r7   )r6   r   )r6   údict[str, str])FTF)ré   r8   r²   r8   rê   r8   r6   r7   )rê   r8   r6   r8   )r6   r8   )r"  rU   r#  r5   )r6   r7   )r6   ú
str | None)r9   r:   r;   r<   r=   r$   rØ   rÛ   Úpropertyrà   rä   r/   rò   rç   rö   r÷   rø   r  r  r  rè   r(  r)  r>   r?   r   r   rÏ   rÏ   *  s¢   † ñô'òò
&ð ó/ó ð/ð ó%ó ð%ð RWðØðØ)-ðØJNðà	õô.
ô
ô$ô$ô2Môô*ô7ô.+ô"÷r   rÏ   c                óä   ^• [        U [        S9nUSS n[        U5      n[        [        U5      5       H8  u  nm[	        U4S jU 5       5      (       d  M"  UR                  X4-
  S-
  5        M:     U$ )zÕRemove 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']
r0  Nc              3  óL   >#   • U  H  nTR                  U S 35      v •  M     g7f©rR   N©Ú
startswith)r(   Úotherr²   s     €r   r+   Ú)remove_nested_packages.<locals>.<genexpr>  s#   øé € ÐCº°ˆt�‰ % ¨˜{×+Ð+ºùs   ƒ!$r   )r2  r  Ú	enumerateÚreversedr-   r  )rï   r  r  ÚsizeÚir²   s        @r   r  r    se   ø€ ô �(¤Ñ$€DØ‘Q�€IÜˆt‹9€DÜœX d›^Ö,‰ˆˆ4ÜÔC¹ÓC×CÓCØ�M‰M˜$™( Q™,Ö'ñ -ð Ðr   c                ó„   • U  Vs/ s H.  oR                  S5      S   R                  S5      (       a  M,  UPM0     sn$ s  snf )z”Remove 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']
rR   r   r°   )r´   rµ   )rï   rý   s     r   r  r     s4   € ñ $ÓPš8�C¯9©9°S«>¸!Ñ+<×+EÑ+EÀh×+O�C™8ÑPÐPùÒPs   …+=´=c                ón  ^• [        U [        S9n / n[        U 5       H8  u  nm[        U4S jXS-   S  5       5      (       d    OUR	                  T5        M:     U HW  m[        TX5      n[        R                  R                  US5      n[        R                  R                  U5      (       d  MU  Ts  $    g)z0Find the parent package that is not a namespace.r0  c              3  óJ   >#   • U  H  oR                  T S 35      v •  M     g7fr<  r=  )r(   rÌ   r²   s     €r   r+   Ú&find_parent_package.<locals>.<genexpr>0  s#   øé € ÐGÒ5F°—<‘< 4 &¨ 
×+Ð+Ò5Fùs   ƒ #r   Nrq   )
r2  r  rA  r¶   rf   Úfind_package_pathr   r   ra   rr   )rï   rã   rÿ   Úcommon_ancestorsrD  Úpkg_pathÚinitr²   s          @r   r3  r3  )  s    ø€ ô �h¤CÑ(€HØÐÜ˜XÖ&‰ˆˆ4ÜÔG°XÀ!¹e¸gÑ5FÓG×GÑGñ
 Ø×Ñ Ö%ñ 'ó !ˆÜ$ T¨;ÓAˆÜ�w‰w�|‰|˜H mÓ4ˆÜ�7‰7�>‰>˜$×ÓØŠKñ	 !ð r   c                óz  • U R                  S5      n[        [        U5      SS5       HE  nSR                  USU 5      nXQ;   d  M  X   n[        R
                  R                  " X&/X4S Q76 s  $    UR                  S5      =(       d    Sn[        R
                  R                  " U/UR                  S5      QUQ76 $ )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'
rR   r   éÿÿÿÿNrû   Ú/)r´   Úranger  ra   r   r   r
  )r²   rã   rÿ   ÚpartsrD  Úpartial_nameÚparents          r   rI  rI  A  s¡   € ð, �J‰J�s‹O€EÜ”3�u“:˜q "Ö%ˆà—x‘x  b q 	Ó*ˆØÕ&Ø Ñ.ˆFÜ—7‘7—<’< Ð=°5¸°9Ò=Ò=ñ &ð �_‰_˜RÓ ×& B€FÜ�7‰7�<Š<˜Ð= 6§<¡<°Ó#4Ð=°uÒ=Ð=r   c           
     ó¶   • [        U 5      n[        U5      R                  nU Vs0 s H'  oDSR                  / UQUR	                  S5      Q5      _M)     sn$ s  snf )NrO  rR   )r  r
   rQ  ra   r´   )rï   Úpackage_pathÚparent_pkgsÚprefixrý   s        r   Úconstruct_package_dirrX  c  sS   € Ü(¨Ó2€KÜ�,Ó×%Ñ%€FÙALÓMÂ¸#�—‘Ð4˜FÐ4 S§Y¡Y¨s£^Ð4Ó5Ò5ÁÑMÐMùÒMs   ¥.A)r   r   r6   r8   )rÉ   r5   rÊ   r   r6   rU   )rï   rU   r6   rU   )rï   rU   rã   úMapping[str, str]rÿ   r   r6   r8  )r²   r5   rã   rY  rÿ   r   r6   r5   )rï   rU   rU  r   r6   r7  )-r=   Ú
__future__r   Ú	itertoolsr   Úcollections.abcr   r   r   Úfnmatchr   r	   Úpathlibr
   Útypingr   r   Ú_distutils_hack.overrideÚ_distutils_hackrz   r   Ú	distutilsr   Údistutils.utilr   Ú
setuptoolsr   ÚchainÚfrom_iterabler½   r   r   rA   rZ   rw   r}   r‡   r¿   rÍ   rÏ   r  r  r3  rI  rX  r?   r   r   Ú<module>rg     s  ðñ%õN #ã Û 	ß 7Ñ 7Ý Ý Ý ß *ã å å Ý 'æÝ'à�_‰_×*Ñ*€
ô1÷
&ñ &÷ -"ñ -"ô`,A�Gô ,Aô^˜-ô ô3�7ô 3ô22TÐ1ô 2Tôj*˜\ô *ô<B÷
añ aôHô$QðØðØ&7ðØCJðàôð0>Ø
ð>Ø-ð>Ø9@ð>àô>õDNr   