ó
    µ'Ôi.ˆ  ã                  óp  • S r SSKJr  SSKrSSKrSSKrSSK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Jr  SS
KJr  SSKJr  SSKJrJrJrJ r   SSK!J"r"J#r#J$r$J%r%J&r&J'r'  SSK$J(r(  SSK)J*r*J+r+  SSK,J-r-  SSK.J/r/  SSK0J1r1J2r2  SSK3J3r4  SSK5J5r6  SSK7J7r8  SSK9J9r:  SSK;J;r<  SSK=J=r>  \(       a  SSK?J@r@  SSKAJBrB  \" S\(S9rC\Rˆ                  " \E5      rF " S S \5      rGS!rHS"rI " S# S$\"5      rJ " S% S&\5      rK " S' S(5      rL " S) S*\L5      rM " S+ S,5      rNS@S- jrOSAS. jrP        SBS/ jrQS0 rRSCS1 jrSSCS2 jrT        SDS3 jrUSES4 jrVSFS5 jrW      SGS6 jrXSHS7 jrYSIS8 jrZSJS9 jr[ " S: S;\'R¸                  5      r]S<r^        SKS= jr_ " S> S?\&RÀ                  5      rag)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Ú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                  ó8   • \ rS rSrSrSrSrSr\S	S j5       r	Sr
g)
Ú_EditableModeé5   zú
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                óø   • U(       d  [         R                  $ UR                  5       nU[         R                  ;  a  [        R
                  " SU< S35      eUS:X  a  [        R                  " SSSS9  [         U   $ )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      Ú`/var/www/surfInsights/venv3-11/lib/python3.13/site-packages/setuptools/command/editable_wheel.pyÚconvertÚ_EditableMode.convertA   sv   € æÜ ×(Ñ(Ð(à—
‘
“ˆØœ×1Ñ1Ó1Ü×$Ò$Ð'>¸t¹hÐFVÐ%WÓXÐXà�HÓÜ(×-Ò-Ø*ðð ;òô  ˜UÑ#Ð#ó    © N)r<   ú
str | NoneÚreturnr.   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚSTRICTr6   r4   Úclassmethodr?   Ú__static_attributes__rB   rA   r>   r.   r.   5   s*   † ñð €FØ€GØ€Fàó$ó ó$rA   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                  ó  • \ rS rSrSrSrSSSS\" \R                  =(       d    S5      4/rS	 r	SS
 jr
SS jrS rS rSS jr        SS jrS rSS jr          SS jrSS jrSS jrS rSS jr        S S jrSrg)!Úeditable_wheeléh   z¢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Ú c                ó<   • S U l         S U l        S U l        S U l        g ©N)Údist_dirÚdist_info_dirÚproject_dirr<   ©Úselfs    r>   Úinitialize_optionsÚ!editable_wheel.initialize_optionsv   s    € ØˆŒØ!ˆÔØˆÔØˆ�	rA   c                ó6  • U R                   nUR                  =(       d    [        R                  U l        UR
                  =(       d    0 U l        [        U R                  =(       d*    [        R                  R                  U R                  S5      5      U l        g )NÚdist)
ÚdistributionÚsrc_rootÚosÚcurdirrW   Úpackage_dirr   rU   ÚpathÚjoin)rY   r]   s     r>   Úfinalize_optionsÚeditable_wheel.finalize_options|   s_   € Ø× Ñ ˆØŸ=™=×5¬B¯I©IˆÔØ×+Ñ+×1¨rˆÔÜ˜TŸ]™]×T¬b¯g©g¯l©l¸4×;KÑ;KÈVÓ.TÓUˆ�rA   c                ó¾  •  U R                   R                  SS9  U R                  5         U R                  S5        U R	                  S5      nUR                  U R                  5        U R                  U5        g ! [         aX  nU R                  R                  =(       d    U R                  R                  5       n[        R                  " USU S35        e S nAff = f)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)rU   ÚmkdirÚ_ensure_dist_infoÚreinitialize_commandÚget_finalized_commandÚwrite_wheelfilerV   Ú_create_wheel_fileÚ	Exceptionr^   ÚnameÚget_namer   Úadd_note)rY   ri   ÚexÚprojects       r>   ÚrunÚ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   ‚A7A: Á:
CÂACÃCc                óŽ  • U R                   cb  [        [        U R                  S5      5      nU R                  Ul        UR                  5         UR                  5         UR                   U l         g [        U R                   5      R                  S5      (       d   e[        U R                   S5      R                  5       (       d   eg )Nr$   z
.dist-infoÚMETADATA)rV   r   Údist_info_clsrl   rU   Ú
output_dirÚensure_finalizedrv   ÚstrÚendswithr   Úexists)rY   r$   s     r>   rk   Ú 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ÐAÜ˜×*Ñ*¨JÓ7×>Ñ>×@Ñ@Ð@Ñ@rA   c                óô   • U R                   nUR                  (       d  g [        U R                  U R                  R                  SS5      5      R                  5       n[        X1X$5      nUR                  5         g )NrR   Ú.)	r^   Únamespace_packagesr   rW   rb   ÚgetÚresolveÚ_NamespaceInstallerÚinstall_namespaces)rY   Úinstallation_dirÚ
pth_prefixr]   r_   Ú	installers         r>   Ú_install_namespacesÚ"editable_wheel._install_namespaces¢   s_   € à× Ñ ˆØ×&×&Øä˜×(Ñ(¨$×*:Ñ*:×*>Ñ*>¸rÀ3Ó*GÓH×PÑPÓRˆÜ'¨À
ÓUˆ	Ø×$Ñ$Õ&rA   c                óÌ   • U R                   (       a  [        U R                   5      R                  O	[        5       n[        [        UR                  S5      5      n[        US 5      $ )Nz
*.egg-info)rV   r   ÚparentÚmapr}   ÚglobÚnext)rY   Ú
parent_dirÚ
candidatess      r>   Ú_find_egg_info_dirÚ!editable_wheel._find_egg_info_dir¬   sH   € Ø8<×8J×8J”T˜$×,Ñ,Ó-×4Ò4ÔPTÓPVˆ
Üœ˜jŸo™o¨lÓ;Ó<ˆ
Ü�J Ó%Ð%rA   c                ó´  • U R                   n[        U5      n[        U5      n[        [        X! S3S5      5      n[        [        X! S3S5      5      n[        [        X! S3S5      5      n	[        [        UR                  SSS95      n
[        U5      U
l        SU
l        [        [        UR                  SSS95      n[        [        UR                  S	SS95      nU=Ul
        =Ul        Ul        U=Ul        =Ul        Ul        U	=Ul        Ul        XŒl        X|l        UR)                  S
5      nSUl        [        [,        UR)                  S5      5      nSUl        [        U5      Ul        [        [2        UR)                  S5      5      nSUl        U R7                  5       Ul        U R;                  5         UR=                  5         UR=                  5         g)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)r^   r}   r   r   Úegg_info_clsrl   Ú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_moder|   )rY   rq   Úunpacked_wheelr¤   Útmp_dirr]   Úwheelr—   r˜   r™   r%   r"   r&   r›   r'   r#   s                   r>   Ú_configure_buildÚeditable_wheel._configure_build±   sÎ  € ð × Ñ ˆÜ�NÓ#ˆÜ˜	“Nˆ	Ü”4˜¨&°¨¸Ó?Ó@ˆÜ”d˜>¨V°5¨>¸9ÓEÓFˆÜ”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ˆÔ&à×ÑÔ!à×ÑÔ Ø× Ñ Õ"rA   c                óö   • U R                   nUR                  S5      nUR                  5        HH  nUR                  U5      n[        US5      (       a	  SUl        M.  [        US5      (       d  MA  SUl        MJ     g)z8Set the ``editable_mode`` flag in the build sub-commandsr"   Úeditable_modeTÚinplaceN)r^   rª   Úget_sub_commandsÚhasattrr¹   rº   )rY   r]   r"   Úcmd_nameÚcmds        r>   r²   Ú!editable_wheel._set_editable_modeð   si   € à× Ñ ˆØ×$Ñ$ WÓ-ˆØ×.Ñ.Ö0ˆHØ×&Ñ& xÓ0ˆCÜ�s˜O×,Ñ,Ø$(�Ö!Ü˜˜i×(Ó(Ø"�–ò 1rA   c                ój  • / n0 nU R                  S5      nUR                  5        Hˆ  nU R                  U5      n[        US5      (       a(  UR                  UR	                  5       =(       d    / 5        [        US5      (       d  M`  UR                  UR                  5       =(       d    0 5        MŠ     X4$ )Nr"   Úget_outputsÚget_output_mapping)rm   r»   r¼   ÚextendrÁ   ÚupdaterÂ   )rY   ÚfilesÚmappingr"   r½   r¾   s         r>   Ú_collect_build_outputsÚ%editable_wheel._collect_build_outputsû   s–   € ØˆØ"$ˆØ×*Ñ*¨7Ó3ˆà×.Ñ.Ö0ˆHØ×,Ñ,¨XÓ6ˆCÜ�s˜M×*Ñ*Ø—‘˜SŸ_™_Ó.×4°"Ô5Ü�sÐ0×1Ó1Ø—‘˜s×5Ñ5Ó7×=¸2Ö>ñ 1ð ˆ~ÐrA   c                óÖ   • U R                  XX45        U R                  5         U R                  5       u  pVU R                  S5        U R                  S5        U R                  S5        XV4$ )Nr˜   r™   r—   )r¶   Ú_run_build_subcommandsrÇ   Ú_run_install)rY   Ú	dist_namer³   r¤   r´   rÅ   rÆ   s          r>   Ú_run_build_commandsÚ"editable_wheel._run_build_commands	  sb   € ð 	×Ñ˜i¸ÔLØ×#Ñ#Ô%Ø×4Ñ4Ó6‰ˆØ×Ñ˜)Ô$Ø×Ñ˜)Ô$Ø×Ñ˜&Ô!Øˆ~ÐrA   c                óî   • U R                  S5      nUR                  5        HP  nU R                  U5      nUS:X  a%  [        U5      [        La  U R	                  U5        M?  U R                  U5        MR     g)aE  
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)rm   r»   Útyper¯   Ú_safely_runÚrun_command)rY   r"   rq   r¾   s       r>   rÊ   Ú%editable_wheel._run_build_subcommands  sf   € ð ×*Ñ*¨7Ó3ˆØ×*Ñ*Ö,ˆDØ×,Ñ,¨TÓ2ˆCØ�zÓ!¤d¨3£i´|Ò&CØ× Ñ  Ö&à× Ñ  Ö&ò -rA   c                ó®   •  U R                  U5      $ ! [         a7    [        R                  " SS[        R
                  " 5        SU SU S35         g f = f)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Ò   rp   r    r:   Ú	tracebackÚ
format_exc)rY   r½   s     r>   rÑ   Úeditable_wheel._safely_run.  sp   € ð	Ø×#Ñ# HÓ-Ð-øÜó 	Ü(×-Ò-ØBðÜ×%Ò%Ó'Ð(ð )8ð 9A°zð B-ð
 .6¨Jð 7ðöð	ús   ‚ “>AÁAc           
     ó®  • SSK Jn  U R                  S5      nUR                  nSR	                  UR                  5       5      nSnU SU SU S3n[        U R                  U5      nUR                  5       (       a  UR                  5         [        US9n	[        SS9n
[        S	S9nU	 oÊ oÛ n[        U[        U R                  5      R                  5      n[        R                  " U R                  U5        U R                  XÄ5        U R                  XLXÞ5      u  nnU R!                  XEU5      nU   U" US
5       nU" UUU5        UR#                  U5        S S S 5        S S S 5        S S S 5        S S S 5        S S S 5        U$ ! , (       d  f       N0= f! , (       d  f       N9= f! , (       d  f       NB= f! , (       d  f       NK= f! , (       d  f       U$ = f)Nr   r)   r$   Ú-z
0.editablez.whl)Úsuffixz
.build-libz.build-tempÚw)Úwheel.wheelfiler*   rm   rq   rd   Úget_tagr   rU   r   Úunlinkr   rV   ÚshutilÚcopytreer‹   rÍ   Ú_select_strategyÚwrite_files)rY   ri   r*   r$   rÌ   ÚtagÚ	build_tagÚarchive_nameÚ
wheel_pathr³   r¤   Ú	build_tmpÚunpackedÚlibÚtmpÚunpacked_dist_inforÅ   rÆ   ÚstrategyÚ	wheel_objs                       r>   ro   Ú!editable_wheel._create_wheel_fileJ  s{  € Ý-à×.Ñ.¨{Ó;ˆ	Ø—N‘Nˆ	Ø�h‰h�{×*Ñ*Ó,Ó-ˆØ ˆ	Ø#˜ A i [°°#°°dÐ;ˆÜ˜$Ÿ-™-¨Ó6ˆ
Ø×Ñ×ÑØ×ÑÔä+°<Ñ@ˆÜ&¨lÑ;ˆ	Ü&¨mÑ<ˆ	á˜x¨°c¸9ÈÜ!% h´°T×5GÑ5GÓ0H×0MÑ0MÓ!NÐÜ�OŠO˜D×.Ñ.Ð0BÔCØ×$Ñ$ XÔ9Ø!×5Ñ5°iÈ3ÓT‰NˆE�7Ø×,Ñ,¨Y¸SÓAˆHÚ™9 Z°Ô5¸Ù˜ E¨7Ô3Ø×%Ñ% hÔ/÷ 6—÷ <E¯�^ð Ð÷	 6Õ5ú—•ú÷ <E½9ú¯­ú�^Œ^ð Ðúsm   Â(GÂ*F4Â,BF#Ä1
F	Ä;FÅF	ÅF#Å'F4Å/GÆ
FÆF	Æ
F ÆF#Æ#
F1Æ-F4Æ4
G	Æ>GÇ
Gc                ó¼   • [        U R                  SU 3S 5      nU(       a;  U" 5       (       a.  [        R                  SU S35        U R	                  SU 35        g g g )NÚhas_zInstalling z as non editableÚinstall_)Úgetattrr^   Ú_loggerÚinforÒ   )rY   ÚcategoryÚhas_categorys      r>   rË   Úeditable_wheel._run_installf  sX   € Ü˜t×0Ñ0°D¸¸
Ð2CÀTÓJˆÞ™LŸN™NÜ�L‰L˜; x jÐ0@ÐAÔBØ×Ñ˜x¨ zÐ2Õ3ð +ˆ<rA   c                ó~  • SU SU 3n[        U R                  5      n[        R                  U R                  5      nU[        R
                  L a7  [        [        U R                  SU5      5      n[        U R                  XU5      $ [        U R                  5      n[        X€R                  U5      n	U[        R                  L n
[        U R                  5      S1:X  a  U	(       d  U
(       a=  U R                  R                  SS5      n[        U R                  U[        X[5      /5      $ [!        U R                  U5      $ )zDDecides which strategy to use to implement an editable installation.ú__editable__.rÙ   r"   rR   r‚   )r   rW   r.   r?   r<   rJ   Ú
_empty_dirÚ	_LinkTreer^   Ú_find_packagesÚ_simple_layoutrb   r4   Úsetr„   Ú
_StaticPthÚ_TopLevelFinder)rY   rq   rã   r¤   Ú
build_namerW   r<   Úauxiliary_dirÚpackagesÚhas_simple_layoutÚis_compat_modeÚsrc_dirs               r>   rá   Úeditable_wheel._select_strategyl  s  € ð % T F¨!¨C¨5Ð1ˆ
Ü˜4×+Ñ+Ó,ˆÜ×$Ñ$ T§Y¡YÓ/ˆà”=×'Ñ'Ò'Ü&¤t¨D×,<Ñ,<¸gÀzÓ'RÓSˆMÜ˜T×.Ñ.°ÀYÓOÐOä! $×"3Ñ"3Ó4ˆÜ*¨8×5EÑ5EÀ{ÓSÐØ¤×!5Ñ!5Ð5ˆÜˆt×ÑÓ  R DÓ(Ö->Æ.à×&Ñ&×*Ñ*¨2¨sÓ3ˆGÜ˜d×/Ñ/°¼¸[Ó8RÐ7SÓTÐTô ˜t×0Ñ0°$Ó7Ð7rA   )rU   rV   r<   rb   rW   ©rD   ÚNone)rD   rC   )rq   r}   r³   r   r¤   r   r´   r   )rD   ú tuple[list[str], dict[str, str]])
rÌ   r}   r³   r   r¤   r   r´   r   rD   r
  )r½   r}   )rõ   r}   )rq   r}   rã   r}   r¤   r   rD   ÚEditableStrategy)rE   rF   rG   rH   rI   Údescriptionr	   r.   Úuser_optionsrZ   re   rv   rk   r‹   r”   r¶   r²   rÇ   rÍ   rÊ   rÑ   ro   rË   rá   rL   rB   rA   r>   rN   rN   h   sý   † ñð
 W€Kð 	LØKØ	�$™ ×!6Ñ!6×!<¸"Ó=Ð>ð€LòôVôò*	Aò'ô&ð
=#Øð=#Ø)0ð=#Ø=Dð=#ØOVô=#ò~	#ôðàðð  ðð ð	ð
 ðð 
*ôô'ô,ò8ô84ð8àð8ð ð8ð ð	8ð
 
÷8rA   rN   c                  óR   • \ rS rSr        SS jrSS jr        S	S jrSrg)
r  i‡  c                ó   • g rT   rB   )rY   rµ   rÅ   rÆ   s       r>   Ú__call__ÚEditableStrategy.__call__ˆ  s   € àrA   c                ó   • g rT   rB   rX   s    r>   Ú	__enter__ÚEditableStrategy.__enter__‹  s   €  rA   c                ó   • g rT   rB   ©rY   Ú	_exc_typeÚ
_exc_valueÚ
_tracebacks       r>   Ú__exit__ÚEditableStrategy.__exit__Œ  s   € ð
 rA   rB   N)rµ   r*   rÅ   ú	list[str]rÆ   úMapping[str, str]rD   Úobject©rD   r(   )r  ztype[BaseException] | Noner  zBaseException | Noner  zTracebackType | NonerD   r  )rE   rF   rG   rH   r  r  r  rL   rB   rA   r>   r  r  ‡  sW   † ðØðØ'0ðØ;Lðà	ôô %ðà-ðð )ðð )ð	ð
 
÷rA   r  c                  ó\   • \ rS rSrSS jr        S	S jrS
S jr        SS jrSrg)rÿ   i”  c                ó(   • Xl         X l        X0l        g rT   ©r]   rq   Úpath_entries)rY   r]   rq   r#  s       r>   Ú__init__Ú_StaticPth.__init__•  s   € ØŒ	ØŒ	Ø(ÕrA   c                ó¤   • SR                  S U R                   5       5      n[        U S35      nUR                  SU R                   S3U5        g )NÚ
c              3  óT   #   • U  H  n[        UR                  5       5      v •  M      g 7frT   )r}   r…   )Ú.0Úps     r>   Ú	<genexpr>Ú&_StaticPth.__call__.<locals>.<genexpr>�  s    é € ÐHÒ6G°œC §	¡	£×,Ð,Ò6Gùs   ‚&(rù   ú.pth)rd   r#  Ú_encode_pthÚwritestrrq   )rY   rµ   rÅ   rÆ   ÚentriesÚcontentss         r>   r  Ú_StaticPth.__call__š  sI   € ð —)‘)ÑH°d×6GÒ6GÓHÓHˆÜ ' ¨"˜~Ó.ˆØ�‰˜ t§y¡y k°Ð6¸ÕArA   c                ó¢   • S[        [        [        R                  U R                  5      5      < S3n[
        R                  U[        -   5        U $ )Nz_
        Editable install will be performed using .pth file to extend `sys.path` with:
        z	
        )Úlistr�   r`   Úfspathr#  ró   ÚwarningÚ_LENIENT_WARNING©rY   Úmsgs     r>   r  Ú_StaticPth.__enter__¡  sH   € ð	ä	Œc”"—)‘)˜T×.Ñ.Ó/Ó	0Ñ3ð 4	ðˆô 	�‰˜Ô.Ñ.Ô/ØˆrA   c                ó   • g rT   rB   r  s       r>   r  Ú_StaticPth.__exit__©  s   € ð 	rA   r"  N)r]   r   rq   r}   r#  z
list[Path]rD   r	  ©rµ   r*   rÅ   r  rÆ   r  rD   r	  r  ©r  r  r  r  r  r  rD   r	  )	rE   rF   rG   rH   r$  r  r  r  rL   rB   rA   r>   rÿ   rÿ   ”  sa   † ô)ð
BØðBØ'0ðBØ;LðBà	ôBôðàðð ðð ð	ð
 
÷rA   rÿ   c                  óª   ^ • \ rS rSrSr          SU 4S jjr        SU 4S jjrSS jrSSS jjrSS jr	SS jr
        SS	 jrS
rU =r$ )rû   i²  aH  
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                óØ   >• [        U5      U l        [        U5      R                  5       U l        UR	                  S5      R
                  U l        [        TU ]!  XU R                  /5        g )Nr#   )	r   r  r…   r¤   rª   Ú	copy_fileÚ_fileÚsuperr$  )rY   r]   rq   r  r¤   Ú	__class__s        €r>   r$  Ú_LinkTree.__init__½  sV   ø€ ô " -Ó0ˆÔÜ˜i›×0Ñ0Ó2ˆŒØ×)Ñ)¨*Ó5×?Ñ?ˆŒ
Ü‰Ñ˜ d×&8Ñ&8Ð%9Õ:rA   c                óH   >• U R                  X#5        [        TU ]	  XU5        g rT   )Ú_create_linksrC  r  )rY   rµ   rÅ   rÆ   rD  s       €r>   r  Ú_LinkTree.__call__É  s"   ø€ ð 	×Ñ˜5Ô*Ü‰Ñ˜ wÕ/rA   c                ó  • [        [        5         [        U5      R                  5       R	                  U R
                  5      n[        U5      R                  [        R                  S5      sS S S 5        $ ! , (       d  f       g = f)NÚ/)
r   Ú
ValueErrorr   r…   Úrelative_tor¤   r}   Úreplacer`   Úsep)rY   Úfilerc   s      r>   Ú_normalize_outputÚ_LinkTree._normalize_outputÏ  sT   € ä”jÕ!Ü˜“:×%Ñ%Ó'×3Ñ3°D·N±NÓCˆDÜ�t“9×$Ñ$¤R§V¡V¨SÓ1÷ "×!Ö!ð ús   �AA5Á5
Bc                ó²   • U R                   U-  nUR                  R                  5       (       d  UR                  R                  SS9  U R	                  X$US9  g )NT)Úparents©Úlink)r  rŽ   Úis_dirrj   rB  )rY   Úrelative_outputÚsrc_filerU  Údests        r>   Ú_create_fileÚ_LinkTree._create_fileÖ  sJ   € Ø×!Ñ! OÑ3ˆØ�{‰{×!Ñ!×#Ñ#Ø�K‰K×Ñ dÐÑ+Ø�
‰
�8¨ˆ
Ò-rA   c                ó´  ^ • T R                   R                  SSS9  [        T R                   5      (       a  SOSnU 4S jUR                  5        5       nU VVs0 s H  u  pVUc  M
  XV_M     nnnU H5  nT R	                  U5      n	U	(       d  M  X—;  d  M$  T R                  X˜5        M7     UR                  5        H  u  pšT R                  XšUS9  M     g s  snnf )NT)rS  rh   ÚsymÚhardc              3  óN   >#   • U  H  u  pTR                  U5      U4v •  M     g 7frT   )rP  )r)  ÚkÚvrY   s      €r>   r+  Ú*_LinkTree._create_links.<locals>.<genexpr>ß  s%   øé € ÐXÒAW¹¸�t×-Ñ-¨aÓ0°!Õ4ÒAWùs   ƒ"%rT  )r  rj   Ú_can_symlink_filesÚitemsrP  rZ  )rY   ÚoutputsÚoutput_mappingÚ	link_typeÚ
normalisedr`  ra  ÚmappingsÚoutputÚrelativeÚsrcs   `          r>   rG  Ú_LinkTree._create_linksÜ  sÂ   ø€ Ø×Ñ× Ñ ¨¸Ð Ñ=Ü/°×0BÑ0B×CÑC‘EÈˆ	ÜXÀ×AUÑAUÔAWÓXˆ
á%/ÔA¢Z™T˜Q°1“D�A’D¡ZˆÑAãˆFØ×-Ñ-¨fÓ5ˆHßˆx˜HÕ4Ø×!Ñ! (Ö3ñ ð
 &Ÿ^™^Ö-‰MˆHØ×Ñ˜h°)ÐÓ<ò .ùó Bs   Á	CÁ&Cc                óB   • Sn[         R                  U[        -   5        U $ )Nz=Strict editable install will be performed using a link tree.
)ró   r6  Ú_STRICT_WARNINGr8  s     r>   r  Ú_LinkTree.__enter__ë  s   € ØNˆÜ�‰˜œoÑ-Ô.ØˆrA   c                óR   • SU R                    S3n[        R                  " SU5        g )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:   ©rY   r  r  r  r9  s        r>   r  Ú_LinkTree.__exit__ð  s2   € ðà×ÑÐ ð !	ðˆô 	×ÒÐ5°sÕ;rA   )rB  r  r¤   )
r]   r   rq   r}   r  r   r¤   r   rD   r	  r=  )rO  r}   rD   rC   rT   )rW  r}   rX  r}   )rf  r  r  r>  )rE   rF   rG   rH   rI   r$  r  rP  rZ  rG  r  r  rL   Ú__classcell__)rD  s   @r>   rû   rû   ²  s¦   ø† ñð
;àð
;ð ð
;ð ð	
;ð
 ð
;ð 
÷
;ð0Øð0Ø'0ð0Ø;Lð0à	÷0ôö.ô=ôð
<àð<ð ð<ð ð	<ð
 
÷<ò <rA   rû   c                  óp   • \ rS rS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	)r   i   c                ó   • Xl         X l        g rT   ©r]   rq   )rY   r]   rq   s      r>   r$  Ú_TopLevelFinder.__init__  s   € ØŒ	Ø�	rA   c           
     óÆ  • U R                   R                  =(       d    [        R                  n[	        [        U R                   5      [        U R                   5      5      nU R                   R                  =(       d    0 n[        X#U5      n[        [	        [        U R                   R                  =(       d    / U5      S [        U5       5       5      5      nU R                   R                  =(       d    /  Vs0 s H-  nU[        XdU R                   R                  =(       d    S5      _M/     nn0 UEUEnSU R                   S3n	[         R"                  " U	5      n
X©X…4$ s  snf )Nc              3  ó(   #   • U  H  o/ 4v •  M
     g 7frT   rB   )r)  Únss     r>   r+  Ú0_TopLevelFinder.template_vars.<locals>.<genexpr>  s   é € ÐDÒ$C˜b�b•Ò$Cùs   ‚rR   rù   z.finder)r]   r_   r`   ra   r
   rü   Ú_find_top_level_modulesrb   Ú_find_package_rootsÚdictÚ_find_namespacesr  Ú_find_virtual_namespacesrƒ   r   rq   r   Úsafe_identifier)rY   r_   Ú	top_levelrb   ÚrootsÚnamespaces_ÚpkgÚlegacy_namespacesrÆ   rq   Úfinders              r>   Útemplate_varsÚ_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Ð9ó
â9�ð Ô" 3¨t¯y©y×/AÑ/A×/GÀRÓHÒHÙ9ð 	ð 
ð
 1�UÐ0Ð/Ð0ˆð
 ˜tŸy™y˜k¨Ð1ˆÜ×/Ò/°Ó5ˆØ˜WÐ1Ð1ùò
s   Ã84Ec              #  ó¼   #   • U R                  5       u  pp4[        [        X#U5      S5      nU S3U4v •  [        SU SU S35      nSU R                   S3U4v •  g 7f)Núutf-8z.pyzimport z; z
.install()rù   r-  )rŠ  ÚbytesÚ_finder_templater.  rq   )rY   r‰  rq   rÆ   r†  Úcontents         r>   Úget_implementationÚ"_TopLevelFinder.get_implementation   sn   é € Ø-1×-?Ñ-?Ó-AÑ*ˆ�gäÔ(¨¸ÓDÀgÓNˆØ�˜ˆ~˜wÐ'Ò'ä ¨ x¨r°&°¸ÐDÓEˆØ˜tŸy™y˜k¨Ð.°Ð8Ó8ùs   ‚AAc                óX   • U R                  5        H  u  pEUR                  XE5        M     g rT   )r‘  r/  )rY   rµ   rÅ   rÆ   rO  r�  s         r>   r  Ú_TopLevelFinder.__call__)  s%   € ð "×4Ñ4Ö6‰MˆDØ�N‰N˜4Ö)ò 7rA   c                óB   • Sn[         R                  U[        -   5        U $ )Nz=Editable install will be performed using a meta path finder.
)ró   r6  r7  r8  s     r>   r  Ú_TopLevelFinder.__enter__/  s   € ØNˆÜ�‰˜Ô.Ñ.Ô/ØˆrA   c                ó6   • Sn[         R                  " SU5        g )Nz¢

        Please be careful with folders in your working directory with the same
        name as your package as they may take precedence during imports.
        rr  )r   r:   rs  s        r>   r  Ú_TopLevelFinder.__exit__4  s   € ðˆô 	×ÒÐ5°sÕ;rA   rx  N)r]   r   rq   r}   rD   r	  )rD   z5tuple[str, str, dict[str, str], dict[str, list[str]]])rD   zIterator[tuple[str, bytes]]r=  r  r>  )rE   rF   rG   rH   r$  rŠ  r‘  r  r  r  rL   rB   rA   r>   r   r      sf   † ôô2ô69ð*Øð*Ø'0ð*Ø;Lð*à	ô*ôð

<àð
<ð ð
<ð ð	
<ð
 
÷
<rA   r   c                ó,  • [         R                  " 5        n[         R                  " U[        R                  S9nUR                  U 5        UR                  5         UR                  S5        UR                  5       sSSS5        $ ! , (       d  f       g= f)al  
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)r�  ÚbufferÚwrappers      r>   r.  r.  A  sZ   € ô 
�ŠŒ˜Ü×"Ò" 6´E×4FÑ4FÑGˆà�‰�gÔØ�‰ŒØ�‰�AŒØ�{‰{‹}÷ 
��ús   –A%BÂ
Bc                ó<  • [        [        U R                  5       5      S9 n[        US5      [        US5      p2UR	                  SSS9  [        [        [        [        5         [        R                  " X#5        UR                  5       (       a%  UR                  SS9S:X  a   S S S 5        S S S 5        gS S S 5         [        R                  " X#5         S S S 5        g	! , (       d  f       N/= f! [         a  nSn[        U5      UeS nAff = f! , (       d  f       g = f)
N)Údirz	file1.txtz	file2.txtÚfile1r�  rš  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   r}   r…   r   Ú
write_textr   ÚAttributeErrorÚNotImplementedErrorÚOSErrorr`   ÚsymlinkÚ
is_symlinkÚ	read_textrU  rp   ÚLinksNotSupported)Úbase_dirrê   Úpath1Úpath2rt   r9  s         r>   rc  rc  V  sï   € Ü	¤ H×$4Ñ$4Ó$6Ó 7Ò	8¸CÜ˜C Ó-¬t°C¸Ó/EˆuØ×Ñ˜¨7ÐÑ3Ü”nÔ&9¼7ÕCÜ�JŠJ�uÔ$Ø×Ñ×!Ñ! e§o¡o¸w oÐ&GÈ7Ó&RØ÷ D÷ 
9Ð	8÷ Dð
	1Ü�GŠG�EÔ!ð ÷! 
9Ð	8÷ DÕCûô ó 	1ðPð ô $ CÓ(¨bÐ0ûð	1ú÷ 
9Õ	8úsO   ¡ADÁ"A CÂ"DÂ3DÂ<C-ÃDÃ
C*	Ã&DÃ-
D
Ã7DÄD
Ä
DÄ
Dc           	     ó2  ^• U  Vs0 s H  o3[        X1U5      _M     nnU(       d  [        U5      0 S14;   $ [        R                  R	                  [        [        UR                  5       5      5      m[        U4S jUR                  5        5       5      $ s  snf )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
rR   c           	   3  óˆ   >#   • U  H7  u  p[         R                  " [        T/UR                  S 5      Q76 U5      v •  M9     g7f©r‚   N)r   Ú	same_pathr   Úsplit)r)  ÚkeyÚvaluerŽ   s      €r>   r+  Ú!_simple_layout.<locals>.<genexpr>�  s:   øé € ð â(‰JˆCô 	�Šœ˜VÐ5 c§i¡i°£nÒ5°u×=Ð=Ú(ùs   ƒ?A)	r   rþ   r`   rc   Ú
commonpathr   Ú_parent_pathrd  Úall)r  rb   rW   r‡  ÚlayoutrŽ   s        @r>   rý   rý   j  s†   ø€ ñ> PXÓXÊxÈÔ$ S°{ÓCÒCÉx€FÐXÞÜ�;Ó B¨¨ :Ñ-Ð-Ü�W‰W×Ñ¤¬°f·l±l³nÓ EÓF€FÜô à Ÿ,™,œ.óó ð ùò	 Ys   †Bc                óh   • UR                  U 5      nUR                  S[        R                  -   5      $ )a  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'
rJ  )ÚremovesuffixÚrstripr`   rN  )r‡  Úpkg_pathrŽ   s      r>   r½  r½  “  s+   € ð ×"Ñ" 3Ó'€FØ�=‰=˜œrŸv™v™Ó&Ð&rA   c              #  óÞ  #   • [        U R                  =(       d    / 5       S h  v•N   U R                  =(       d    / nU Vs/ s H  nSU;   d  M  UPM     nnU R                  (       a  U R                  v •  OFU R                  =(       d    / nX4 Vs/ s H!  nSUR
                  ;   d  M  UR
                  PM#     sn-  nU H  nUR                  S5      u  n  nUv •  M     g  N¼s  snf s  snf 7f)Nr‚   )Úiterr  Ú
py_modulesÚext_packageÚext_modulesrq   Ú
rpartition)	r]   rÆ  ÚmodÚnested_modulesrÈ  ÚxÚmoduleÚpackageÚ_s	            r>   rü   rü   ¡  sÇ   é € Ü�D—M‘M×' RÓ(×(Ð(à—‘×& B€JÙ%/Ó>¢Z˜c°3¸#±:—c¡Z€NÐ>Ø××Ø×ÑÓà×&Ñ&×,¨"ˆØ¨;ÓHª; a¸#ÀÇÁ¹-›6˜1Ÿ6œ6©;ÑHÑHˆã ˆØ×)Ñ)¨#Ó.‰ˆ��AØŒò !ñ )ùò ?ùò
 Iùs9   ‚"C-¤C!¥C-Á
C#ÁC#Á;C-ÂC(Â)C(Â9)C-Ã#
C-c              #  óÐ   #   • U R                   =(       d    / nS U 5        S h  v•N   U R                  (       d'  U R                  =(       d    / nS U 5        S h  v•N   g g  N= N7f)Nc              3  ó6   #   • U  H  nS U;  d  M  Uv •  M     g7fr¶  rB   )r)  rÊ  s     r>   r+  Ú*_find_top_level_modules.<locals>.<genexpr>³  s   é € Ð<šz˜¨S¸©^—‘šzùs   ‚
�	c              3  ó^   #   • U  H#  nS UR                   ;  d  M  UR                   v •  M%     g7fr¶  )rq   )r)  rÌ  s     r>   r+  rÒ  ·  s!   é € ÐE¢K˜q°3¸a¿f¹fÑ3D“F�A—F–F¢Kùs   ‚-š-)rÆ  rÇ  rÈ  )r]   rÆ  rÈ  s      r>   r~  r~  ±  sX   é € Ø—‘×& B€JÙ<™zÓ<×<Ð<à××Ø×&Ñ&×,¨"ˆÙE¡KÓE×EÑEð ñ =ñ 	Fùs!   ‚"A&¤A"¥6A&ÁA$ÁA&Á$A&c                ó€   • [        U 5       Vs0 s H  nU[        [        X1U5      5      _M     nn[        U5      $ s  snf rT   )ÚsortedÚ_absolute_rootr   Ú_remove_nested)r  rb   r_   r‡  Ú	pkg_rootss        r>   r  r  º  sM   € ô ˜(Ô#ó!â#ˆCð 	Œ^Ô-¨cÀÓIÓJÒJÙ#ð ð !ô
 ˜)Ó$Ð$ùò!s   Ž ;c                óØ   • [        U 5      nUR                  nUR                  5       (       a  [        UR	                  5       5      $ [        UR	                  5       UR
                  -  5      $ )z(Works for packages and top-level modules)r   rŽ   r   r}   r…   rq   )rc   Úpath_rŽ   s      r>   rÖ  rÖ  Ç  sK   € ä�‹J€EØ�\‰\€Fà‡|�|‡~�~Ü�5—=‘=“?Ó#Ð#ä�6—>‘>Ó# e§j¡jÑ0Ó1Ð1rA   c           	   #  ó"  #   • U  H…  nSU;  a  M  UR                  S5      n[        [        U5      S-
  SS5       HL  nSR                  USU 5      n[	        [        X@S5      5      nUR                  5       (       a  X@;  d  MH  Uv •  MN     M‡     g7f)a  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   éÿÿÿÿNrR   )r¸  ÚrangeÚlenrd   r   r   r   )rØ  r‡  ÚpartsÚiÚpartial_namerc   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   ‚A<BÂBc              #  óÄ   #   • U  HV  n[        X!S5      n[        U5      R                  5       (       d  M/  [        US5      R                  5       (       a  MP  X#/4v •  MX     g 7f)NrR   z__init__.py)r   r   r   )r  rØ  r‡  rc   s       r>   r�  r�  ê  sO   é € ó ˆÜ  °Ó4ˆÜ�‹:×Ñ×Ó¤t¨D°-Ó'@×'GÑ'G×'IÓ'IØ˜�-Ôò ùs   ‚.A ´A ÁA c                ó  ^^• [        U R                  5       5      n[        [        U R	                  5       5      5       HB  u  mm[        UU4S jU R	                  5        5       5      (       d  M1  UR                  T5        MD     U$ )Nc              3  óZ   >#   • U  H   u  pTU:g  =(       a    [        TTX5      v •  M"     g 7frT   )Ú
_is_nested)r)  ÚotherÚ
other_pathrc   r‡  s      €€r>   r+  Ú!_remove_nested.<locals>.<genexpr>÷  s0   øé € ð 
â%6Ñ!�ð �5‰L×EœZ¨¨T°5ÓEÔEÚ%6ùs   ƒ(+)r€  ÚcopyÚreversedr4  rd  ÚanyÚpop)rØ  rj  rc   r‡  s     @@r>   r×  r×  ó  sh   ù€ Ü�)—.‘.Ó"Ó#€Fäœd 9§?¡?Ó#4Ó5Ö6‰	ˆˆTÜõ 
à%.§_¡_Ô%6ó
÷ 
ó 
ð �J‰J�sŽOñ 7ð €MrA   c                ó  • [         R                  " U5      nU R                  USS5      R                  S5      R	                  S5      nU R                  U5      =(       a#    U[         R                  " [        U/UQ76 5      :H  $ )au  
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
rR   r!   r‚   )r   ÚnormpathrM  Ústripr¸  Ú
startswithr   )r‡  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ñ 'ð rA   c                ó\   • [         R                  " U SS9  [        R                  " U 5        U $ )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�ÔØ€KrA   c                  ó*   • \ rS rSrSS jrS rS rSrg)r†   i  c                óB   • Xl         X@l        X l        X0l        / U l        g rT   )r^   r_   rˆ   Úeditable_namere  )rY   r^   rˆ   rû  r_   s        r>   r$  Ú_NamespaceInstaller.__init__  s    € Ø(ÔØ ŒØ 0ÔØ*ÔØ"$ˆ�rA   c                ó„   • [         R                  R                  U R                  U R                  U R
                  -   5      $ )zInstallation target.)r`   rc   rd   rˆ   rû  Ú	nspkg_extrX   s    r>   Ú_get_nspkg_fileÚ#_NamespaceInstaller._get_nspkg_file%  s,   € ä�w‰w�|‰|˜D×1Ñ1°4×3EÑ3EÈÏÉÑ3VÓWÐWrA   c                ó>   • [        [        U R                  5      5      $ )z1Where the modules/packages should be loaded from.)Úreprr}   r_   rX   s    r>   Ú	_get_rootÚ_NamespaceInstaller._get_root)  s   € ä”C˜Ÿ™Ó&Ó'Ð'rA   )r^   rû  rˆ   re  r_   Nr  )rE   rF   rG   rH   r$  rÿ  r  rL   rB   rA   r>   r†   r†     s   † ô%òXõ(rA   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                ó”   • [        [        UR                  5       [        R                  " S5      S95      n[
        R                  XUS9$ )zWCreate a string containing the code for the``MetaPathFinder`` and
``PathEntryFinder``.
r   )r¹  ©rq   rÆ   r   )r€  rÕ  rd  ÚoperatorÚ
itemgetterÚ_FINDER_TEMPLATEÚformatr  s      r>   r�  r�  ‡  s<   € ô ”6˜'Ÿ-™-›/¬x×/BÒ/BÀ1Ó/EÑFÓG€GÜ×"Ñ"¨È*Ð"ÐUÐUrA   c                  ó   • \ rS rSrSrSrg)r°  i‘  zCFile system does not seem to support either symlinks or hard links.rB   N)rE   rF   rG   rH   rI   rL   rB   rA   r>   r°  r°  ‘  s   † ÜMrA   r°  )r�  r}   rD   rŽ  )r±  r   rD   Úbool)r  úIterable[str]rb   údict[str, str]rW   r   rD   r  )r]   r   rD   úIterator[str])r  r  rb   r  r_   r   rD   r  )rc   r   rD   r}   )rØ  r  rD   r  )r  r  rØ  r  rD   zIterator[tuple[str, list[str]]])rØ  r  rD   r  )
r‡  r}   rÃ  r}   rŽ   r}   rñ  r}   rD   r  )rø  r+   rD   r+   )rq   r}   rÆ   r  r   zdict[str, list[str]]rD   r}   )brI   Ú
__future__r   rœ  Úloggingr  r`   rß   rÕ   Úcollections.abcr   r   r   Ú
contextlibr   Úenumr   Úinspectr	   Ú	itertoolsr
   r   Úpathlibr   Útempfiler   Útypesr   Útypingr   r   r   r   rR   r   r   r   r   r   r   r   r2   r   r   Ú	discoveryr   r]   r   Úwarningsr   r    r"   r    r#   r¯   r$   rz   r%   r�   r&   r¡   r'   r¬   Útyping_extensionsr(   Ú_vendor.wheel.wheelfiler*   r+   Ú	getLoggerrE   ró   r.   ro  r7  rN   r  rÿ   rû   r   r.  rc  rý   r½  rü   r~  r  rÖ  r‚  r�  r×  rå  rú   Ú	Installerr†   r	  r�  Ú	FileErrorr°  rB   rA   r>   Ú<module>r"     sâ  ðñ
õ #ã 	Û Û Û 	Û Û ß 7Ñ 7Ý Ý Ý ß $Ý Ý 'Ý ß 9Ó 9ç J× JÝ ß !Ý )Ý ß DÝ %Ý .Ý 1Ý .Ý +Ý CæÝ&å3áˆT˜Ñ!€Ø
×
Ò
˜HÓ
%€ô&$�Dô &$ðR€ðÐ ô\8�Wô \8ô~
�xô 
÷ñ ô<K<�
ô K<÷\><ñ ><ôBô*ð(&Øð&Ø*8ð&ØGNð&à	ô&òR'ôô Fð
%Øð
%à"ð
%ð ð
%ð ô	
%ô2ô#ð0 Øð Ø$2ð à$ô ô
ôô,ô(˜*×.Ñ.ô (ð"VÐ ðrVØ
ðVØ)ðVØ7KðVàôVôN˜×(Ñ(õ NrA   