Ë
    óÇ:j.ˆ  ã                  óR  — 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  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.m/Z/ ddl0m1Z1m2Z2 ddl3m3Z4 ddl5m5Z6 ddl7m7Z8 ddl9m9Z: ddl;m;Z< ddl=m=Z> erddl?m@Z@ ddlAmBZB  ede(¬«      ZC ejˆ                  eE«      ZF G d„ d e«      ZGd!ZHd"ZI G d#„ d$e"«      ZJ G d%„ d&e«      ZK G d'„ d(«      ZL G d)„ d*eL«      ZM G d+„ d,«      ZNd@d-„ZOdAd.„ZP	 	 	 	 	 	 	 	 dBd/„ZQd0„ ZRdCd1„ZSdCd2„ZT	 	 	 	 	 	 	 	 dDd3„ZUdEd4„ZVdFd5„ZW	 	 	 	 	 	 dGd6„ZXdHd7„ZYdId8„ZZdJd9„Z[ G d:„ d;e'j¸                  «      Z]d<Z^	 	 	 	 	 	 	 	 dKd=„Z_ G d>„ d?e&jÀ                  «      Zay)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                  ó.   — 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      úv/home/mcse/projects/srt_converter/srt-converter-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__ÚSTRICTr5   r3   Ú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dZdZdddd eej                  xs d«      fgZ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Ú c                ó<   — d | _         d | _        d | _        d | _        y ©N)Údist_dirÚdist_info_dirÚproject_dirr;   ©Úselfs    r=   Úinitialize_optionsz!editable_wheel.initialize_optionsv   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ÚcurdirrR   Úpackage_dirr   rP   ÚpathÚjoin)rT   rW   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)rP   ÚmkdirÚ_ensure_dist_infoÚreinitialize_commandÚget_finalized_commandÚwrite_wheelfilerQ   Ú_create_wheel_fileÚ	ExceptionrX   ÚnameÚget_namer   Úadd_note)rT   rb   Ú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)rQ   r   Údist_info_clsre   rP   Ú
output_dirÚensure_finalizedro   ÚstrÚendswithr   Úexists)rT   r$   s     r=   rd   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 )NrM   ú.)	rX   Únamespace_packagesr   rR   r\   ÚgetÚresolveÚ_NamespaceInstallerÚinstall_namespaces)rT   Úinstallation_dirÚ
pth_prefixrW   rY   Ú	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)rQ   r   ÚparentÚmapru   ÚglobÚnext)rT   Ú
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)rX   ru   r   r   Úegg_info_clsre   Ú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_modert   )rT   rj   Úunpacked_wheelr™   Útmp_dirrW   Ú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)rX   rŸ   Úget_sub_commandsÚhasattrr­   r®   )rT   rW   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)rf   r¯   r°   Úextendr´   Úupdaterµ   )rT   Ú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)rT   Ú	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)rf   r¯   Útyper¤   Ú_safely_runÚrun_command)rT   r"   rj   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Ã   ri   r    r9   Ú	tracebackÚ
format_exc)rT   r±   s     r=   rÂ   zeditable_wheel._safely_run.  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*   rf   rj   r^   Úget_tagr   rP   rw   Úunlinkr   rQ   ÚshutilÚcopytreer‚   r¿   Ú_select_strategyÚwrite_files)rT   rb   r*   r$   r¾   ÚtagÚ	build_tagÚarchive_nameÚ
wheel_pathr¨   r™   Ú	build_tmpÚunpackedÚlibÚtmpÚunpacked_dist_infor¸   r¹   ÚstrategyÚ	wheel_objs                       r=   rh   z!editable_wheel._create_wheel_fileJ  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_)ÚgetattrrX   Ú_loggerÚinforÃ   )rT   ÚcategoryÚhas_categorys      r=   r½   zeditable_wheel._run_installf  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"   rM   ry   )r   rR   r.   r>   r;   rF   Ú
_empty_dirÚ	_LinkTreerX   Ú_find_packagesÚ_simple_layoutr\   r3   Úsetr{   Ú
_StaticPthÚ_TopLevelFinder)rT   rj   rÒ   r™   Ú
build_namerR   r;   Úauxiliary_dirÚpackagesÚhas_simple_layoutÚis_compat_modeÚsrc_dirs               r=   rÐ   zeditable_wheel._select_strategyl  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?   ©rA   ÚNone)rA   r@   )rj   ru   r¨   r   r™   r   r©   r   )rA   ú tuple[list[str], dict[str, str]])
r¾   ru   r¨   r   r™   r   r©   r   rA   rö   )r±   ru   )rã   ru   )rj   ru   rÒ   ru   r™   r   rA   ÚEditableStrategy)rB   rC   rD   rE   Údescriptionr	   r.   Úuser_optionsrU   r_   ro   rd   r‚   rŠ   r«   r§   rº   r¿   r¼   rÂ   rh   r½   rÐ   rH   r?   r=   rJ   rJ   h   sý   „ ñð
 W€Kð 	LØKØ	�$™ ×!6Ñ!6Ò!<¸"Ó=Ð>ð€LòóVóò*	Aò'ó&ð
