Ë ßÖ¢§>yã óð—dZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZmZddlmZddlmZdd lmZmZmZmZmZmZmZmZmZmZmZd d l m!Z!m"Z"m#Z#m$Z$m%Z%d d l&m'Z'd d l(m)Z)d dl*m+Z+m,Z,m-Z-ddl.m.Z/erddl0m1Z1ee2efZ3ede3¬«Z4ejje6«Z7Gd„de «Z8dZ9dZ:Gd„de!«Z;Gd„de«Z<Gd„d«Z=Gd„de=«Z>Gd „d!«Z?d"e2d#e@fd$„ZAd%ed#eBfd&„ZCd'ee2d(ee2e2fd)ed#eBfd*„ZDd+„ZEd,e)d#ee2fd-„ZFd,e)d#ee2fd.„ZGd'ee2d(ee2e2fd/e3d#ee2e2ffd0„ZHd1e3d#e2fd2„ZId3ee2e2fd#ee2fd4„ZJd'ee2d3ee2e2fd#eee2ee2ffd5„ZKd3ee2e2fd#ee2e2ffd6„ZLd7e2d8e2d9e2d:e2d#eBf d;„ZMd„d?e%jž«ZPd@ZQdAe2dBee2e2fdCee2ee2fd#e2fdD„ZRGdE„dFe$j¦«ZTGdG„dHe-«ZUy)Iaè 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``. éN)Úsuppress)ÚEnum)Úcleandoc)ÚchainÚstarmap)ÚPath)ÚTemporaryDirectory) Ú TYPE_CHECKINGÚDictÚIterableÚIteratorÚListÚMappingÚOptionalÚProtocolÚTupleÚTypeVarÚUnioné)ÚCommandÚ_normalizationÚ_pathÚerrorsÚ namespaces)Úfind_package_path)Ú Distribution)ÚInformationOnlyÚSetuptoolsDeprecationWarningÚSetuptoolsWarningé)Úbuild_py©Ú WheelFileÚ_P)Úboundcó<—eZdZdZdZdZdZedee ddfd„«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ÚcompatÚmodeÚreturncóè—|stjS|j«}|tjvrt j d|›d�«‚|dk(rt jddd¬«t|S)NzInvalid editable mode: z. Try: 'strict'.ÚCOMPATzCompat 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. úuserguide/development_mode.html)Úsee_docs)r'ÚLENIENTÚupperÚ __members__rÚ OptionErrorrÚemit)Úclsr+Ú_modes úF/usr/lib/python3.12/site-packages/setuptools/command/editable_wheel.pyÚconvertz_EditableMode.convertKsv€áÜ ×(Ñ(Ð (à— ‘ “ ˆØ œ ×1Ñ1Ñ 1Ü×$Ñ$Ð'>¸t¸hÐFVÐ%WÓXÐ Xà �HÒ Ü (× -Ñ -Ø*ðð ;õ ô ˜UÑ#Ð#óN) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚSTRICTr1r.Ú classmethodrÚstrr9©r:r8r'r'?s<„ñð€FØ€GØ €Fàð$˜8 C™=ð$¨_ò$óñ$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ó2—eZdZdZdZddddeejxsd«fgZd„Zd „Z d „Z d „Z d „Z d e efd„Zdedededefd„Zd„Zd eeeeeefffd„Zdedededed eeeeeefff d„Zd„Zdefd„Zd„Zdefd„Zdededed dfd „Zy)!Ú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)zdist-info-dir=ÚIz(path to a pre-build .dist-info directoryzmode=NÚcó<—d|_d|_d|_d|_y©N)Údist_dirÚ dist_info_dirÚ project_dirr+©Úselfs r8Úinitialize_optionsz!editable_wheel.initialize_options€s €ØˆŒ Ø!ˆÔØˆÔØˆ� r:có—|j}|jxstj|_|j xsi|_t |jxs*tjj|jd««|_y)NÚdist) Ú distributionÚsrc_rootÚosÚcurdirrLÚ package_dirrrJÚpathÚjoin)rNrQs r8Úfinalize_optionszeditable_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óΗ |jjd¬«|j«|jd«|j d«}|j |j «|j|«y#t$r^tj«|jjxs|jj«}tj|¬«‚wxYw)NT)Úexist_okÚ bdist_wheel)Úproject)rJÚmkdirÚ_ensure_dist_infoÚreinitialize_commandÚget_finalized_commandÚwrite_wheelfilerKÚ_create_wheel_fileÚ ExceptionÚ tracebackÚ print_excrRÚnameÚget_nameÚ_DebuggingTipsr5)rNr\r]s r8Úrunzeditable_wheel.runŒs¾€ð Ø �M‰M× Ñ ¨Ð Ô .Ø × "Ñ "Ô $ð × %Ñ % mÔ 4Ø×4Ñ4°]ÓCˆKØ × 'Ñ '¨×(:Ñ(:Ô ;à × #Ñ # KÕ 0øÜò Ü × Ñ Ô !Ø×'Ñ'×,Ñ,ÒL°×0AÑ0A×0JÑ0JÓ0LˆGÜ × Ñ ¨Ð Ô 0Ø ð  ús ‚A:A=Á=A'C$có\—|j€T|jd«}|j|_|j «|j «|j|_yt |j«jd«sJ‚t|jd«j«sJ‚y)NÚ dist_infoz .dist-infoÚMETADATA) rKr`rJÚ output_dirÚensure_finalizedrjrAÚendswithrÚexists)rNrls r8r_z editable_wheel._ensure_dist_info�s‹€Ø × Ñ Ð %Ø×1Ñ1°+Ó>ˆIØ#'§=¡=ˆIÔ Ø × &Ñ &Ô (Ø �M‰MŒOØ!*×!8Ñ!8ˆDÕ ä�t×)Ñ)Ó*×3Ñ3°LÔAÐ AÐAܘ×*Ñ*¨JÓ7×>Ñ>Ô@Ð @Ñ@r:cóî—|j}|jsyt|j|jj dd««j «}t||||«}|j«y)NrGÚ.) rRÚnamespace_packagesrrLrVÚgetÚresolveÚ_NamespaceInstallerÚinstall_namespaces)rNÚinstallation_dirÚ pth_prefixrQrSÚ installers r8Ú_install_namespacesz"editable_wheel._install_namespaces¨sd€à× Ñ ˆØ×&Ò&Ø ä˜×(Ñ(¨$×*:Ñ*:×*>Ñ*>¸rÀ3Ó*GÓH×PÑPÓRˆÜ'¨Ð.>À ÈHÓUˆ Ø×$Ñ$Õ&r:r,có—|jrt|j«jn t«}tt|j d««}t |d«S)Nz *.egg-info)rKrÚparentÚmaprAÚglobÚnext)rNÚ parent_dirÚ candidatess r8Ú_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:rgÚunpacked_wheelÚ build_libÚtmp_dircó—|j}t|«}t|«}tt||›d�d««}tt||›d�d««}tt||›d�d««} |jdd¬«} t|«| _d| _|jdd¬«} |jd d¬«} |x| _x| _| _|x| _ x| _ | _ | x| _ | _ || _|| _|j!d «} d| _t|«| _|j!d «}d |_|j)«|_|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ÚscriptsÚegg_infoT)Úreinit_subcommandsÚbuildÚinstallÚinstall_scriptsr!FN)rRrArr`Úegg_baseÚignore_egg_info_in_manifestÚ build_platlibÚ build_purelibr†Úinstall_purelibÚinstall_platlibÚ install_libr�Ú build_scriptsÚinstall_headersÚ install_dataÚget_command_objÚno_epÚ build_tempÚcompiler„Úexisting_egg_info_dirÚ_set_editable_modero)rNrgr…r†r‡rQÚwheelr‰rŠr‹rŒrŽr�r�r!s r8Ú_configure_buildzeditable_wheel._configure_build·sƒ€ð× Ñ ˆÜ�NÓ#ˆÜ˜ “Nˆ Ü”4˜¨4¨&°¨¸Ó?Ó@ˆÜ”d˜>¨d¨V°5¨>¸9ÓEÓFˆÜ”d˜>¨d¨V°5¨>¸9ÓEÓFˆð×,Ñ,¨ZÈDÐ,ÓQˆÜ ›LˆÔØ/3ˆÔ,à×)Ñ)¨'ÀdÐ)ÓKˆØ×+Ñ+¨IÈ$Ð+ÓOˆàFOÐOˆÔÐO˜eÔ1°E´OØRWÐWˆÔÐW 'Ô"9¸GÔ—g}i}|jd«}|j«D]r}|j|«}t|d«r#|j|j «xsg«t|d«sŒP|j |j «xsi«Œt||fS)NrŽÚ get_outputsÚget_output_mapping)rar¦r§Úextendr«Úupdater¬)rNÚfilesÚmappingrŽr¨r©s r8Ú_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Õ>ð 1ð�gˆ~Ðr:Ú dist_namecóÞ—|j||||«|j«|j«\}}|jd«|jd«|jd«||fS)NrŠr‹r‰)r¢Ú_run_build_subcommandsr±Ú _run_install)rNr²r…r†r‡r¯r°s r8Ú_run_build_commandsz"editable_wheel._run_build_commandssj€ð ×јi¨¸ÀGÔLØ ×#Ñ#Ô%Ø×4Ñ4Ó6‰ˆˆwØ ×ј)Ô$Ø ×ј)Ô$Ø ×ј&Ô!Ø�gˆ~Ðr:cóæ—|jd«}|j«D]M}|j|«}|dk(r$t|«tk7r|j |«Œ=|j |«ŒOy)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)rar¦ÚtypeÚ build_py_clsÚ _safely_runÚ run_command)rNrŽrgr©s r8r´z%editable_wheel._run_build_subcommands sf€ð×3Ñ3°GÓ<ˆØ×*Ñ*Ö,ˆDØ×,Ñ,¨TÓ2ˆCØ�zÒ!¤d¨3£i´<Ò&?Ø× Ñ  Õ&à× Ñ  Õ&ñ -r:r¨c ó¨— |j|«S#t$r5tjddt j «›d|›d|›d�«YywxYw)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 `ab` 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 behaviour will change in future versions. )r»rdrr5reÚ format_exc)rNr¨s r8rºzeditable_wheel._safely_run#sp€ð Ø×#Ñ# HÓ-Ð -øÜò Ü (× -Ñ -ØBðÜ×%Ñ%Ó'Ð(ð)8ð9A°zðB-ð .6¨Jð7ðö ð ús‚“;AÁAc óŽ—ddlm}|jd«}|j}dj |j ««}d}|›d|›d|›d�}t |j|«}|j«r|j«t|¬«} td¬«} td ¬«} | 5} | 5} | 5}t | t |j«j«}tj|j|«|j| |«|j|| | |«\}}|j!||| «}|5||d «5}||||«|j#| «ddd«ddd«ddd«ddd«ddd«|S#1swYŒ+xYw#1swYŒ/xYw#1swYŒ3xYw#1swYŒ7xYw#1swY|SxYw) Nrr"rlÚ-z 0.editablez.whl)Úsuffixz .build-libz .build-tempÚw)Úwheel.wheelfiler#rargrXÚget_tagrrJrqÚunlinkr rKÚshutilÚcopytreer|r¶Ú_select_strategyÚ write_files)rNr\r#rlr²ÚtagÚ build_tagÚ archive_nameÚ wheel_pathr…r†Ú build_tmpÚunpackedÚlibÚtmpÚunpacked_dist_infor¯r°ÚstrategyÚ wheel_objs r8rcz!editable_wheel._create_wheel_file?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¨yÔ 9Ø!×5Ñ5°iÀÈ3ÐPSÓT‰NˆE�7Ø×,Ñ,¨Y¸¸SÓAˆHÚ™9 Z°Ô5¸Ù˜ E¨7Ô3Ø×%Ñ% hÔ/÷6—÷ |jjdd«} t|j|t|| «g«St!|j|«S)zDDecides which strategy to use to implement an editable installation.ú __editable__.r¿rŽrGrs)rrLr'r9r+r?Ú _empty_dirÚ _LinkTreerRÚ_find_packagesÚ_simple_layoutrVr.ÚsetruÚ _StaticPthÚ_TopLevelFinder) rNrgrÉr†Ú build_namerLr+Ú auxiliary_dirÚpackagesÚhas_simple_layoutÚis_compat_modeÚsrc_dirs r8rÇzeditable_wheel._select_strategyas€ð% 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:)r;r<r=r>Ú descriptionrr'Ú user_optionsrOrYrjr_r|rrAr„Ú_Pathr¢r rrr r±r¶r´rºrcrµrÇrBr:r8rDrDrsA„ñð W€Kð LØKØ �$™ ×!6Ñ!6Ò!<¸"Ó=Ð>ð€Lò ò Vò ò" Aò'ð& H¨S¡Mó&ð 0#Øð0#Ø).ð0#Ø;@ð0#ØKPó0#òd #𠨨d°3©i¸¸cÀ3¸h¹Ð.GÑ(Hó ð Øð Ø.3ð Ø@Eð ØPUð à ˆt�C‰y˜$˜s C˜x™.Ð(Ñ )ó ò'ð, Cóò8ð84 Só4ð 8àð8ðð8ðð 8ð ô 8r:rDcó<—eZdZdddeedeeeffd„Zd„Zd„Zy) rÜr¡r#r¯r°có—yrIrB)rNr¡r¯r°s r8Ú__call__zEditableStrategy.__call__}s€à r:có—yrIrBrMs r8Ú __enter__zEditableStrategy.__enter__�s€˜r:có—yrIrB©rNÚ _exc_typeÚ _exc_valueÚ _tracebacks r8Ú__exit__zEditableStrategy.__exit__ƒó€¸3r:N) r;r<r=rrAr rñrórùrBr:r8rÜrÜ|s3„ð Ø ð Ø)-¨c©ð Ø=AÀ#ÀsÀ(¹^ó òã>r:rÜcóV—eZdZdededeefd„Zdddeedeeeffd „Z d „Z d „Z y ) rärQrgÚ path_entriescó.—||_||_||_yrI)rQrgrü)rNrQrgrüs r8Ú__init__z_StaticPth.__init__‡s€ØˆŒ ؈Œ Ø(ˆÕr:r¡r#r¯r°có¤—djd„|jD««}t|›d�«}|jd|j›d�|«y)NÚ c3óNK—|]}t|j««–—Œy­wrI)rArv)Ú.0Úps r8Ú z&_StaticPth.__call__..�sèø€ÐHÑ6G°œC § ¡ £ ×,Ñ6Gùs‚#%rÞú.pth)rXrüÚ _encode_pthÚwritestrrg)rNr¡r¯r°ÚentriesÚcontentss r8rñz_StaticPth.__call__ŒsG€Ø—)‘)ÑH°d×6GÒ6GÓHÓHˆÜ ' ¨"˜~Ó.ˆØ �‰˜ t§y¡y k°Ð6¸ÕAr:có —dtttj|j««›d�}t j |tz«|S)Nz_ Editable install will be performed using .pth file to extend `sys.path` with: z )ÚlistrrTÚfspathrürÙÚwarningÚ_LENIENT_WARNING©rNÚmsgs r8róz_StaticPth.__enter__‘sH€ð ä Œc”"—)‘)˜T×.Ñ.Ó/Ó 0Ð3ð4 ð ˆô �‰˜Ô.Ñ.Ô/؈ r:có—yrIrBrõs r8rùz_StaticPth.__exit__™rúr:N) r;r<r=rrArrrþr rñrórùrBr:r8rärä†sU„ð)˜\ð)°ð)ÀDÈÁJó)ð B˜kðB°$°s±)ðBÀdÈ3ÐPSÈ8ÁnóBò ó?r:räcó–‡—eZdZdZdedededefˆfd„ Zddd eed e eeffˆfd „ Z d ed e efd„Z ddedefd„Z d„Zd„Zd„ZˆxZS)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. rQrgrçr†cóÚ•—t|«|_t|«j«|_|j d«j |_t‰|�!|||jg«y)Nr!) rrçrvr†r›Ú copy_fileÚ_fileÚsuperrþ)rNrQrgrçr†Ú __class__s €r8rþz_LinkTree.__init__§sXø€ô" -Ó0ˆÔܘi›×0Ñ0Ó2ˆŒØ×)Ñ)¨*Ó5×?Ñ?ˆŒ Ü ‰Ñ˜˜t d×&8Ñ&8Ð%9Õ:r:r¡r#r¯r°cóL•—|j||«t‰|� |||«yrI)Ú _create_linksrrñ)rNr¡r¯r°rs €r8rñz_LinkTree.__call__³s$ø€Ø ×ј5 'Ô*Ü ‰Ñ˜  wÕ/r:Úfiler,có—tt«5t|«j«j |j «}t |«jtjd«cddd«S#1swYyxYw)NÚ/) rÚ ValueErrorrrvÚ relative_tor†rAÚreplacerTÚsep)rNrrWs r8Ú_normalize_outputz_LinkTree._normalize_output·sT€ä ”jÕ !ܘ“:×%Ñ%Ó'×3Ñ3°D·N±NÓCˆDÜ�t“9×$Ñ$¤R§V¡V¨SÓ1÷"× !Ñ !ðús �AA5Á5A>Úrelative_outputÚsrc_filecó¶—|j|z }|jj«s|jjd¬«|j |||¬«y)NT)Úparents©Úlink)rçr~Úis_dirr^r)rNr"r#r'Údests r8Ú _create_filez_LinkTree._create_file¾sI€Ø×!Ñ! OÑ3ˆØ�{‰{×!Ñ!Ô#Ø �K‰K× Ñ  dÐ Ô +Ø � ‰ �8˜T¨ˆ Õ-r:cóÀ—|jjdd¬«t|j«rdnd}|j«D��cic]\}}|j |«|“Œ}}}|j dd«|D]-}|j |«}|sŒ||vsŒ|j ||«Œ/|j«D]\}} |j || |¬«Œycc}}w)NT)r%r[ÚsymÚhardr&)rçr^Ú_can_symlink_filesÚitemsr!Úpopr*) rNÚoutputsÚoutput_mappingÚ link_typeÚkÚvÚmappingsÚoutputÚrelativeÚsrcs r8rz_LinkTree._create_linksÄsÖ€Ø ×Ñ× Ñ ¨¸Ð Ô=Ü/°×0BÑ0BÔC‘EȈ Ø=K×=QÑ=QÔ=SÔTÑ=S±T°Q¸�D×*Ñ*¨1Ó-¨qÑ0Ð=SˆÑTØ� ‰ �T˜4Ô ãˆFØ×-Ñ-¨fÓ5ˆHÚ˜H¨HÒ4Ø×!Ñ! (¨FÕ3ðð &Ÿ^™^Ö-‰MˆH�cØ × Ñ ˜h¨°)Ð Õ <ñ.ùóUsÁ CcóB—d}tj|tz«|S)Nz=Strict editable install will be performed using a link tree. )rÙr Ú_STRICT_WARNINGrs r8róz_LinkTree.__enter__Òs€ØNˆÜ�‰˜œoÑ-Ô.؈ r:cóP—d|j›d�}tjd|«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çrr5©rNrör÷rørs r8rùz_LinkTree.__exit__×s2€ð à × Ñ Ð ð! ð ˆô ×ÑÐ5°sÕ;r:rI)r;r<r=r>rrArîrþrr rñrr!r*rrórùÚ __classcell__)rs@r8ràràœs“ø„ñð ;àð ;ðð ;ðð ;ð õ ;ð0˜kð0°$°s±)ð0ÀdÈ3ÐPSÈ8Ánõ0ð cð¨h°s©móñ.¨Cð.¸3ó.ò =òö .ðsèø€ÐDÑ$C˜b�"�b”Ñ$Cùs‚rGrÞz.finderúutf-8z.pyzimport z; z .install()r)rQrSrTrUrráÚ_find_top_level_modulesrVÚ_find_package_rootsÚdictÚ_find_namespacesrèÚ_find_virtual_namespacesrtrrgrÚsafe_identifierÚbytesÚ_finder_templaterr)rNr¡r¯r°rSÚ top_levelrVÚrootsÚ namespaces_ÚpkgÚlegacy_namespacesrgÚfinderÚcontents r8rñz_TopLevelFinder.__call__çs€Ø—9‘9×%Ñ%Ò2¬¯©ˆÜœ.¨¯©Ó3Ô5LÈTÏYÉYÓ5WÓXˆ Ø—i‘i×+Ñ+Ò1¨rˆ Ü# I¨{¸HÓEˆä,0Ü Ü  §¡×!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¸ ÓDÀgÓNˆØ �‰˜&˜ �~ wÔ/ä ¨ x¨r°&°¸ÐDÓEˆØ �‰˜ t§y¡y k°Ð6¸Õ@ùò! sÃ%-FcóB—d}tj|tz«|S)Nz=Editable install will be performed using a meta path finder. )rÙr rrs r8róz_TopLevelFinder.__enter__s€ØNˆÜ�‰˜Ô.Ñ.Ô/؈ r:có4—d}tjd|«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. r=)rr5r>s r8rùz_TopLevelFinder.__exit__ s€ð ˆô ×ÑÐ5°sÕ;r:N) r;r<r=rrArþrr rñrórùrBr:r8råråâsJ„ð˜\ð°óðA˜kðA°$°s±)ðAÀdÈ3ÐPSÈ8ÁnóAò>ó >> _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 rGc 3ó‚•K—|]6\}}tjt‰g|jd«¢­Ž|«–—Œ8y­w©rsN)rÚ same_pathrÚsplit)rÚkeyÚvaluer~s €r8rz!_simple_layout..\s:øèø€ðá(‰JˆC�ô �‰œ˜VÐ5 c§i¡i°£nÒ5°u×=Ù(ùsƒPXÓ XÉxȈcÔ$ S¨+°{ÓCÑCÈx€FÐ XÙ Ü�;Ó B¨¨ :Ð-Ð-Ü �W‰W× Ñ ¤¬ °f·l±l³nÓ EÓ F€FÜ óà Ÿ,™,œ.óó ðùò Ys†B cóŠ—|j|«r|dt|« n|}|jdtjz«S)a7Infer 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' Nr)rpÚlenÚrstriprTr )rQÚpkg_pathr~s r8r~r~bs<€ð'/×&7Ñ&7¸Ô&<ˆX�kœ˜S›˜ Ñ "À(€FØ �=‰=˜œrŸv™v™Ó &Ð&r:rQc#óœK—t|jxsg«Ed{–—†|jxsg}|D�cgc] }d|vsŒ|‘Œ }}|jr|j–—n<|jxsg}||D�cgc]}d|j vsŒ|j ‘Œc}z }|D]}|j d«\}}}|–—Œy7Œ cc}wcc}w­w)Nrs)ÚiterrèÚ py_modulesÚ ext_packageÚ ext_modulesrgÚ rpartition) rQr‡ÚmodÚnested_modulesr‰ÚxÚmoduleÚpackageÚ_s r8rárápsÆèø€Ü�D—M‘MÒ' RÓ(×(Ð(à—‘Ò& B€JÙ%/Ó>¡Z˜c°3¸#²:’c Z€NÐ>Ø ×ÒØ×ÑÓà×&Ñ&Ò,¨"ˆ Ø©;ÓH©; a¸#ÀÇÁº-˜1Ÿ6›6¨;ÑHÑHˆã ˆØ×)Ñ)¨#Ó.‰ ˆ��AØ‹ ñ!ð)úò?ùò Iùs8‚C ŸC C ¸ CÁCÁ2C Á8C CÂ'C à C c#ó²K—|jxsg}d„|D«Ed{–—†|js"|jxsg}d„|D«Ed{–—†yy7Œ37Œ­w)Nc3ó*K—|] }d|vsŒ|–—Œ y­wrxrB)rr‹s r8rz*_find_top_level_modules..‚sèø€Ð<™z˜¨S¸ª^”™zùs‚ Œc3óRK—|]}d|jvsŒ|j–—Œ!y­wrx)rg)rr�s r8rz*_find_top_level_modules..†s èø€ÐE¡K˜q°3¸a¿f¹fÒ3D�A—F•F¡Kùs‚'–')r‡rˆr‰)rQr‡r‰s r8rFrF€sZèø€Ø—‘Ò& B€JÙ<™zÓ<×<Ð<à × Ò Ø×&Ñ&Ò,¨"ˆ ÙE¡KÓE×EÑEð ð=øð Fús!‚AŸA ,AÁ AÁ AÁArSc ó|—t|«D�cic]}|tt|||««“Œ}}t|«Scc}wrI)ÚsortedÚ_absolute_rootrÚ_remove_nested)rèrVrSrQÚ pkg_rootss r8rGrG‰sO€ô˜(Ô#ó!á#ˆCð Œ^Ô-¨c°;ÀÓIÓ JÑJØ#ðð!ô ˜)Ó $Ð$ùò !sŽ9rWcóΗt|«}|j}|j«rt|j ««St|j «|j z «S)z(Works for packages and top-level modules)rr~rqrArvrg)rWÚpath_r~s r8r–r––sI€ä �‹J€EØ �\‰\€Fà ‡|�|„~Ü�5—=‘=“?Ó#Ð#ä�6—>‘>Ó# e§j¡jÑ0Ó1Ð1r:r˜c #óK—|D]y}d|vrŒ|jd«}tt|«dz dd«D]E}dj|d|«}t t ||d««}|j «r||vsŒB|–—ŒGŒ{y­w)a8By 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. rsr réÿÿÿÿNrG)rzÚranger‚rXrrrq)r˜rQÚpartsÚiÚ partial_namerWs r8rJrJ¡s‚èø€óˆØ �c‰>Ø Ø— ‘ ˜#“ˆÜ”s˜5“z A‘~ q¨"Ö-ˆAØŸ8™8 E¨"¨1 IÓ.ˆLÜÔ)¨,¸ À2ÓFÓGˆDØ—;‘;”= L¸ Ò$Aà"Ó"ñ .ñ ùs ‚A6BÁ9 Bc#ó¬K—|D]K}t||d«}t|«j«sŒ*t|d«j«rŒE||gf–—ŒMy­w)NrGz __init__.py)rrrq)rèr˜rQrWs r8rIrI¹sNèø€óˆÜ   i°Ó4ˆÜ �‹:× Ñ Õ ¤t¨D°-Ó'@×'GÑ'GÕ'Iؘ˜�-Ó ñùs‚,A¯AÁ Acóú‡‡—t|j««}tt|j «««D]:\ŠŠt ˆˆfd„|j «D««sŒ*|j ‰«Œ<|S)Nc3óN•K—|]\}}‰|k7xrt‰‰||«–—Œy­wrI)Ú _is_nested)rÚotherÚ other_pathrWrQs €€r8rz!_remove_nested..Æs5øèø€ð á%6Ñ!��zð �5‰LÒ EœZ¨¨T°5¸*ÓEÓ EÙ%6ùsƒ"%)rHÚcopyÚreversedr r/Úanyr0)r˜r7rWrQs @@r8r—r—Âscù€Ü �)—.‘.Ó"Ó #€Fäœd 9§?¡?Ó#4Ó5Ö6‰ ˆˆTÜ ô à%.§_¡_Ô%6ó õ ð �J‰J�s�Oð 7ð €Mr:rQr„r~Ú parent_pathcóø—tj|«}|j|dd«jd«j d«}|j |«xr"|tjt |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 rGr rs)rÚnormpathrÚstriprzÚ startswithr)rQr„r~rªÚ norm_pkg_pathÚrests r8r¤r¤Ïso€ô—N‘N 8Ó,€MØ �;‰;�v˜r 1Ó %× +Ñ +¨CÓ 0× 6Ñ 6°sÓ ;€DØ �>‰>˜&Ó !ò  m´u·~±~Ü ˆ[Ð ˜4Ò ó8ñ'ðr:Údir_có^—tj|d¬«tj|«|S)zFCreate a directory ensured to be empty. Existing files may be removed.T)Ú ignore_errors)rÅÚrmtreerTÚmakedirs)r±s r8rßrßås!€ä ‡M�M�$ dÕ+܇K�K�ÔØ €Kr:có—eZdZd„Zd„Zd„Zy)rwcóX—||_||_||_||_g|_d|_y)NF)rRrSryÚ editable_namer1Údry_run)rNrRryr¸rSs r8rþz_NamespaceInstaller.__init__ís/€Ø(ˆÔØ ˆŒ Ø 0ˆÔØ*ˆÔ؈Œ ؈� r:có„—tjj|j|j|j z«S)zInstallation target.)rTrWrXryr¸Ú nspkg_extrMs r8Ú_get_nspkg_filez#_NamespaceInstaller._get_nspkg_fileõs,€ä�w‰w�|‰|˜D×1Ñ1°4×3EÑ3EÈÏÉÑ3VÓWÐWr:có>—tt|j««S)z1Where the modules/packages should be loaded from.)ÚreprrArSrMs r8Ú _get_rootz_NamespaceInstaller._get_rootùs€ä”C˜Ÿ ™ Ó&Ó'Ð'r:N)r;r<r=rþr¼r¿rBr:r8rwrwìs„òòXó(r:rwa 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 = {mapping!r} NAMESPACES = {namespaces!r} PATH_PLACEHOLDER = {name!r} + ".__path_hook__" class _EditableFinder: # MetaPathFinder @classmethod def find_spec(cls, fullname, path=None, target=None): extra_path = [] # 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], *extra_path]) # Other levels of nesting should be handled automatically by importlib # using the parent path. return None @classmethod def _find_spec(cls, fullname, candidate_path): 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) class _EditableNamespaceFinder: # PathEntryFinder @classmethod def _path_hook(cls, path): if path == PATH_PLACEHOLDER: return cls raise ImportError @classmethod def _paths(cls, fullname): # Ensure __path__ is not empty for the spec to be considered a namespace. return NAMESPACES[fullname] or MAPPING.get(fullname) or [PATH_PLACEHOLDER] @classmethod def find_spec(cls, fullname, target=None): 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): 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 rgr°rcó|—tt|j«d„¬««}tj |||¬«S)z_Create a string containing the code for the``MetaPathFinder`` and ``PathEntryFinder``. có —|dS)NrrB)rs r8Úz"_finder_template..Ws€¸¸1ºr:)r{©rgr°r)rHr•r/Ú_FINDER_TEMPLATEÚformatrÃs r8rMrMQs3€ô ”6˜'Ÿ-™-›/©~Ô>Ó?€GÜ × "Ñ "¨°gÈ*Ð "Ó UÐUr:có—eZdZdZy)rrzCFile system does not seem to support either symlinks or hard links.N)r;r<r=r>rBr:r8rrrr[s„ÚMr:rrcó—eZdZdZdZdZy)riz!Problem in editable installation.a  An error happened while installing `{project}` in editable mode. The following steps are recommended to help debug this problem: - Try to install the project normally, without using the editable mode. Does the error still persist? (If it does, try fixing the problem before attempting the editable mode). - If you are using binary extensions, make sure you have all OS-level dependencies installed (e.g. compilers, toolchains, binary libraries, ...). - Try the latest version of setuptools (maybe the error was already fixed). - If you (or your project dependencies) are using any setuptools extension or customization, make sure they support the editable mode. After following the steps above, if the problem still persists and you think this is related to how setuptools handles editable installations, please submit a reproducible example (see https://stackoverflow.com/help/minimal-reproducible-example) to: https://github.com/pypa/setuptools/issues r/N)r;r<r=Ú_SUMMARYÚ_DETAILSÚ _SEE_DOCSrBr:r8riri_s„Ø2€Hð€Hð*2�Ir:ri)Vr>Úloggingr]rTrÅr[reÚ contextlibrÚenumrÚinspectrÚ itertoolsrrÚpathlibrÚtempfiler Útypingr r r r rrrrrrrrGrrrrrÚ discoveryrrQrÚwarningsrrrr!r¹rÂr#rArîr$Ú getLoggerr;rÙr'r;rrDrÜräràrårLrÚboolr.râr~rárFrGr–rJrIr—r¤rßÚ InstallerrwrÄrMÚ FileErrorrrrirBr:r8ÚrÙsðñ óÛ Û Û Û ÛÝÝÝß$ÝÝ'÷ ÷ ÷ ñ ÷õõ*Ý÷ñõ /áÝ)à ˆc�4ˆiÑ€Ù ˆT˜Ô€Ø ˆ'× Ñ ˜HÓ %€ô&$�Dô&$ðR€ðÐô G8�WôG8ôT?�xô?÷?ñ?ô,C<� ôC<÷L.<ñ.<ðb˜ð óð$ ð¨$óð(&Ø�s‰mð&Ø*.¨s°C¨x©.ð&ØGKð&à ó&òR 'ð ˜ð ¨(°3©-ó ð F ,ðF°8¸C±=óFð %Ø�s‰mð %à˜˜c˜Ñ"ð %ðð %ð ˆ#ˆsˆ(�^ó %ð2˜ð2 3ó2ð#¨¨S°#¨X©ð#¸8ÀC¹=ó#ð0 Ø�3‰ið Ø$(¨¨c¨¡Nð à ˆe�C˜˜c™�NÑ#Ñ$ó ð ˜d 3¨ 8™nð °°c¸3°h±ó ð�Cð 3ð°ðÀ#ðÈ$óð,�Rð˜Bóô(˜*×.Ñ.ô(ð$PÐðfVØ ðVØ  S Ñ)ðVØ7;¸CÀÀcÁ¸NÑ7KðVàóVôN˜×(Ñ(ôNô2Ð&õ2r: