Ë
    ¨Õ°j½ˆ  ã                  óV  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZ ddlmZ ddlmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z( ddl%m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3 ddl4m4Z5 ddl6m6Z7 ddl8m8Z9 ddl:m:Z; ddl<m<Z= ddl>m>Z? erddl@mAZA ddlBmCZC  e de)¬«      ZD ejŠ                  eF«      ZG G d„ d e«      ZHd!ZId"ZJ G d#„ d$e#«      ZK G d%„ d&e«      ZL G d'„ d(«      ZM G d)„ d*eM«      ZN G d+„ d,«      ZOd@d-„ZPdAd.„ZQ	 	 	 	 	 	 	 	 dBd/„ZRd0„ ZSdCd1„ZTdCd2„ZU	 	 	 	 	 	 	 	 dDd3„ZVdEd4„ZWdFd5„ZX	 	 	 	 	 	 dGd6„ZYdHd7„ZZdId8„Z[dJd9„Z\ G d:„ d;e(jº                  «      Z^d<Z_	 	 	 	 	 	 	 	 dKd=„Z` G d>„ d?e'jÂ                  «      Zby)Laè  
Create a wheel that, when installed, will make the source package 'editable'
(add it to the interpreter's path, including metadata) per PEP 660. Replaces
'setup.py develop'.

.. note::
   One of the mechanisms briefly mentioned in PEP 660 to implement editable installs is
   to create a separated directory inside ``build`` and use a .pth file to point to that
   directory. In the context of this file such directory is referred as
   *auxiliary build directory* or ``auxiliary_dir``.
é    )ÚannotationsN)ÚIterableÚIteratorÚMapping)Úsuppress)ÚEnum)Úcleandoc)ÚchainÚstarmap)ÚPath)ÚTemporaryDirectory)ÚTracebackType)ÚTYPE_CHECKINGÚClassVarÚProtocolÚTypeVarÚcasté   )ÚCommandÚ_normalizationÚ_pathÚ_shutilÚerrorsÚ
namespaces)ÚStrPath)Úpy310Úpy312)Úfind_package_path)ÚDistribution)ÚInformationOnlyÚSetuptoolsDeprecationWarningé   )Úbuild)Úbuild_py)Ú	dist_info)Úegg_info)Úinstall)Úinstall_scripts)ÚSelf©Ú	WheelFileÚ_P)Úboundc                  ó.   — e Zd ZdZdZdZdZedd„«       Zy)Ú_EditableModea  
    Possible editable installation modes:
    `lenient` (new files automatically added to the package - DEFAULT);
    `strict` (requires a new installation when files are added/removed); or
    `compat` (attempts to emulate `python setup.py develop` - DEPRECATED).
    ÚstrictÚlenientÚcompatc                óè   — |st         j                  S |j                  «       }|t         j                  vrt	        j
                  d|›d�«      ‚|dk(  rt        j                  ddd¬«       t         |   S )NzInvalid editable mode: z. Try: 'strict'.ÚCOMPATzCompat editable installsa
  
                The 'compat' editable mode is transitional and will be removed
                in future versions of `setuptools`.
                Please adapt your code accordingly to use either the 'strict' or the
                'lenient' modes.
                zuserguide/development_mode.html)Úsee_docs)r/   ÚLENIENTÚupperÚ__members__r   ÚOptionErrorr!   Úemit)ÚclsÚmodeÚ_modes      úW/var/www/mission/venv/lib/python3.12/site-packages/setuptools/command/editable_wheel.pyÚconvertz_EditableMode.convertA   sv   € áÜ ×(Ñ(Ð(à—
‘
“ˆØœ×1Ñ1Ñ1Ü×$Ñ$Ð'>¸t¸hÐFVÐ%WÓXÐXà�HÒÜ(×-Ñ-Ø*ðð ;õô  ˜UÑ#Ð#ó    N)r<   ú
str | NoneÚreturnr/   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚSTRICTr6   r4   Úclassmethodr?   © r@   r>   r/   r/   5   s*   „ ñð €FØ€GØ€Fàò$ó ñ$r@   r/   zU
New or renamed files may not be automatically picked up without a new installation.
zt
Options like `package-data`, `include/exclude-package-data` or
`packages.find.exclude/include` may have no effect.
c                  óú   — e Zd ZU dZdZdddd eej                  xs d«      fgZded	<   d
„ Z	dd„Z
dd„Zd„ Zd„ Zdd„Z	 	 	 	 	 	 	 	 dd„Zd„ Zdd„Z	 	 	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zd„ Zdd„Z	 	 	 	 	 	 	 	 d d„Zy)!Úeditable_wheelz®Build 'editable' wheel for development.
    This command is private and reserved for internal use of setuptools,
    users should rely on ``setuptools.build_meta`` APIs.
    zBDO NOT CALL DIRECTLY, INTERNAL ONLY: create PEP 660 editable wheel)z	dist-dir=Údz-directory to put final built distributions in)zdist-info-dir=ÚIz(path to a pre-build .dist-info directoryzmode=NÚ zHClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]Úuser_optionsc                ó<   — d | _         d | _        d | _        d | _        y ©N)Údist_dirÚdist_info_dirÚproject_dirr<   ©Úselfs    r>   Úinitialize_optionsz!editable_wheel.initialize_optionsx   s    € ØˆŒØ!ˆÔØˆÔØˆ�	r@   c                ó  — | j                   }|j                  xs t        j                  | _        |j
                  xs i | _        t        | j                  xs* t        j                  j                  | j                  d«      «      | _        y )NÚdist)