=#Øð=#Ø)0ð=#Ø=Dð=#ØOVó=#ò~	#óðàðð  ðð ð	ð
 ðð 
*óó'ó,ò8ó84ð8àð8ð ð8ð ð	8ð
 
ô8r?   rJ   c                  óD   — e Zd Z	 	 	 	 	 	 	 	 dd„Zdd„Z	 	 	 	 	 	 	 	 dd„Zy)r÷   c                 ó   — y rO   rH   )rT   rª   r¸   r¹   s       r=   Ú__call__zEditableStrategy.__call__ˆ  s   € àr?   c                 ó   — y rO   rH   rS   s    r=   Ú	__enter__zEditableStrategy.__enter__‹  s   � r?   c                 ó   — y rO   rH   ©rT   Ú	_exc_typeÚ
_exc_valueÚ
_tracebacks       r=   Ú__exit__zEditableStrategy.__exit__Œ  s   € ð
 r?   N)rª   r*   r¸   ú	list[str]r¹   úMapping[str, str]rA   Úobject©rA   r(   )r  ztype[BaseException] | Noner  zBaseException | Noner  zTracebackType | NonerA   r  )rB   rC   rD   rü   rþ   r  rH   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 rO   )rW   rj   Úpath_entries)rT   rW   rj   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rO   )ru   r|   )Ú.0Úps     r=   ú	<genexpr>z&_StaticPth.__call__.<locals>.<genexpr>�  s   è ø€ ÒH°œC §	¡	£×,ÑHùs   ‚#%ræ   ú.pth)r^   r  Ú_encode_pthÚwritestrrj   )rT   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…   rZ   Úfspathr  rá   ÚwarningÚ_LENIENT_WARNING©rT   Úmsgs     r=   rþ   z_StaticPth.__enter__¡  sH   € ð	ä	Œc”"—)‘)˜T×.Ñ.Ó/Ó	0Ð3ð 4	ðˆô 	�‰˜Ô.Ñ.Ô/Øˆr?   c                 ó   — y rO   rH   r   s       r=   r  z_StaticPth.__exit__©  s   € ð 	r?   N)rW   r   rj   ru   r  z
list[Path]rA   rõ   ©rª   r*   r¸   r  r¹   r  rA   rõ   r  ©r  r  r  r  r  r  rA   rõ   )rB   rC   rD   r  rü   rþ   r  rH   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  )rT   rW   rj   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 rO   )Ú_create_linksr&  rü   )rT   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™   ru   ÚreplacerZ   Úsep)rT   Ú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_dirrc   r%  )rT   Úrelative_outputÚsrc_filer5  Ú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)r3  ra   ÚsymÚhardc              3  óJ   •K  — | ]  \  }}‰j                  |«      |f–— Œ y ­wrO   )r1  )r  ÚkÚvrT   s      €r=   r  z*_LinkTree._create_links.<locals>.<genexpr>ß  s%   øè ø€ ÒX¹¸¸A�t×-Ñ-¨aÓ0°!Ô4ÑXùs   ƒ #r4  )rï   rc   Ú_can_symlink_filesÚitemsr1  r:  )rT   ÚoutputsÚoutput_mappingÚ	link_typeÚ
normalisedr?  r@  Ú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   r9   ©rT   r  r  r  r  s        r=   r  z_LinkTree.__exit__ð  s2   € ðà×ÑÐ ð !	ðˆô 	×ÑÐ5°sÕ;r?   )
rW   r   rj   ru   rï   r   r™   r   rA   rõ   r   )r0  ru   rA   r@   rO   )r7  ru   r8  ru   )rD  r  r  r!  )rB   rC   rD   rE   r  rü   r1  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 rO   )rW   rj   )rT   rW   rj   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rO   rH   )r  Únss     r=   r  z0_TopLevelFinder.template_vars.<locals>.<genexpr>  s   è ø€ ÒD˜b�"�b”ÑDùs   ‚rM   ræ   z.finder)rW   rY   rZ   r[   r
   ré   Ú_find_top_level_modulesr\   Ú_find_package_rootsÚdictÚ_find_namespacesrð   Ú_find_virtual_namespacesrz   r   rj   r   Úsafe_identifier)rT   rY   Ú	top_levelr\   ÚrootsÚnamespaces_ÚpkgÚlegacy_namespacesr¹   rj   Ú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  )rb  ÚbytesÚ_finder_templater  rj   )rT   ra  rj   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 rO   )rh  r  )rT   rª   r¸   r¹   r0  rg  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__/  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.
        rN  )r   r9   rO  s        r=   r  z_TopLevelFinder.__exit__4  s   € ðˆô 	×ÑÐ5°sÕ;r?   N)rW   r   rj   ru   rA   rõ   )rA   z5tuple[str, str, dict[str, str], dict[str, list[str]]])rA   zIterator[tuple[str, bytes]]r   r  r!  )	rB   rC   rD   r  rb  rh  rü   rþ   r  rH   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)rg  ÚbufferÚwrappers      r=   r  r  A  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Úfile1rd  rm  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   ru   r|   r   Ú
