efރ dZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZddlmZddlmZdd lmZmZmZmZmZmZmZmZmZmZd d lmZm 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-erddl.m/Z/ej0dkrddlm1Z1nerddl2m1Z1nddl3m4Z1ee5efZ6ede6Z7ej8e9Z:Gdde Z;dZGdde1Z?Gdd Z@Gd!d"e@ZAGd#d$ZBd%e5d&eCfd'ZDd(ed&eEfd)ZFd*ee5d+ee5e5fd,ed&eEfd-ZGd.ZHd/e'd&ee5fd0ZId/e'd&ee5fd1ZJd*ee5d+ee5e5fd2e6d&ee5e5ffd3ZKd4e6d&e5fd5ZLd6ee5e5fd&ee5fd7ZMd*ee5d6ee5e5fd&eee5ee5ffd8ZNd6ee5e5fd&ee5e5ffd9ZOd:e5d;e5dZPd?e7d&e7fd@ZQGdAdBe#jRZSdCZTdDe5dEee5e5fdFee5ee5fd&e5fdGZUGdHdIe"jVZWGdJdKe+ZXdS)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``. N)suppress)Enum)cleandoc)chain)Path)TemporaryDirectory) TYPE_CHECKINGDictIterableIteratorListMappingOptionalTupleTypeVarUnion)Command_normalization_patherrors namespacesfind_package_path) Distribution)InformationOnlySetuptoolsDeprecationWarningSetuptoolsWarning)build_py WheelFile))Protocol)ABC_P)boundcJeZdZdZdZdZdZedee ddfdZ dS) _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). strictlenientcompatmodereturnc|s tjS|}|tjvrt jd|d|dkrt jdddt|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*LENIENTupper __members__r OptionErrorremit)clsr._modes /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/command/editable_wheel.pyconvertz_EditableMode.convertQs ) ( (   1 1 1$%Wt%W%W%WXX X H   ( -* ;     U##N) __name__ __module__ __qualname____doc__STRICTr4r1 classmethodrstrr<r=r;r*r*Es_FG F$8C=$_$$$[$$$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. cVeZdZdZdZddddeejpdfgZdZd Z d Z d Z d Z d e efdZdedededefdZdZd eeeeeefffdZdedededed eeeeeefff dZdZdefdZdZdefdZdededed dfd ZdS)!editable_wheelzBuild '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=Nc>d|_d|_d|_d|_dSN)dist_dir dist_info_dir project_dirr.selfs r;initialize_optionsz!editable_wheel.initialize_optionss$ ! r=c|j}|jp tj|_|jpi|_t |jp$tj |jd|_dS)Ndist) distributionsrc_rootoscurdirrO package_dirrrMpathjoin)rQrTs r;finalize_optionszeditable_wheel.finalize_optionssX =5BI+1rT]Tbgll4;KV.T.TUU r=c |jd||d|d}||j||dS#t$rUtj |j j p|j }t|wxYw)NT)exist_ok bdist_wheel)project)rMmkdir_ensure_dist_inforeinitialize_commandget_finalized_commandwrite_wheelfilerN_create_wheel_file Exception traceback print_excrUnameget_name_DebuggingTipsr8)rQr_r`s r;runzeditable_wheel.runs  M    . . .  " " $ $ $  % %m 4 4 444]CCK  ' '(: ; ; ;  # #K 0 0 0 0 0      ! ! !',L0A0J0J0L0LG     0 0 0   s BB AC+cf|jW|d}|j|_|||j|_dSt |jdsJt|jd sJdS)N dist_infoz .dist-infoMETADATA) rNrcrM output_dirensure_finalizedrmrDendswithrexists)rQros r;rbz editable_wheel._ensure_dist_infos   %11+>>I#'=I  & & ( ( ( MMOOO!*!8D   t)**33LAA A AA*J77>>@@ @ @@ @ @r=c|j}|jsdSt|j|jdd}t||||}|dS)NrJ.) rUnamespace_packagesrrOrYgetresolve_NamespaceInstallerinstall_namespaces)rQinstallation_dir pth_prefixrTrV installers r;_install_namespacesz"editable_wheel._install_namespacessw &  F($*:*>*>r3*G*GHHPPRR'.> HUU $$&&&&&r=r/c|jrt|jjn t}tt|d}t |dS)Nz *.egg-info)rNrparentmaprDglobnext)rQ parent_dir candidatess r;_find_egg_info_dirz!editable_wheel._find_egg_info_dirsT8<8JVT$,--44PTPVPV jool;;<< J%%%r=rjunpacked_wheel build_libtmp_dirc|j}t|}t|}tt||dd}tt||dd}tt||dd} |dd} t|| _d| _|dd} |d d} |x| _x| _| _|x| _ x| _ | _ | x| _ | _ || _|| _|d } d| _t|| _|d }d |_||_|| | d S)aConfigure 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.datadataheadersscriptsegg_infoT)reinit_subcommandsbuildinstallinstall_scriptsr FN)rUrDrrcegg_baseignore_egg_info_in_manifest build_platlib build_purelibrinstall_purelibinstall_platlib install_libr build_scriptsinstall_headers install_dataget_command_objno_ep build_tempcompilerexisting_egg_info_dir_set_editable_moderr)rQrjrrrrTwheelrrrrrrrr s r;_configure_buildzeditable_wheel._configure_builds N## NN 44??@@d>d>>>9EEFFd>d>>>9EEFF,,ZD,QQLL/3,))'d)KK++I$+OOFOOOe1EORWWW'"9G>>g~r= dist_namec|||||||\}}|d|d|d||fS)Nrrr)r_run_build_subcommandsr _run_install)rQrrrrrrs r;_run_build_commandsz"editable_wheel._run_build_commandss iGLLL ##%%%4466w )$$$ )$$$ &!!!g~r=c|d}|D]`}||}|dkr.t|tkr||K||adS)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. rr N)rdrtype build_py_cls _safely_run run_command)rQrrjrs r;rz%editable_wheel._run_build_subcommandss33G<<**,, ' 'D,,T22Cz!!d3ii<&?&?  &&&&  &&&&  ' 'r=rc  ||S#t$r4tjddt jd|d|dYdSwxYw)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. )rrgrr8rh format_exc)rQrs r;rzeditable_wheel._safely_run)s ##H-- -    ( -B%''9A .6       s:AAc ddlm}|d}|j}d|}d}|d|d|d}t |j|}|r| t|} td} td } | 5} | 5} | 5}t | t |j j}tj |j ||| |||| | |\}}|||| }|5||d 5}|||||| dddn #1swxYwYdddn #1swxYwYdddn #1swxYwYdddn #1swxYwYdddn #1swxYwY|S) Nrr!ro-z 0.editablez.whl)suffixz .build-libz .build-tempw)wheel.wheelfiler"rdrjr[get_tagrrMrtunlinkrrNshutilcopytreerr_select_strategy write_files)rQr_r"rortag build_tag archive_name wheel_pathrr build_tmpunpackedlibtmpunpacked_dist_inforrstrategy wheel_objs r;rfz!editable_wheel._create_wheel_fileEsH------..{;; N hh{**,,-- #;;i;;#;;; $-66           +<@@@&l;;; &m<<<  0x 0c9 0!%hT5G0H0H0M!N!N  OD.0B C C C  $ $Xy 9 9 9!55i3PSTTNE7,,YSAAH 0 099Z55 0E7333%%h/// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0sG0 G B G F+ %#F  F+ FF+ FF+  G+F/ /G2F/ 3G6 GG G G G G0G G0 G !G00G47G4categoryct|jd|d}|rB|r:td|d|d|dSdSdS)Nhas_z Installing z as non editableinstall_)getattrrU_loggerinfor)rQr has_categorys r;rzeditable_wheel._run_installast02C2C2CTJJ  4LLNN 4 LLAxAAA B B B   222 3 3 3 3 3 4 4 4 4r=rEditableStrategyc\d|d|}t|j}t|j}|tjur:t t|jd|}t|j|||St|j}t||j |} |tj u} t|j dhkr| s| r@|j dd} t|j|t|| gSt!|j|S)zDDecides which strategy to use to implement an editable installation. __editable__.rrrJrv)rrOr*r<r.rB _empty_dir _LinkTreerU_find_packages_simple_layoutrYr1setrx _StaticPth_TopLevelFinder) rQrjrr build_namerOr. auxiliary_dirpackageshas_simple_layoutis_compat_modesrc_dirs r;rzeditable_wheel._select_strategygs#2T11C11 4+,, $$TY// =' ' '&tD, (. (&**2s33Gd/['8R8R7STT Tt0$777r=)r>r?r@rA descriptionrr* user_optionsrRr\rmrbrrrDr_Pathrrrr r rrrrrfrrrEr=r;rGrGxs WK LK $!6!<"==>L  VVV " A A A'''&HSM&&&& 0#0#).0#;@0#KP0#0#0#0#d # # # d3ic3h.G(H      .3 @E PU  tCy$sCx.( )    ''',C884S4444 888 8  888888r=rGcJeZdZdddeedeeeffdZdZdZdS) rrr"rrcdSrLrE)rQrrrs r;__call__zEditableStrategy.__call__ r=cdSrLrErPs r; __enter__zEditableStrategy.__enter__rr=cdSrLrErQ _exc_type _exc_value _tracebacks r;__exit__zEditableStrategy.__exit__rr=N) r>r?r@r rDr rrrrEr=r;rrsh k $s) d3PS8n            r=rcjeZdZdededeefdZdddeedeeeffd Z d Z d Z d S) rrTrj path_entriesc0||_||_||_dSrL)rTrjr)rQrTrjrs r;__init__z_StaticPth.__init__s  (r=rr"rrcdd|jD}t|d}|d|jd|dS)N c3XK|]%}t|V&dSrL)rDry).0ps r; z&_StaticPth.__call__..s2II!S--IIIIIIr=r.pth)r[r _encode_pthwritestrrj)rQrrrentriescontentss r;rz_StaticPth.__call__s`))IIt7HIIIJJ'~~~.. 6ty666AAAAAr=cdtttj|jd}t |tz|S)Nz_ Editable install will be performed using .pth file to extend `sys.path` with: z )listrrWfspathrrwarning_LENIENT_WARNINGrQmsgs r;rz_StaticPth.__enter__sQ c")T.// 0 0    ../// r=cdSrLrErs r;rz_StaticPth.__exit__rr=N) r>r?r@rrDr rrr rrrrEr=r;rrs)\))DJ)))) BkB$s)Bd3PS8nBBBB      r=rceZdZdZdedededeffd Zddd eed e eefffd Z d ed e efdZ ddedefdZ dZdZdZxZS)ra` 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. rTrjrrc t||_t||_|dj|_t|||jgdS)Nr ) rrryrr copy_file_filesuperr)rQrTrjrr __class__s r;rz_LinkTree.__init__sn"-00i0022))*55?  td&8%9:::::r=rr"rrcz|||t|||dSrL) _create_linksrr)rQrrrrs r;rz_LinkTree.__call__s; 5'*** w/////r=filer/c*tt5t||j}t |tj dcdddS#1swxYwYdS)N/) r ValueErrorrry relative_torrDreplacerWsep)rQrrZs r;_normalize_outputz_LinkTree._normalize_outputs j ! ! 2 2::%%''33DNCCDt99$$RVS11 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2tsA&BB B Nrelative_outputsrc_filec|j|z }|js|jd||||dS)NT)parentslink)rris_dirrar)rQr%r&r*dests r; _create_filez_LinkTree._create_files\!O3{!!## , K  d  + + + 8T -----r=cjddtjrdnd}fd|D}|dd|D]3}|}|r||vr||4|D]\}}|||dS)NT)r(r^symhardcBi|]\}}||SrE)r$)rkvrQs r; z+_LinkTree._create_links..s-TTTTQD**1--qTTTr=r))rra_can_symlink_filesitemspopr$r-)rQoutputsoutput_mapping link_typemappingsoutputrelativesrcs` r;rz_LinkTree._create_linkss    ===/0BCCOEE TTTT^=Q=Q=S=STTT T4    4 4F--f55H 4HH44!!(F333%^^-- = =MHc   h)  < < < < = =r=cNd}t|tz|S)Nz=Strict editable install will be performed using a link tree. )rr_STRICT_WARNINGrs r;rz_LinkTree.__enter__s#No-... r=cFd|jd}tjd|dS)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.)rrr8rQrrrrs r;rz_LinkTree.__exit__s:      5s;;;;;r=rL)r>r?r@rArrDrrr r rrr$r-rrr __classcell__)rs@r;rrs' ; ; ; ;  ; ; ; ; ; ;0k0$s)0d3PS8n000000chsm..C.3.... = = = <<<<<<.s&DDb"bDDDDDDr=cLi|] }|t|jjpd!S)rJ)rrTrV)rpkgrootsrQs r;r4z,_TopLevelFinder.__call__..sB    "3ty/A/GRHH   r=rz.finderutf-8z.pyzimport z; z .install()r)rTrVrWrXrr_find_top_level_modulesrY_find_package_rootsdict_find_namespacesr_find_virtual_namespacesrwrjrsafe_identifierbytes_finder_templater r ) rQrrrrV top_levelrY namespaces_legacy_namespacesrjfindercontentrLs ` @r;rz_TopLevelFinder.__call__s9%2.335LTY5W5WXX i+1r #I{HEE,0  !3!9r5AADD$r?r@rrDrr r rrrrEr=r;rrs\AkA$s)Ad3PS8nAAAA> <<<<>> _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 c4i|]}|t|SrEr)rrKrYrOs r;r4z"_simple_layout..`s( X X Xc$S+{CC X X Xr=rJc4g|]\}}t||SrE) _parent_path)rr2r3s r; z"_simple_layout..cs& O O O1a!3!3 O O Or=c 3K|]:\}}tjtg|dR|V;dSrvN)r same_pathrsplit)rkeyvaluers r;rz!_simple_layout..dsa C V5ciinn555u==r=)rrWrZ commonpathr6all)rrYrOlayoutrs `` @r;rrAs>Y X X X Xx X X XF .;B:-- W   O O  O O O P PF  ,,..  r=c||r|dt| n|}|dtjzS)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)rslenrstriprWr#)rKpkg_pathrs r;r~r~jsJ'/&7&7&<&< JXkS k " "(F ==rv & &&r=rTc#Kt|jpgEd{V|jpg}d|D}|jr |jVn|jpg}|d|Dz }|D]}|d\}}}|V dS)Ncg|]}d|v| SrvrErmods r;rz"_find_packages..|s>>>c3#::c:::r=c.g|]}d|jv |jSrrjrxs r;rz"_find_packages..s!HHHa#--16---r=rv)iterr py_modules ext_package ext_modules rpartition)rTrnested_modulesrmodulepackage_s r;rrxsDM'R(((((((((&BJ>>Z>>>N I&," HH;HHHH ))#.. A r=c#K|jpg}d|DEd{V|js|jpg}d|DEd{VdSdS)Nc3"K|] }d|v|V dSrrErs r;rz*_find_top_level_modules..s&<<S^^^^^^<.s0EEq3af3D3DAF3D3D3D3DEEr=)rrr)rTrrs r;rNrNs&BJ<.s@!!!  ^-c;II J J!!!r=)sorted_remove_nested)rrYrV pkg_rootss `` r;rOrOsI !!!!!(##!!!I ) $ $$r=rZct|}|j}|r!t|St||jz S)z(Works for packages and top-level modules)rrrtrDryrj)rZpath_rs r;rrsY JJE \F ||~~25==??###6>>##ej0111r=rc #>K|D]}d|vr|d}tt|dz ddD]Y}d|d|}t t ||d}|r||vr|VZdS)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. rvrrNrJ)rrangerr[rrrt)rrKpartsi partial_namerZs r;rRrRs # # c>>  #s5zzA~q"-- # #A88E"1"I..L), 2FFGGD;;== #L $A$A""""  # # #r=c#K|D]]}t||d}t|r)t|ds||gfV^dS)NrJz __init__.py)rrrt)rrrKrZs r;rQrQs|   i44 ::     tD-'@'@'G'G'I'I -     r=c:t|}tt|D]H\t fd|Dr|I|S)Nc3NK|]\}}|kot||V dSrL) _is_nested)rother other_pathrZrKs r;rz!_remove_nested..sR  !z 5L EZT5*EE      r=)rPcopyreversedrr6anyr7)rr<rZrKs @@r;rrs ).."" # #Fd9??#4#45566 T      %.__%6%6       JJsOOO Mr=rKrr parent_pathctj|}||dddd}||o"|tjt |g|RkS)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 rJrrv)rnormpathr"stripr startswithr)rKrrr norm_pkg_pathrests r;rrsN8,,M ;;vr1 % % + +C 0 0 6 6s ; ;D >>& ! ! mu~ [ 4   88'r=dir_cZtj|dtj||S)zFCreate a directory ensured to be empty. Existing files may be removed.T) ignore_errors)rrmtreerWmakedirs)rs r;rrs, M$d++++K Kr=c eZdZdZdZdZdS)rzcZ||_||_||_||_g|_d|_dS)NF)rUrVr| editable_namer8dry_run)rQrUr|rrVs r;rz_NamespaceInstaller.__init__s3(  0*  r=cftj|j|j|jzS)zInstallation target.)rWrZr[r|r nspkg_extrPs r;_get_nspkg_filez#_NamespaceInstaller._get_nspkg_files%w||D143E3VWWWr=cDtt|jS)z1Where the modules/packages should be loaded from.)reprrDrVrPs r; _get_rootz_NamespaceInstaller._get_rootsC &&'''r=N)r>r?r@rrrrEr=r;rzrzsDXXX(((((r=rza 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 rjrrctt|d}t|||S)z_Create a string containing the code for the``MetaPathFinder`` and ``PathEntryFinder``. c|dS)NrrE)rs r;z"_finder_template.._s 1r=)rrjrr)rPrr6_FINDER_TEMPLATEformatrs r;rUrUYsC 6'--//~~>>>??G  " "g* " U UUr=ceZdZdZdS)rwzCFile system does not seem to support either symlinks or hard links.N)r>r?r@rArEr=r;rwrwcsMMMMr=rwceZdZdZdZdZdS)rlz!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 r2N)r>r?r@_SUMMARY_DETAILS _SEE_DOCSrEr=r;rlrlgs!2HH*2IIIr=rl)YrAloggingrbrWrr`rh contextlibrenumrinspectr itertoolsrpathlibrtempfilertypingr r r r r rrrrrrJrrrrr discoveryrrTrwarningsrrrr rrr"rar%typing_extensionsabcr&rDrr' getLoggerr>rr*r@rrGrrrrrTr boolr5rr~rrNrOrrRrQrrr InstallerrzrrU FileErrorrwrlrEr=r;rs   ''''''                        *))))) /.....*))))))v$*******###### c4i WT ' H % %&$&$&$&$&$D&$&$&$R G8G8G8G8G8WG8G8G8T     x           .C<C<C<C<C< C<C<C