ÚdistributionÚsrc_rootÚosÚcurdirrT   Úpackage_dirr   rR   ÚpathÚjoin)rV   rY   s     r>   Úfinalize_optionszeditable_wheel.finalize_options~   s_   € Ø× Ñ ˆØŸ=™=Ò5¬B¯I©IˆÔØ×+Ñ+Ò1¨rˆÔÜ˜TŸ]™]ÒT¬b¯g©g¯l©l¸4×;KÑ;KÈVÓ.TÓUˆ�r@   c                ó¶  — 	 | j                   j                  d¬«       | j                  «        | j                  d«       | j	                  d«      }|j                  | j                  «       | j                  |«       y # t        $ rR}| j                  j                  xs | j                  j                  «       }t        j                  |d|› d�«       ‚ d }~ww xY w)NT)Úexist_okÚbdist_wheelz3An error occurred when building editable wheel for zl.
See debugging tips in: https://setuptools.pypa.io/en/latest/userguide/development_mode.html#debugging-tips)rR   ÚmkdirÚ_ensure_dist_infoÚreinitialize_commandÚget_finalized_commandÚwrite_wheelfilerS   Ú_create_wheel_fileÚ	ExceptionrZ   ÚnameÚget_namer   Úadd_note)rV   rd   ÚexÚprojects       r>   Úrunzeditable_wheel.run„   sÇ   € ð	Ø�M‰M×Ñ¨ÐÔ.Ø×"Ñ"Ô$ð ×%Ñ% mÔ4Ø×4Ñ4°]ÓCˆKØ×'Ñ'¨×(:Ñ(:Ô;à×#Ñ# KÕ0øÜò 	Ø×'Ñ'×,Ñ,ÒL°×0AÑ0A×0JÑ0JÓ0LˆGÜ�N‰NØØEÀgÀYð Ofð fôð ûð	ús   ‚A:A= Á=	CÂACÃCc                óx  — | j                   €bt        t        | j                  d«      «      }| j                  |_        |j                  «        |j                  «        |j                   | _         y t        | j                   «      j                  d«      sJ ‚t        | j                   d«      j                  «       sJ ‚y )Nr%   z
.dist-infoÚMETADATA)rS   r   Údist_info_clsrg   rR   Ú
output_dirÚensure_finalizedrq   ÚstrÚendswithr   Úexists)rV   r%   s     r>   rf   z editable_wheel._ensure_dist_info™   s’   € Ø×ÑÐ%Üœ]¨D×,EÑ,EÀkÓ,RÓSˆIØ#'§=¡=ˆIÔ Ø×&Ñ&Ô(Ø�M‰MŒOØ!*×!8Ñ!8ˆDÕä�t×)Ñ)Ó*×3Ñ3°LÔAÐAÐAÜ˜×*Ñ*¨JÓ7×>Ñ>Ô@Ð@Ñ@r@   c                óî   — | j                   }|j                  sy t        | j                  | j                  j                  dd«      «      j                  «       }t        ||||«      }|j                  «        y )NrN   ú.)	rZ   Únamespace_packagesr   rT   r^   ÚgetÚresolveÚ_NamespaceInstallerÚinstall_namespaces)rV   Úinstallation_dirÚ
pth_prefixrY   r[   Ú	installers         r>   Ú_install_namespacesz"editable_wheel._install_namespaces¤   sd   € à× Ñ ˆØ×&Ò&Øä˜×(Ñ(¨$×*:Ñ*:×*>Ñ*>¸rÀ3Ó*GÓH×PÑPÓRˆÜ'¨Ð.>À
ÈHÓUˆ	Ø×$Ñ$Õ&r@   c                óÂ   — | j                   rt        | j                   «      j                  n	t        «       }t        t        |j                  d«      «      }t        |d «      S )Nz
*.egg-info)rS   r   ÚparentÚmaprw   ÚglobÚnext)rV   Ú
parent_dirÚ
candidatess      r>   Ú_find_egg_info_dirz!editable_wheel._find_egg_info_dir®   sH   € Ø8<×8JÒ8J”T˜$×,Ñ,Ó-×4Ò4ÔPTÓPVˆ
Üœ˜jŸo™o¨lÓ;Ó<ˆ
Ü�J Ó%Ð%r@   c                óÐ  — | j                   }t        |«      }t        |«      }t        t        ||› d�d«      «      }t        t        ||› d�d«      «      }t        t        ||› d�d«      «      }	t        t        |j                  dd¬«      «      }
t        |«      |
_        d|
_        t        t        |j                  dd¬«      «      }t        t        |j                  d	d¬«      «      }|x|_
        x|_        |_        |x|_        x|_        |_        |	x|_        |_        ||_        ||_        |j)                  d
«      }d|_        t        t,        |j)                  d«      «      }d|_        t        |«      |_        t        t2        |j)                  d«      «      }d|_        | j7                  «       |_        | j;                  «        |j=                  «        |j=                  «        y)aì  Configure commands to behave in the following ways:

        - Build commands can write to ``build_lib`` if they really want to...
          (but this folder is expected to be ignored and modules are expected to live
          in the project directory...)
        - Binary extensions should be built in-place (editable_mode = True)
        - Data/header/script files are not part of the "editable" specification
          so they are written directly to the unpacked_wheel directory.
        z.dataÚdataÚheadersÚscriptsr&   T)Úreinit_subcommandsr#   r'   Úbuild_scriptsÚpythonr(   r$   FN)rZ   rw   r   r   Úegg_info_clsrg   Úegg_baseÚignore_egg_info_in_manifestÚ	build_clsÚinstall_clsÚbuild_platlibÚbuild_purelibÚ	build_libÚinstall_purelibÚinstall_platlibÚinstall_libr(   r’   Úinstall_headersÚinstall_dataÚget_command_objÚ
executableÚinstall_scripts_clsÚno_epÚ
build_tempÚbuild_py_clsÚcompilerŒ   Úexisting_egg_info_dirÚ_set_editable_moderv   )rV   rl   Úunpacked_wheelr›   Útmp_dirrY   ÚwheelrŽ   r�   r�   r&   r#   r'   r’   r(   r$   s                   r>   Ú_configure_buildzeditable_wheel._configure_build³   sØ  € ð × Ñ ˆÜ�NÓ#ˆÜ˜	“Nˆ	Ü”4˜¨4¨&°¨¸Ó?Ó@ˆÜ”d˜>¨d¨V°5¨>¸9ÓEÓFˆÜ”d˜>¨d¨V°5¨>¸9ÓEÓFˆô Ü˜$×3Ñ3°JÐSWÐ3ÓXó
ˆô   ›LˆÔØ/3ˆÔ,äÜ�t×0Ñ0°ÈTÐ0ÓRó
ˆô Ü˜×2Ñ2°9ÐQUÐ2ÓVó
ˆð GPÐOˆÔÐO˜eÔ1°E´OØRWÐWˆÔÐW 'Ô"9¸GÔ<OØ8?Ð?ˆÔ %Ô"5Ø")ˆÔØ#ˆÔð ×,Ñ,¨_Ó=ˆØ#+ˆÔ äÜ ×!5Ñ!5Ð6GÓ!Hó
ˆð !%ˆÔä˜w›<ˆÔäœ d×&:Ñ&:¸:Ó&FÓGˆØ ˆÔØ)-×)@Ñ)@Ó)BˆÔ&à×ÑÔ!à×ÑÔ Ø× Ñ Õ"r@   c                óÚ   — | j                   }|j                  d«      }|j                  «       D ];  }|j                  |«      }t        |d«      rd|_        Œ(t        |d«      sŒ5d|_        Œ= y)z8Set the ``editable_mode`` flag in the build sub-commandsr#   Úeditable_modeTÚinplaceN)rZ   r¡   Úget_sub_commandsÚhasattrr¯   r°   )rV   rY   r#   Úcmd_nameÚcmds        r>   r©   z!editable_wheel._set_editable_modeò   sh   € à× Ñ ˆØ×$Ñ$ WÓ-ˆØ×.Ñ.Ó0ò 	#ˆHØ×&Ñ& xÓ0ˆCÜ�s˜OÔ,Ø$(�Õ!Ü˜˜iÕ(Ø"�•ñ	#r@   c                ó>  — g }i }| j                  d«      }|j                  «       D ]r  }| j                  |«      }t        |d«      r#|j                  |j	                  «       xs g «       t        |d«      sŒP|j                  |j                  «       xs i «       Œt ||fS )Nr#   Úget_outputsÚget_output_mapping)rh   r±   r²   Úextendr¶   Úupdater·   )rV   ÚfilesÚmappingr#   r³   r´   s         r>   Ú_collect_build_outputsz%editable_wheel._collect_build_outputsý   s—   € ØˆØ"$ˆØ×*Ñ*¨7Ó3ˆà×.Ñ.Ó0ò 	?ˆHØ×,Ñ,¨XÓ6ˆCÜ�s˜MÔ*Ø—‘˜SŸ_™_Ó.Ò4°"Ô5Ü�sÐ0Õ1Ø—‘˜s×5Ñ5Ó7Ò=¸2Õ>ð	?ð �gˆ~Ðr@   c                óÞ   — | j                  ||||«       | j                  «        | j                  «       \  }}| j                  d«       | j                  d«       | j                  d«       ||fS )Nr�   r�   rŽ   )r­   Ú_run_build_subcommandsr¼   Ú_run_install)rV   Ú	dist_namerª   r›   r«   rº   r»   s          r>   Ú_run_build_commandsz"editable_wheel._run_build_commands  sj   € ð 	×Ñ˜i¨¸ÀGÔLØ×#Ñ#Ô%Ø×4Ñ4Ó6‰ˆˆwØ×Ñ˜)Ô$Ø×Ñ˜)Ô$Ø×Ñ˜&Ô!Ø�gˆ~Ðr@   c                óä   — | j                  d«      }|j                  «       D ]L  }| j                  |«      }|dk(  r#t        |«      t        ur| j	                  |«       Œ<| j                  |«       ŒN y)a}  
        Issue #3501 indicates that some plugins/customizations might rely on:

        1. ``build_py`` not running
        2. ``build_py`` always copying files to ``build_lib``

        However both these assumptions may be false in editable_wheel.
        This method implements a temporary workaround to support the ecosystem
        while the implementations catch up.
        r#   r$   N)rh   r±   Útyper¦   Ú_safely_runÚrun_command)rV   r#   rl   r´   s       r>   r¾   z%editable_wheel._run_build_subcommands  sk   € ð ×*Ñ*¨7Ó3ˆØ×*Ñ*Ó,ò 	'ˆDØ×,Ñ,¨TÓ2ˆCØ�zÒ!¤d¨3£i´|Ñ&CØ× Ñ  Õ&à× Ñ  Õ&ñ	'r@   c                ó¨   — 	 | j                  |«      S # t        $ r5 t        j                  ddt	        j
                  «       › d|› d|› d�«       Y y w xY w)Nz0Customization incompatible with editable installz
                zŒ

                If you are seeing this warning it is very likely that a setuptools
                plugin or customization overrides the `a  ` command, without
                taking into consideration how editable installs run build steps
                starting from setuptools v64.0.0.

                Plugin authors and developers relying on custom build steps are
                encouraged to update their `aa  ` implementation considering the
                information about editable installs in
                https://setuptools.pypa.io/en/latest/userguide/extension.html.

                For the time being `setuptools` will silence this error and ignore
                the faulty command, but this behavior will change in future versions.
                )rÅ   rk   r!   r:   Ú	tracebackÚ
format_exc)rV   r³   s     r>   rÄ   zeditable_wheel._safely_run0  sp   € ð	Ø×#Ñ# HÓ-Ð-øÜò 	Ü(×-Ñ-ØBðÜ×%Ñ%Ó'Ð(ð )8ð 9A°zð B-ð
 .6¨Jð 7ðöð	ús   ‚ “;AÁAc           
     óŽ  — ddl m} | j                  d«      }|j                  }dj	                  |j                  «       «      }d}|› d|› d|› d�}t        | j                  |«      }|j                  «       r|j                  «        t        |¬«      }	t        d¬«      }
t        d	¬«      }|	5 }|
5 }|5 }t        |t        | j                  «      j                  «      }t        j                  | j                  |«       | j                  ||«       | j                  ||||«      \  }}| j!                  |||«      }|5   ||d
«      5 } ||||«       |j#                  |«       d d d «       d d d «       d d d «       d d d «       d d d «       |S # 1 sw Y   Œ+xY w# 1 sw Y   Œ/xY w# 1 sw Y   Œ3xY w# 1 sw Y   Œ7xY w# 1 sw Y   |S xY w)Nr   r*   r%   ú-z
0.editablez.whl)Úsuffixz
.build-libz.build-tempÚw)Úwheel.wheelfiler+   rh   rl   r`   Úget_tagr   rR   ry   Úunlinkr   rS   ÚshutilÚcopytreer„   rÁ   Ú_select_strategyÚwrite_files)rV   rd   r+   r%   rÀ   ÚtagÚ	build_tagÚarchive_nameÚ
wheel_pathrª   r›   Ú	build_tmpÚunpackedÚlibÚtmpÚunpacked_dist_inforº   r»   ÚstrategyÚ	wheel_objs                       r>   rj   z!editable_wheel._create_wheel_fileL  s³  € Ý-à×.Ñ.¨{Ó;ˆ	Ø—N‘Nˆ	Ø�h‰h�{×*Ñ*Ó,Ó-ˆØ ˆ	Ø#˜ A i [°°#°°dÐ;ˆÜ˜$Ÿ-™-¨Ó6ˆ
Ø×ÑÔØ×ÑÔä+°<Ô@ˆÜ&¨lÔ;ˆ	Ü&¨mÔ<ˆ	àð 	0˜x¨ð 	0°c¸9ð 	0ÈÜ!% h´°T×5GÑ5GÓ0H×0MÑ0MÓ!NÐÜ�O‰O˜D×.Ñ.Ð0BÔCØ×$Ñ$ X¨yÔ9Ø!×5Ñ5°iÀÈ3ÐPSÓT‰NˆE�7Ø×,Ñ,¨Y¸¸SÓAˆHØñ 0™9 Z°Ó5ð 0¸Ù˜ E¨7Ô3Ø×%Ñ% hÔ/÷0÷ 0÷	0÷ 	0÷ 	0ð Ð÷	0ð 0ú÷ 0ð 0ú÷	0ð 	0ú÷ 	0ð 	0ú÷ 	0ð Ðúsm   Â,F:Â/F.Â2BF"Ä:
F	ÅF
Å F	Å(F"Å0F.Å8F:Æ
FÆF	ÆFÆF"Æ"F+Æ'F.Æ.F7	Æ3F:Æ:Gc                ó¨   — t        | j                  d|› �d «      }|r6 |«       r.t        j                  d|› d�«       | j	                  d|› �«       y y y )NÚhas_zInstalling z as non editableÚinstall_)ÚgetattrrZ   Ú_loggerÚinforÅ   )rV   ÚcategoryÚhas_categorys      r>   r¿   zeditable_wheel._run_installh  sV   € Ü˜t×0Ñ0°D¸¸
Ð2CÀTÓJˆÙ™LœNÜ�L‰L˜; x jÐ0@ÐAÔBØ×Ñ˜x¨ zÐ2Õ3ð +ˆ<r@   c                ól  — d|› d|› �}t        | j                  «      }t        j                  | j                  «      }|t        j
                  u r8t        t        | j                  d|«      «      }t        | j                  |||«      S t        | j                  «      }t        || j                  |«      }	|t        j                  u }
t        | j                  «      dhk(  r|	s|
r>| j                  j                  dd«      }t        | j                  |t        ||«      g«      S t!        | j                  |«      S )zDDecides which strategy to use to implement an editable installation.ú__editable__.rÊ   r#   rN   r{   )r   rT   r/   r?   r<   rG   Ú
_empty_dirÚ	_LinkTreerZ   Ú_find_packagesÚ_simple_layoutr^   r4   Úsetr}   Ú
_StaticPthÚ_TopLevelFinder)rV   rl   rÔ   r›   Ú
build_namerT   r<   Úauxiliary_dirÚpackagesÚhas_simple_layoutÚis_compat_modeÚsrc_dirs               r>   rÒ   zeditable_wheel._select_strategyn  s  € ð % T F¨!¨C¨5Ð1ˆ
Ü˜4×+Ñ+Ó,ˆÜ×$Ñ$ T§Y¡YÓ/ˆà”=×'Ñ'Ñ'Ü&¤t¨D×,<Ñ,<¸gÀzÓ'RÓSˆMÜ˜T×.Ñ.°°mÀYÓOÐOä! $×"3Ñ"3Ó4ˆÜ*¨8°T×5EÑ5EÀ{ÓSÐØ¤×!5Ñ!5Ð5ˆÜˆt×ÑÓ  R DÒ(Ñ->Á.à×&Ñ&×*Ñ*¨2¨sÓ3ˆGÜ˜d×/Ñ/°¼¸[È'Ó8RÐ7SÓTÐTô ˜t×0Ñ0°$Ó7Ð7r@   ©rB   ÚNone)rB   rA   )rl   rw   rª   r   r›   r   r«   r   )rB   ú tuple[list[str], dict[str, str]])
rÀ   rw   rª   r   r›   r   r«   r   rB   rø   )r³   rw   )rå   rw   )rl   rw   rÔ   rw   r›   r   rB   ÚEditableStrategy)rC   rD   rE   rF   Údescriptionr	   r/   rO   Ú__annotations__rW   ra   rq   rf   r„   rŒ   r­   r©   r¼   rÁ   r¾   rÄ   rj   r¿   rÒ   rI   r@   r>   rK   rK   h   s
  … ñð
 W€Kð
 	LØKØ	�$™ ×!6Ñ!6Ò!<¸"Ó=Ð>ð	ð ð ó òóVóò*	Aò'ó&ð
=#Øð=#Ø)0ð=#Ø=Dð=#ØOVó=#ò~	#óðàðð  ðð ð	ð
 ðð 
*óó'ó,ò8ó84ð8àð8ð ð8ð ð	8ð
 
ô8r@   rK   c                  óD   — e Zd Z	 	 	 	 	 	 	 	 dd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zy)rù   c                 ó   — y rQ   rI   )rV   r¬   rº   r»   s       r>   Ú__call__zEditableStrategy.__call__Š  s   € àr@   c                 ó   — y rQ   rI   rU   s    r>   Ú	__enter__zEditableStrategy.__enter__�  s   � r@   c                 ó   — y rQ   rI   ©rV   Ú	_exc_typeÚ
_exc_valueÚ
_tracebacks       r>   Ú__exit__zEditableStrategy.__exit__Ž  s   € ð
 r@   N)r¬   r+   rº   ú	list[str]r»   úMapping[str, str]rB   Úobject©rB   r)   )r  ztype[BaseException] | Noner  zBaseException | Noner  zTracebackType | NonerB   r	  )rC   rD   rE   rþ   r   r  rI   r@   r>   rù   rù   ‰  sW   „ ðØðØ'0ðØ;Lðà	óó %ðà-ðð )ðð )ð	ð
 
ôr@   rù   c                  óL   — e Zd Zdd„Z	 	 	 	 	 	 	 	 dd„Zdd„Z	 	 	 	 	 	 	 	 d	d„Zy)
rî   c                ó.   — || _         || _        || _        y rQ   )rY   rl   Úpath_entries)rV   rY   rl   r  s       r>   Ú__init__z_StaticPth.__init__—  s   € ØˆŒ	ØˆŒ	Ø(ˆÕr@   c                ó¤   — dj                  d„ | j                  D «       «      }t        |› d�«      }|j                  d| j                  › d�|«       y )Nú
c              3  óN   K  — | ]  }t        |j                  «       «      –— Œ y ­wrQ   )rw   r~   )Ú.0Úps     r>   ú	<genexpr>z&_StaticPth.__call__.<locals>.<genexpr>Ÿ  s   è ø€ ÒH°œC §	¡	£×,ÑHùs   ‚#%rè   ú.pth)r`   r  Ú_encode_pthÚwritestrrl   )rV   r¬   rº   r»   ÚentriesÚcontentss         r>   rþ   z_StaticPth.__call__œ  sI   € ð —)‘)ÑH°d×6GÑ6GÔHÓHˆÜ ' ¨"˜~Ó.ˆØ�‰˜ t§y¡y k°Ð6¸ÕAr@   c                ó    — dt        t        t        j                  | j                  «      «      ›d�}t
        j                  |t        z   «       | S )Nz_
        Editable install will be performed using .pth file to extend `sys.path` with:
        z	
        )Úlistr‡   r\   Úfspathr  rã   ÚwarningÚ_LENIENT_WARNING©rV   Úmsgs     r>   r   z_StaticPth.__enter__£  sH   € ð	ä	Œc”"—)‘)˜T×.Ñ.Ó/Ó	0Ð3ð 4	ðˆô 	�‰˜Ô.Ñ.Ô/Øˆr@   c                 ó   — y rQ   rI   r  s       r>   r  z_StaticPth.__exit__«  s   € ð 	r@   N)rY   r   rl   rw   r  z
list[Path]rB   r÷   ©r¬   r+   rº   r  r»   r  rB   r÷   r
  ©r  r	  r  r	  r  r	  rB   r÷   )rC   rD   rE   r  rþ   r   r  rI   r@   r>   rî   rî   –  sa   „ ó)ð
BØðBØ'0ðBØ;LðBà	óBóðàðð ðð ð	ð
 
ôr@   rî   c                  óŽ   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 d	ˆ fd„Z	 	 	 	 	 	 	 	 d
ˆ fd„Zdd„Zddd„Zdd„Zdd„Z		 	 	 	 	 	 	 	 dd„Z
ˆ xZS )rê   a`  
    Creates a ``.pth`` file that points to a link tree in the ``auxiliary_dir``.

    This strategy will only link files (not dirs), so it can be implemented in
    any OS, even if that means using hardlinks instead of symlinks.

    By collocating ``auxiliary_dir`` and the original source code, limitations
    with hardlinks should be avoided.
    c                óÚ   •— t        |«      | _        t        |«      j                  «       | _        |j	                  d«      j
                  | _        t        ‰| �!  ||| j                  g«       y )Nr$   )	r   rñ   r~   r›   r¡   Ú	copy_fileÚ_fileÚsuperr  )rV   rY   rl   rñ   r›   Ú	__class__s        €r>   r  z_LinkTree.__init__¿  sX   ø€ ô " -Ó0ˆÔÜ˜i›×0Ñ0Ó2ˆŒØ×)Ñ)¨*Ó5×?Ñ?ˆŒ
Ü‰Ñ˜˜t d×&8Ñ&8Ð%9Õ:r@   c                óL   •— | j                  ||«       t        ‰| �	  |||«       y rQ   )Ú_create_linksr(  rþ   )rV   r¬   rº   r»   r)  s       €r>   rþ   z_LinkTree.__call__Ë  s&   ø€ ð 	×Ñ˜5 'Ô*Ü‰Ñ˜  wÕ/r@   c                ó  — t        t        «      5  t        |«      j                  «       j	                  | j
                  «      }t        |«      j                  t        j                  d«      cd d d «       S # 1 sw Y   y xY w)Nú/)
r   Ú
ValueErrorr   r~   Úrelative_tor›   rw   Úreplacer\   Úsep)rV   Úfiler_   s      r>   Ú_normalize_outputz_LinkTree._normalize_outputÑ  s]   € ä”jÓ!ñ 	2Ü˜“:×%Ñ%Ó'×3Ñ3°D·N±NÓCˆDÜ�t“9×$Ñ$¤R§V¡V¨SÓ1÷	2÷ 	2ñ 	2ð ús   �AA5Á5A>c                ó¶   — | j                   |z  }|j                  j                  «       s|j                  j                  d¬«       | j	                  |||¬«       y )NT)Úparents©Úlink)rñ   r†   Úis_dirre   r'  )rV   Úrelative_outputÚsrc_filer7  Údests        r>   Ú_create_filez_LinkTree._create_fileØ  sI   € Ø×!Ñ! OÑ3ˆØ�{‰{×!Ñ!Ô#Ø�K‰K×Ñ dÐÔ+Ø�
‰
�8˜T¨ˆ
Õ-r@   c                óœ  ‡ — ‰ j                   j                  dd¬«       t        ‰ j                   «      rdnd}ˆ fd„|j                  «       D «       }|D ��ci c]  \  }}|€Œ	||“Œ }}}|D ]-  }‰ j	                  |«      }	|	sŒ|	|vsŒ‰ j                  |	|«       Œ/ |j                  «       D ]  \  }	}
‰ j                  |	|
|¬«       Œ y c c}}w )NT)r5  rc   ÚsymÚhardc              3  óJ   •K  — | ]  \  }}‰j                  |«      |f–— Œ y ­wrQ   )r3  )r  ÚkÚvrV   s      €r>   r  z*_LinkTree._create_links.<locals>.<genexpr>á  s%   øè ø€ ÒX¹¸¸A�t×-Ñ-¨aÓ0°!Ô4ÑXùs   ƒ #r6  )rñ   re   Ú_can_symlink_filesÚitemsr3  r<  )rV   ÚoutputsÚoutput_mappingÚ	link_typeÚ
normalisedrA  rB  ÚmappingsÚoutputÚrelativeÚsrcs   `          r>   r+  z_LinkTree._create_linksÞ  sÒ   ø€ Ø×Ñ× Ñ ¨¸Ð Ô=Ü/°×0BÑ0BÔC‘EÈˆ	ÛXÀ×AUÑAUÓAWÔXˆ
à%/×A™T˜Q °1±=�A�q‘DÐAˆÑAàò 	4ˆFØ×-Ñ-¨fÓ5ˆHÚ˜H¨HÒ4Ø×!Ñ! (¨FÕ3ð	4ð
 &Ÿ^™^Ó-ò 	=‰MˆH�cØ×Ñ˜h¨°)ÐÕ<ñ	=ùó Bs   Á