write_textr   ÚAttributeErrorÚNotImplementedErrorÚOSErrorrZ   ÚsymlinkÚ
is_symlinkÚ	read_textr5  ri   ÚLinksNotSupported)Úbase_dirrÙ   Úpath1Úpath2rm   r  s         r=   rA  rA  V  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
    rM   c           	   3  ó‚   •K  — | ]6  \  }}t        j                  t        ‰g|j                  d «      ¢­Ž |«      –— Œ8 y­w©ry   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ë   rZ   r]   Ú
commonpathr   Ú_parent_pathrB  Úall)rð   r\   rR   r_  Úlayoutr„   s        @r=   rê   rê   j  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ÚrstriprZ   r/  )r_  Ú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)Nry   )Úiterrð   Ú
py_modulesÚext_packageÚext_modulesrj   Ú
rpartition)	rW   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‰  rH   )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‰  )rj   )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š  )rW   r˜  rš  s      r=   rV  rV  ±  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 rO   )ÚsortedÚ_absolute_rootr   Ú_remove_nested)rð   r\   rY   r_  Ú	pkg_rootss        r=   rW  rW  º  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„   rw   ru   r|   rj   )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.
    ry   r!   r   éÿÿÿÿNrM   )r‹  ÚrangeÚlenr^   r   r   rw   )r©  r_  ÚpartsÚiÚpartial_namer]   s         r=   rZ  rZ  Ò  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)NrM   z__init__.py)r   r   rw   )rð   r©  r_  r]   s       r=   rY  rY  ê  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rO   )Ú
_is_nested)r  ÚotherÚ
other_pathr]   r_  s      €€r=   r  z!_remove_nested.<locals>.<genexpr>÷  s4   øè ø€ ò 
á!��zð �5‰LÒEœZ¨¨T°5¸*ÓEÓEñ
ùs   ƒ"%)rX  ÚcopyÚreversedr  rB  ÚanyÚpop)r©  rH  r]   r_  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
    rM   r!   ry   )r   Únormpathr.  Ú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ñ 'ð r?   c                ó^   — t        j                  | d¬«       t        j                  | «       | S )zFCreate a directory ensured to be empty. Existing files may be removed.T)Úignore_errors)r   ÚrmtreerZ   Ú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 rO   )rX   rY   r   Úeditable_namerC  )rT   rX   r   rË  rY   s        r=   r  z_NamespaceInstaller.__init__  s(   € Ø(ˆÔØ ˆŒØ 0ˆÔØ*ˆÔØ"$ˆ�r?   c                ó„   — t         j                  j                  | j                  | j                  | j
                  z   «      S )zInstallation target.)rZ   r]   r^   r   rË  Ú	nspkg_extrS   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.)Úreprru   rY   rS   s    r=   Ú	_get_rootz_NamespaceInstaller._get_root)  s   € ä”C˜Ÿ™Ó&Ó'Ð'r?   Nrô   )rB   rC   rD   r  rÎ  rÑ  rH   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Œ  ©rj   r¹   r   )rX  r¦  rB  ÚoperatorÚ
itemgetterÚ_FINDER_TEMPLATEÚformatrÓ  s      r=   rf  rf  ‡  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)rB   rC   rD   rE   rH   r?   r=   rƒ  rƒ  ‘  s   „ ÚMr?   rƒ  )rg  ru   rA   re  )r„  r   rA   Úbool)rð   úIterable[str]r\   údict[str, str]rR   r   rA   rÙ  )rW   r   rA   úIterator[str])rð   rÚ  r\   r  rY   r   rA   rÛ  )r]   r   rA   ru   )r©  rÛ  rA   rÜ  )rð   r  r©  rÛ  rA   zIterator[tuple[str, list[str]]])r©  rÛ  rA   rÛ  )
r_  ru   r•  ru   r„   ru   rÁ  ru   rA   rÙ  )rÈ  r+   rA   r+   )rj   ru   r¹   r  r   zdict[str, list[str]]rA   ru   )brE   Ú
__future__r   ro  ÚloggingrÔ  rZ   rÎ   rÅ   Úcollections.abcr   r   r   Ú
contextlibr   Úenumr   Úinspectr	   Ú	itertoolsr
   r   Úpathlibr   Útempfiler   Útypesr   Útypingr   r   r   r   rM   r   r   r   r   r   r   r   r1   r   r   Ú	discoveryr   rW   r   Úwarningsr   r    r"   r•   r#   r¤   r$   rr   r%   r’   r&   r–   r'   r¡   Útyping_extensionsr(   Ú_vendor.wheel.wheelfiler*   r+   Ú	getLoggerrB   rá   r.   rL  r  rJ   r÷   rì   rè   rí   r  rA  rê   r�  ré   rV  rW  r§  rZ  rY  r¨  r¶  rç   Ú	Installerr}   rÖ  rf  Ú	FileErrorrƒ  rH   r?   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r?   