CÁ!Cc                óB   — d}t         j                  |t        z   «       | S )Nz=Strict editable install will be performed using a link tree.
)rã   r  Ú_STRICT_WARNINGr  s     r>   r   z_LinkTree.__enter__í  s   € ØNˆÜ�‰˜œoÑ-Ô.Øˆr@   c                óP   — d| j                   › d�}t        j                  d|«       y )Nz\

        Strict editable installation performed using the auxiliary directory:
            z†

        Please be careful to not remove this directory, otherwise you might not be able
        to import/use your package.
        úEditable installation.)rñ   r    r:   ©rV   r  r  r  r   s        r>   r  z_LinkTree.__exit__ò  s2   € ðà×ÑÐ ð !	ðˆô 	×ÑÐ5°sÕ;r@   )
rY   r   rl   rw   rñ   r   r›   r   rB   r÷   r"  )r2  rw   rB   rA   rQ   )r9  rw   r:  rw   )rF  r  r
  r#  )rC   rD   rE   rF   r  rþ   r3  r<  r+  r   r  Ú__classcell__)r)  s   @r>   rê   rê   ´  s¡   ø„ ñð
;àð
;ð ð
;ð ð	
;ð
 ð
;ð 
õ
;ð0Øð0Ø'0ð0Ø;Lð0à	õ0óô.ó=óð
<àð<ð ð<ð ð	<ð
 
÷<r@   rê   c                  ó\   — e Zd Zdd„Zd	d„Zd
d„Z	 	 	 	 	 	 	 	 dd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zy)rï   c                ó    — || _         || _        y rQ   )rY   rl   )rV   rY   rl   s      r>   r  z_TopLevelFinder.__init__  s   € ØˆŒ	Øˆ�	r@   c           
     ó”  — | j                   j                  xs t        j                  }t	        t        | j                   «      t        | j                   «      «      }| j                   j                  xs i }t        |||«      }t        t	        t        | j                   j                  xs g |«      d„ t        |«      D «       «      «      }| j                   j                  xs g D �ci c](  }|t        ||| j                   j                  xs d«      “Œ* }}i |¥|¥}d| j                  › d�}	t!        j"                  |	«      }
|
|	||fS c c}w )Nc              3  ó$   K  — | ]  }|g f–— Œ
 y ­wrQ   rI   )r  Únss     r>   r  z0_TopLevelFinder.template_vars.<locals>.<genexpr>  s   è ø€ ÒD˜b�"�b”ÑDùs   ‚rN   rè   z.finder)rY   r[   r\   r]   r
   rë   Ú_find_top_level_modulesr^   Ú_find_package_rootsÚdictÚ_find_namespacesrò   Ú_find_virtual_namespacesr|   r   rl   r   Úsafe_identifier)rV   r[   Ú	top_levelr^   ÚrootsÚnamespaces_ÚpkgÚlegacy_namespacesr»   rl   Úfinders              r>   Útemplate_varsz_TopLevelFinder.template_vars  s+  € Ø—9‘9×%Ñ%Ò2¬¯©ˆÜœ.¨¯©Ó3Ô5LÈTÏYÉYÓ5WÓXˆ	Ø—i‘i×+Ñ+Ò1¨rˆÜ# I¨{¸HÓEˆäÜÜ  §¡×!3Ñ!3Ò!9°r¸5ÓAÙDÔ$<¸UÓ$CÔDóó
ˆð —y‘y×3Ñ3Ò9°rö
àð Ô" 3¨¨t¯y©y×/AÑ/AÒ/GÀRÓHÑHð
Ðð 
ð
 1�UÐ0Ð/Ð0ˆð
 ˜tŸy™y˜k¨Ð1ˆÜ×/Ñ/°Ó5ˆØ�t˜W kÐ1Ð1ùò
s   Ã%-Ec              #  óÂ   K  — | j                  «       \  }}}}t        t        |||«      d«      }|› d�|f–— t        d|› d|› d�«      }d| j                  › d�|f–— y ­w)Núutf-8z.pyzimport z; z
.install()rè   r  )rd  ÚbytesÚ_finder_templater  rl   )rV   rc  rl   r»   r`  Úcontents         r>   Úget_implementationz"_TopLevelFinder.get_implementation"  su   è ø€ Ø-1×-?Ñ-?Ó-AÑ*ˆ��g˜{äÔ(¨¨w¸ÓDÀgÓNˆØ�˜ˆ~˜wÐ'Ò'ä ¨ x¨r°&°¸ÐDÓEˆØ˜tŸy™y˜k¨Ð.°Ð8Ó8ùs   ‚AAc                óX   — | j                  «       D ]  \  }}|j                  ||«       Œ y rQ   )rj  r  )rV   r¬   rº   r»   r2  ri  s         r>   rþ   z_TopLevelFinder.__call__+  s.   € ð "×4Ñ4Ó6ò 	*‰MˆD�'Ø�N‰N˜4 Õ)ñ	*r@   c                óB   — d}t         j                  |t        z   «       | S )Nz=Editable install will be performed using a meta path finder.
)rã   r  r  r  s     r>   r   z_TopLevelFinder.__enter__1  s   € ØNˆÜ�‰˜Ô.Ñ.Ô/Øˆr@   c                ó4   — d}t        j                  d|«       y )Nz¢

        Please be careful with folders in your working directory with the same
        name as your package as they may take precedence during imports.
        rP  )r    r:   rQ  s        r>   r  z_TopLevelFinder.__exit__6  s   € ðˆô 	×ÑÐ5°sÕ;r@   N)rY   r   rl   rw   rB   r÷   )rB   z5tuple[str, str, dict[str, str], dict[str, list[str]]])rB   zIterator[tuple[str, bytes]]r"  r
  r#  )	rC   rD   rE   r  rd  rj  rþ   r   r  rI   r@   r>   rï   rï     sf   „ óó2ó69ð*Øð*Ø'0ð*Ø;Lð*à	ó*óð

<àð
<ð ð
<ð ð	
<ð
 
ô
<r@   rï   c                ó$  — t        j                  «       5 }t        j                  |t        j                  ¬«      }|j                  | «       |j                  «        |j                  d«       |j                  «       cddd«       S # 1 sw Y   yxY w)a”  
    Prior to Python 3.13 (see https://github.com/python/cpython/issues/77102),
    .pth files are always read with 'locale' encoding, the recommendation
    from the cpython core developers is to write them as ``open(path, "w")``
    and ignore warnings (see python/cpython#77102, pypa/setuptools#3937).
    This function tries to simulate this behavior without having to create an
    actual file, in a way that supports a range of active Python versions.
    (There seems to be some variety in the way different version of Python handle
    ``encoding=None``, not all of them use ``locale.getpreferredencoding(False)``
    or ``locale.getencoding()``).
    ©Úencodingr   N)	ÚioÚBytesIOÚTextIOWrapperr   ÚPTH_ENCODINGÚwriteÚflushÚseekÚread)ri  ÚbufferÚwrappers      r>   r  r  C  se   € ô 
�‰‹ð ˜Ü×"Ñ" 6´E×4FÑ4FÔGˆà�‰�gÔØ�‰ŒØ�‰�AŒØ�{‰{‹}÷÷ ò ús   •A'BÂBc                ó.  — t        t        | j                  «       «      ¬«      5 }t        |d«      t        |d«      }}|j	                  dd¬«       t        t        t        t        «      5  t        j                  ||«       |j                  «       r'|j                  d¬«      dk(  r	 d d d «       d d d «       yd d d «       	 t        j                  ||«       	 d d d «       y	# 1 sw Y   Œ*xY w# t        $ r}d}t        |«      |‚d }~ww xY w# 1 sw Y   y xY w)
N)Údirz	file1.txtz	file2.txtÚfile1rf  ro  Tz�File system does not seem to support either symlinks or hard links. Strict editable installs require one of them to be supported.F)r   rw   r~   r   Ú
write_textr   ÚAttributeErrorÚNotImplementedErrorÚOSErrorr\   ÚsymlinkÚ
is_symlinkÚ	read_textr7  rk   ÚLinksNotSupported)Úbase_dirrÛ   Úpath1Úpath2ro   r   s         r>   rC  rC  X  s  € Ü	¤ H×$4Ñ$4Ó$6Ó 7Ô	8ð ¸CÜ˜C Ó-¬t°C¸Ó/EˆuˆØ×Ñ˜¨7ÐÔ3Ü”nÔ&9¼7ÓCñ 	Ü�J‰J�u˜eÔ$Ø×ÑÔ! e§o¡o¸w oÓ&GÈ7Ò&RØ÷	÷ð ÷	ð
	1Ü�G‰G�E˜5Ô!ð ÷!ð ÷	ð 	ûô ò 	1ðPð ô $ CÓ(¨bÐ0ûð	1ú÷ð úsN   ¤ADÁ)=C Â&DÂ7DÃ C,ÃDÃ C)	Ã%DÃ,	DÃ5DÄDÄDÄDc           	     ó"  ‡— | D �ci c]  }|t        |||«      “Œ }}|st        |«      i dhfv S t        j                  j	                  t        t        |j                  «       «      «      Št        ˆfd„|j                  «       D «       «      S c c}w )a[  Return ``True`` if:
    - all packages are contained by the same parent directory, **and**
    - all packages become importable if the parent directory is added to ``sys.path``.

    >>> _simple_layout(['a'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.b'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.b'], {}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "a", "b": "b"}, ".")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a", "b": "_b"}, ".")
    False
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a"}, "/tmp/myproj")
    False
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a.a1.a2": "_a2"}, ".")
    False
    >>> _simple_layout(['a', 'a.b'], {"": "src", "a.b": "_ab"}, "/tmp/myproj")
    False
    >>> # Special cases, no packages yet:
    >>> _simple_layout([], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout([], {"a": "_a", "": "src"}, "/tmp/myproj")
    False
    rN   c           	   3  ó‚   •K  — | ]6  \  }}t        j                  t        ‰g|j                  d «      ¢­Ž |«      –— Œ8 y­w©r{   N)r   Ú	same_pathr   Úsplit)r  ÚkeyÚvaluer†   s      €r>   r  z!_simple_layout.<locals>.<genexpr>�  s:   øè ø€ ò áˆC�ô 	�‰œ˜VÐ5 c§i¡i°£nÒ5°u×=ñùs   ƒ<?)	r   rí   r\   r_   Ú
commonpathr   Ú_parent_pathrD  Úall)rò   r^   rT   ra  Úlayoutr†   s        @r>   rì   rì   l  s‰   ø€ ð> PXÖXÈˆcÔ$ S¨+°{ÓCÑCÐX€FÐXÙÜ�;Ó B¨¨ :Ð-Ð-Ü�W‰W×Ñ¤¬°f·l±l³nÓ EÓF€FÜó à Ÿ,™,›.ôó ð ùò	 Ys   †Bc                óh   — |j                  | «      }|j                  dt        j                  z   «      S )a7  Infer the parent path containing a package, that if added to ``sys.path`` would
    allow importing that package.
    When ``pkg`` is directly mapped into a directory with a different name, return its
    own path.
    >>> _parent_path("a", "src/a")
    'src'
    >>> _parent_path("b", "src/c")
    'src/c'
    r-  )ÚremovesuffixÚrstripr\   r1  )ra  Úpkg_pathr†   s      r>   r‘  r‘  •  s+   € ð ×"Ñ" 3Ó'€FØ�=‰=˜œrŸv™v™Ó&Ð&r@   c              #  óœ  K  — t        | j                  xs g «      E d {  –—†  | j                  xs g }|D �cg c]	  }d|v sŒ|‘Œ }}| j                  r| j                  –— n<| j                  xs g }||D �cg c]  }d|j
                  v sŒ|j
                  ‘Œ c}z  }|D ]  }|j                  d«      \  }}}|–— Œ y 7 Œ c c}w c c}w ­w)Nr{   )Úiterrò   Ú
py_modulesÚext_packageÚext_modulesrl   Ú
rpartition)	rY   rš  ÚmodÚnested_modulesrœ  ÚxÚmoduleÚpackageÚ_s	            r>   rë   rë   £  sÆ   è ø€ Ü�D—M‘MÒ' RÓ(×(Ð(à—‘Ò& B€JØ%/Ö>˜c°3¸#²:’cÐ>€NÐ>Ø×ÒØ×ÑÓà×&Ñ&Ò,¨"ˆØ¨;ÖH a¸#ÀÇÁº-˜1Ÿ6›6ÒHÑHˆà ò ˆØ×)Ñ)¨#Ó.‰ˆ��AØ‹ñð )úò ?ùò
 Iùs8   ‚CŸC  C¸	CÁCÁ2CÁ8CÂCÂ'CÃ
Cc              #  ó²   K  — | j                   xs g }d„ |D «       E d {  –—†  | j                  s"| j                  xs g }d„ |D «       E d {  –—†  y y 7 Œ37 Œ­w)Nc              3  ó*   K  — | ]  }d |vsŒ|–— Œ y­wr‹  rI   )r  rž  s     r>   r  z*_find_top_level_modules.<locals>.<genexpr>µ  s   è ø€ Ò<˜¨S¸ª^”Ñ<ùs   ‚	Œc              3  óR   K  — | ]  }d |j                   vsŒ|j                   –— Œ! y­wr‹  )rl   )r  r   s     r>   r  z*_find_top_level_modules.<locals>.<genexpr>¹  s   è ø€ ÒE˜q°3¸a¿f¹fÒ3D�A—F•FÑEùs   ‚'–')rš  r›  rœ  )rY   rš  rœ  s      r>   rX  rX  ³  sZ   è ø€ Ø—‘Ò& B€JÙ<˜zÔ<×<Ð<à×ÒØ×&Ñ&Ò,¨"ˆÙE KÔE×EÑEð ð =øð 	Fús!   ‚AŸA ,AÁAÁAÁAc                ó|   — t        | «      D �ci c]  }|t        t        |||«      «      “Œ }}t        |«      S c c}w rQ   )ÚsortedÚ_absolute_rootr   Ú_remove_nested)rò   r^   r[   ra  Ú	pkg_rootss        r>   rY  rY  ¼  sL   € ô ˜(Ó#ö!àð 	Œ^Ô-¨c°;ÀÓIÓJÑJð!€Ið !ô
 ˜)Ó$Ð$ùò!s   Ž9c                óÎ   — t        | «      }|j                  }|j                  «       rt        |j	                  «       «      S t        |j	                  «       |j
                  z  «      S )z(Works for packages and top-level modules)r   r†   ry   rw   r~   rl   )r_   Úpath_r†   s      r>   r©  r©  É  sI   € ä�‹J€EØ�\‰\€Fà‡|�|„~Ü�5—=‘=“?Ó#Ð#ä�6—>‘>Ó# e§j¡jÑ0Ó1Ð1r@   c           	   #  ó  K  — | D ]y  }d|vrŒ|j                  d«      }t        t        |«      dz
  dd«      D ]E  }dj                  |d| «      }t	        t        || d«      «      }|j                  «       r|| vsŒB|–— ŒG Œ{ y­w)a8  By carefully designing ``package_dir``, it is possible to implement the logical
    structure of PEP 420 in a package without the corresponding directories.

    Moreover a parent package can be purposefully/accidentally skipped in the discovery
    phase (e.g. ``find_packages(include=["mypkg.*"])``, when ``mypkg.foo`` is included
    by ``mypkg`` itself is not).
    We consider this case to also be a virtual namespace (ignoring the original
    directory) to emulate a non-editable installation.

    This function will try to find these kinds of namespaces.
    r{   r"   r   éÿÿÿÿNrN   )r�  ÚrangeÚlenr`   r   r   ry   )r«  ra  ÚpartsÚiÚpartial_namer_   s         r>   r\  r\  Ô  sŒ   è ø€ ð ò 	#ˆØ�c‰>ØØ—	‘	˜#“ˆÜ”s˜5“z A‘~ q¨"Ó-ò 	#ˆAØŸ8™8 E¨"¨1 IÓ.ˆLÜÔ)¨,¸	À2ÓFÓGˆDØ—;‘;”= L¸	Ò$Aà"Ó"ñ	#ñ		#ùs   ‚A6BÁ9	Bc              #  ó¬   K  — | D ]K  }t        ||d«      }t        |«      j                  «       sŒ*t        |d«      j                  «       rŒE||gf–— ŒM y ­w)NrN   z__init__.py)r   r   ry   )rò   r«  ra  r_   s       r>   r[  r[  ì  sS   è ø€ ð ò  ˆÜ   i°Ó4ˆÜ�‹:×ÑÕ¤t¨D°-Ó'@×'GÑ'GÕ'IØ˜˜�-Óñ ùs   ‚,A¯AÁ

Ac                óú   ‡‡— t        | j                  «       «      }t        t        | j	                  «       «      «      D ]:  \  ŠŠt        ˆˆfd„| j	                  «       D «       «      sŒ*|j                  ‰«       Œ< |S )Nc              3  óN   •K  — | ]  \  }}‰|k7  xr t        ‰‰||«      –— Œ y ­wrQ   )Ú
_is_nested)r  ÚotherÚ
other_pathr_   ra  s      €€r>   r  z!_remove_nested.<locals>.<genexpr>ù  s4   øè ø€ ò 
á!��zð �5‰LÒEœZ¨¨T°5¸*ÓEÓEñ
ùs   ƒ"%)rZ  ÚcopyÚreversedr  rD  ÚanyÚpop)r«  rJ  r_   ra  s     @@r>   rª  rª  õ  sh   ù€ Ü�)—.‘.Ó"Ó#€Fäœd 9§?¡?Ó#4Ó5Ó6ò ‰	ˆˆTÜô 
à%.§_¡_Ó%6ô
õ 
ð �J‰J�s�Oðð €Mr@   c                óø   — t        j                  |«      }| j                  |dd«      j                  d«      j	                  d«      }| j                  |«      xr" |t        j                  t        |g|¢­Ž «      k(  S )a©  
    Return ``True`` if ``pkg`` is nested inside ``parent`` both logically and in the
    file system.
    >>> _is_nested("a.b", "path/a/b", "a", "path/a")
    True
    >>> _is_nested("a.b", "path/a/b", "a", "otherpath/a")
    False
    >>> _is_nested("a.b", "path/a/b", "c", "path/c")
    False
    >>> _is_nested("a.a", "path/a/a", "a", "path/a")
    True
    >>> _is_nested("b.a", "path/b/a", "a", "path/a")
    False
    rN   r"   r{   )r   Únormpathr0  Ústripr�  Ú
startswithr   )ra  r—  r†   Úparent_pathÚnorm_pkg_pathÚrests         r>   r¸  r¸    so   € ô —N‘N 8Ó,€MØ�;‰;�v˜r 1Ó%×+Ñ+¨CÓ0×6Ñ6°sÓ;€DØ�>‰>˜&Ó!ò  m´u·~±~Üˆ[Ð ˜4Ò ó8ñ 'ð r@   c                ó^   — t        j                  | d¬«       t        j                  | «       | S )zFCreate a directory ensured to be empty. Existing files may be removed.T)Úignore_errors)r   Úrmtreer\   Úmakedirs)Údir_s    r>   ré   ré     s!   € ä‡N�N�4 tÕ,Ü‡K�K�ÔØ€Kr@   c                  ó    — e Zd Zdd„Zd„ Zd„ Zy)r   c                óJ   — || _         || _        || _        || _        g | _        y rQ   )rZ   r[   r�   Úeditable_namerE  )rV   rZ   r�   rÍ  r[   s        r>   r  z_NamespaceInstaller.__init__   s(   € Ø(ˆÔØ ˆŒØ 0ˆÔØ*ˆÔØ"$ˆ�r@   c                ó„   — t         j                  j                  | j                  | j                  | j
                  z   «      S )zInstallation target.)r\   r_   r`   r�   rÍ  Ú	nspkg_extrU   s    r>   Ú_get_nspkg_filez#_NamespaceInstaller._get_nspkg_file'  s,   € ä�w‰w�|‰|˜D×1Ñ1°4×3EÑ3EÈÏÉÑ3VÓWÐWr@   c                ó>   — t        t        | j                  «      «      S )z1Where the modules/packages should be loaded from.)Úreprrw   r[   rU   s    r>   Ú	_get_rootz_NamespaceInstaller._get_root+  s   € ä”C˜Ÿ™Ó&Ó'Ð'r@   Nrö   )rC   rD   rE   r  rÐ  rÓ  rI   r@   r>   r   r     s   „ ó%òXó(r@   r   a  from __future__ import annotations
import sys
from importlib.machinery import ModuleSpec, PathFinder
from importlib.machinery import all_suffixes as module_suffixes
from importlib.util import spec_from_file_location
from itertools import chain
from pathlib import Path

MAPPING: dict[str, str] = {mapping!r}
NAMESPACES: dict[str, list[str]] = {namespaces!r}
PATH_PLACEHOLDER = {name!r} + ".__path_hook__"


class _EditableFinder:  # MetaPathFinder
    @classmethod
    def find_spec(cls, fullname: str, path=None, target=None) -> ModuleSpec | None:  # type: ignore
        # Top-level packages and modules (we know these exist in the FS)
        if fullname in MAPPING:
            pkg_path = MAPPING[fullname]
            return cls._find_spec(fullname, Path(pkg_path))

        # Handle immediate children modules (required for namespaces to work)
        # To avoid problems with case sensitivity in the file system we delegate
        # to the importlib.machinery implementation.
        parent, _, child = fullname.rpartition(".")
        if parent and parent in MAPPING:
            return PathFinder.find_spec(fullname, path=[MAPPING[parent]])

        # Other levels of nesting should be handled automatically by importlib
        # using the parent path.
        return None

    @classmethod
    def _find_spec(cls, fullname: str, candidate_path: Path) -> ModuleSpec | None:
        init = candidate_path / "__init__.py"
        candidates = (candidate_path.with_suffix(x) for x in module_suffixes())
        for candidate in chain([init], candidates):
            if candidate.exists():
                return spec_from_file_location(fullname, candidate)
        return None


class _EditableNamespaceFinder:  # PathEntryFinder
    @classmethod
    def _path_hook(cls, path) -> type[_EditableNamespaceFinder]:
        if path == PATH_PLACEHOLDER:
            return cls
        raise ImportError

    @classmethod
    def _paths(cls, fullname: str) -> list[str]:
        paths = NAMESPACES[fullname]
        if not paths and fullname in MAPPING:
            paths = [MAPPING[fullname]]
        # Always add placeholder, for 2 reasons:
        # 1. __path__ cannot be empty for the spec to be considered namespace.
        # 2. In the case of nested namespaces, we need to force
        #    import machinery to query _EditableNamespaceFinder again.
        return [*paths, PATH_PLACEHOLDER]

    @classmethod
    def find_spec(cls, fullname: str, target=None) -> ModuleSpec | None:  # type: ignore
        if fullname in NAMESPACES:
            spec = ModuleSpec(fullname, None, is_package=True)
            spec.submodule_search_locations = cls._paths(fullname)
            return spec
        return None

    @classmethod
    def find_module(cls, _fullname) -> None:
        return None


def install():
    if not any(finder == _EditableFinder for finder in sys.meta_path):
        sys.meta_path.append(_EditableFinder)

    if not NAMESPACES:
        return

    if not any(hook == _EditableNamespaceFinder._path_hook for hook in sys.path_hooks):
        # PathEntryFinder is needed to create NamespaceSpec without private APIS
        sys.path_hooks.append(_EditableNamespaceFinder._path_hook)
    if PATH_PLACEHOLDER not in sys.path:
        sys.path.append(PATH_PLACEHOLDER)  # Used just to trigger the path hook
c                ó    — t        t        |j                  «       t        j                  d«      ¬«      «      }t
        j                  | ||¬«      S )z_Create a string containing the code for the``MetaPathFinder`` and
    ``PathEntryFinder``.
    r   )rŽ  ©rl   r»   r   )rZ  r¨  rD  ÚoperatorÚ
itemgetterÚ_FINDER_TEMPLATEÚformatrÕ  s      r>   rh  rh  ‰  s>   € ô ”6˜'Ÿ-™-›/¬x×/BÑ/BÀ1Ó/EÔFÓG€GÜ×"Ñ"¨°gÈ*Ð"ÓUÐUr@   c                  ó   — e Zd ZdZy)r…  zCFile system does not seem to support either symlinks or hard links.N)rC   rD   rE   rF   rI   r@   r>   r…  r…  “  s   „ ÚMr@   r…  )ri  rw   rB   rg  )r†  r   rB   Úbool)rò   úIterable[str]r^   údict[str, str]rT   r   rB   rÛ  )rY   r   rB   úIterator[str])rò   rÜ  r^   r  r[   r   rB   rÝ  )r_   r   rB   rw   )r«  rÝ  rB   rÞ  )rò   r  r«  rÝ  rB   zIterator[tuple[str, list[str]]])r«  rÝ  rB   rÝ  )
ra  rw   r—  rw   r†   rw   rÃ  rw   rB   rÛ  )rÊ  r,   rB   r,   )rl   rw   r»   r  r   zdict[str, list[str]]rB   rw   )crF   Ú
__future__r   rq  ÚloggingrÖ  r\   rÐ   rÇ   Úcollections.abcr   r   r   Ú
contextlibr   Úenumr   Úinspectr	   Ú	itertoolsr
   r   Úpathlibr   Útempfiler   Útypesr   Útypingr   r   r   r   r   rN   r   r   r   r   r   r   r   r2   r   r   Ú	discoveryr   rY   r   Úwarningsr    r!   r#   r—   r$   r¦   r%   rt   r&   r”   r'   r˜   r(   r£   Útyping_extensionsr)   Ú_vendor.wheel.wheelfiler+   r,   Ú	getLoggerrC   rã   r/   rN  r  rK   rù   rî   rê   rï   r  rC  rì   r‘  rë   rX  rY  r©  r\  r[  rª  r¸  ré   Ú	Installerr   rØ  rh  Ú	FileErrorr…  rI   r@   r>   ú<module>rñ     sä  ðñ
õ #ã 	Û Û Û 	Û Û ß 7Ñ 7Ý Ý Ý ß $Ý Ý 'Ý ß CÕ Cç J× JÝ ß !Ý )Ý ß DÝ %Ý .Ý 1Ý .Ý +Ý CáÝ&å3áˆT˜Ô!€Ø
ˆ'×
Ñ
˜HÓ
%€ô&$�Dô &$ðR€ðÐ ô^8�Wô ^8ôB	
�xô 
÷ñ ô<K<�
ô K<÷\><ñ ><óBó*ð(&Øð&Ø*8ð&ØGNð&à	ó&òR'óó Fð
%Øð
%à"ð
%ð ð
%ð ó	
%ó2ó#ð0 Øð Ø$2ð à$ó ó
óó,ô(˜*×.Ñ.ô (ð"VÐ ðrVØ
ðVØ)ðVØ7KðVàóVôN˜×(Ñ(õ Nr@   