a0biރ \SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSK J r SSK J r SSK Jr SSKJr SSKJr SS KJrJrJrJrJrJrJrJrJrJr S S KJrJ r J!r!J"r"J#r# S S K$J%r% S S K&J'r' S SK(J)r)J*r*J+r+ SSK,J,r- \(aSSK.J/r/ \R`S:aSSKJ1r1 O\(aSSK2J1r1 OSSK3J4r1 \\5\4r6\"S\6S9r7\Rp"\95r:"SS\ 5r;Sr"SS\15r?"SS 5r@"S!S"\@5rA"S#S$5rBS%\5S&\C4S'jrDS(\S&\E4S)jrFS*\\5S+\\5\54S,\S&\E4S-jrGS.rHS/\'S&\\54S0jrIS/\'S&\\54S1jrJS*\\5S+\\5\54S2\6S&\\5\544S3jrKS4\6S&\54S5jrLS6\\5\54S&\\54S7jrMS*\\5S6\\5\54S&\\\5\\544S8jrNS6\\5\54S&\\5\544S9jrOS:\5S;\5S<\5S=\5S&\E4 S>jrPS?\7S&\74S@jrQ"SASB\#R5rSSCrTSD\5SE\\5\54SF\\5\\54S&\54SGjrU"SHSI\"R5rW"SJSK\+5rXg)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 namespaces)find_package_path) Distribution)InformationOnlySetuptoolsDeprecationWarningSetuptoolsWarning)build_py WheelFile))Protocol)ABC_P)boundcF\rSrSrSrSrSrSr\S\ \ SS4Sj5r S r g ) _EditableModeEz 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). strictlenientcompatmodereturncU(d[R$UR5nU[R;a[R "SU<S35eUS:Xa[ R"SSSS9 [U$)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/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/setuptools/command/editable_wheel.pyconvert_EditableMode.convertQsv (( (   11 1$$'>thFV%WX X H  ( - -* ;  U##N) __name__ __module__ __qualname____firstlineno____doc__STRICTr4r1 classmethodrstrr<__static_attributes__r?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. cR\rSrSrSrSrSSSS\"\R=(d S54/rS r S r S r S r S r S\\4SjrS\S\S\S\4SjrSrS\\\\\\444SjrS\S\S\S\S\\\\\\444 SjrSrS\4SjrSrS\4SjrS\S\S\SS 4S!jrS"rg)#editable_wheelxzBuild '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<SUlSUlSUlSUlgN)dist_dir dist_info_dir project_dirr.selfs r;initialize_options!editable_wheel.initialize_optionss  ! r>c6URnUR=(d [RUlUR =(d 0Ul[ UR=(d* [RRURS55Ulg)Ndist) distributionsrc_rootoscurdirrS package_dirrrQpathjoin)rUrYs r;finalize_optionseditable_wheel.finalize_optionss_  ==5BII++1rT]]Tbggll4;K;KV.TU r>cURRSS9 UR5 URS5 UR S5nUR UR 5 URU5 g![aa [R"5 URR=(d URR5n[RUS9 ef=f)NT)exist_ok bdist_wheel)project)rQmkdir_ensure_dist_inforeinitialize_commandget_finalized_commandwrite_wheelfilerR_create_wheel_file Exception traceback print_excrZnameget_name_DebuggingTipsr8)rUrerfs r;runeditable_wheel.runs  MM    .  " " $  % %m 444]CK  ' '(:(: ;  # #K 0     !'',,L0A0A0J0J0LG     0   s A7A::A+C%crURcTURS5nURUlUR 5 UR 5 URUlg[ UR5RS5(de[URS5R5(deg)N dist_infoz .dist-infoMETADATA) rRrirQ output_dirensure_finalizedrsrGendswithrexists)rUrvs r;rh editable_wheel._ensure_dist_infos    %11+>I#'==I  & & ( MMO!*!8!8D t))*33LAA AA**J7>>@@ @@r>cURnUR(dg[URURR SS55R 5n[X1X$5nUR5 g)NrN.) rZnamespace_packagesrrSr^getresolve_NamespaceInstallerinstall_namespaces)rUinstallation_dir pth_prefixrYr[ installers r;_install_namespaces"editable_wheel._install_namespacess_  && (($*:*:*>*>r3*GHPPR' U $$&r>r/cUR(a[UR5RO [5n[[UR S55n[ US5$)Nz *.egg-info)rRrparentmaprGglobnext)rU parent_dir candidatess r;_find_egg_info_dir!editable_wheel._find_egg_info_dirsH8<8J8JT$,,-44PTPV jool;< J%%r>rpunpacked_wheel build_libtmp_dircURn[U5n[U5n[[X!S3S55n[[X!S3S55n[[X!S3S55n URSSS9n [U5U lSU lURSSS9n URS SS9n U=U l=U lU lU=U l =U l U l U =U l U l XlX|lUR!S 5n SU l[U5U lUR!S 5nS UlUR)5UlUR-5 U R/5 U R/5 g )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_scriptsrFN)rZrGrriegg_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_modery)rUrprrrrYwheelrrrrrrrrs r;_configure_buildeditable_wheel._configure_buildsy  N# N 4&?@d>V5>9EFd>V5>9EF,,ZD,QL/3,))'d)K++I$+OFOOOe1EORWWW'"9GcURnURS5nUR5HHnURU5n[US5(a SUlM.[US5(dMASUlMJ g)z8Set the ``editable_mode`` flag in the build sub-commandsr editable_modeTinplaceN)rZrget_sub_commandshasattrrr)rUrYrcmd_namecmds r;r!editable_wheel._set_editable_modesi  $$W-..0H&&x0CsO,,$(!i((" 1r>cj/n0nURS5nUR5HnURU5n[US5(a(URUR 5=(d /5 [US5(dM`UR UR 5=(d 05 M X4$)Nr get_outputsget_output_mapping)rjrrextendrupdater)rUfilesmappingrrrs r;_collect_build_outputs%editable_wheel._collect_build_outputss"$**73..0H,,X6CsM** S__.4"5s011s557=2> 1~r> dist_namecURXX45 UR5 UR5upVURS5 URS5 URS5 XV4$)Nrrr)r_run_build_subcommandsr _run_install)rUrrrrrrs r;_run_build_commands"editable_wheel._run_build_commandssb iL ##%446 )$ )$ &!~r>cURS5nUR5HQnURU5nUS:Xa&[U5[:waUR U5 M@UR U5 MS g)aE Issue #3501 indicates that some plugins/customizations might rely on: 1. ``build_py`` not running 2. ``build_py`` always copying files to ``build_lib`` However both these assumptions may be false in editable_wheel. This method implements a temporary workaround to support the ecosystem while the implementations catch up. rrN)rjrtype build_py_cls _safely_run run_command)rUrrprs r;r%editable_wheel._run_build_subcommandssf33G<**,D,,T2Cz!d3i<&?  &  & -r>rc URU5$![a7 [R"SS[R "5SUSUS35 gf=f)Nz0Customization incompatible with editable installz z If you are seeing this warning it is very likely that a setuptools plugin or customization overrides the `a` command, without taking into consideration how editable installs run build steps starting from setuptools v64.0.0. Plugin authors and developers relying on custom build steps are encouraged to update their `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. )rrmrr8rn format_exc)rUrs r;reditable_wheel._safely_run)sp ##H- -  ( - -B%%'()89AzB- .6J7  s>AAc SSKJn URS5nURnSR UR 55nSnUSUSUS3n[ URU5nUR5(aUR5 [US9n [SS9n [S S9n U oon[ U [ UR5R5n[R"URU5 URX5 URXLX5unnUR!XEU 5nU U"US 5nU"UUU5 UR#U 5 SSS5 SSS5 SSS5 SSS5 SSS5 U$!,(df  N0=f!,(df  N9=f!,(df  NB=f!,(df  NK=f!,(df  U$=f) Nrr rv-z 0.editablez.whl)suffixz .build-libz .build-tempw)wheel.wheelfiler!rjrpr`get_tagrrQr{unlinkrrRshutilcopytreerr_select_strategy write_files)rUrer!rvrtag build_tag archive_name wheel_pathrr build_tmpunpackedlibtmpunpacked_dist_inforrstrategy wheel_objs r;rl!editable_wheel._create_wheel_fileEs{-..{; NN hh{**,- #Ai[#d; $--6         +<@&l; &m< xc9!%hT5G5G0H0M0M!N  OOD..0B C  $ $X 9!55i3TNE7,,YSAH9Z5E73%%h/6 G Gcategoryc[URSU3S5nU(a;U"5(a.[RSUS35 UR SU35 ggg)Nhas_z Installing z as non editableinstall_)getattrrZ_loggerinfor)rUr has_categorys r;reditable_wheel._run_installasXt00D 2CTJ LNN LL;xj0@A B   xz2 3+rEditableStrategyc~SUSU3n[UR5n[RUR5nU[R La7[ [URSU55n[URXU5$[UR5n[XRU5n U[RLn [UR5S1:XaU (dU (a=URRSS5n [URU[X[5/5$[!URU5$)zDDecides which strategy to use to implement an editable installation. __editable__.rrrNr~)rrSr)r<r.rE _empty_dir _LinkTreerZ_find_packages_simple_layoutr^r1setr _StaticPth_TopLevelFinder) rUrprr build_namerSr. auxiliary_dirpackageshas_simple_layoutis_compat_modesrc_dirs r;reditable_wheel._select_strategygs %TF!C51 4++, $$TYY/ ='' '&tD,<,.&&**2s3Gd//[8R7ST Tt00$77r>)rQrRr.r^rS)r@rArBrCrD descriptionrr) user_optionsrVrarsrhrrrGr_Pathrrrr r rrrrrlrrrHr?r>r;rJrJxsA WK LK $!6!6!<"=>L  V " A'&HSM& 0#0#).0#;@0#KP0#d # d3ic3h.G(H   .3 @E PU  tCy$sCx.( ) ',C884S4 888 8  8r>rJcF\rSrSrSSS\\S\\\44SjrSrSr S r g ) rirr!rrcgrPr?)rUrrrs r;__call__EditableStrategy.__call__ r>cgrPr?rTs r; __enter__EditableStrategy.__enter__r r>cgrPr?rU _exc_type _exc_value _tracebacks r;__exit__EditableStrategy.__exit__r r>r?N) r@rArBrCr rGr rr rrHr?r>r;rrs3 k $s) d3PS8n   r>rcb\rSrSrS\S\S\\4SjrSSS\\S \ \\44S jr S r S r S r g)rirYrp path_entriesc(XlX lX0lgrPrYrpr)rUrYrprs r;__init___StaticPth.__init__s  (r>rr!rrcSRSUR55n[US35nURSURS3U5 g)N c3T# UHn[UR55v M g7frP)rGr).0ps r; &_StaticPth.__call__..s I7H!S--7Hs&(r.pth)r`r _encode_pthwritestrrp)rUrrrentriescontentss r;r_StaticPth.__call__sG))It7H7HIJ'"~. tyyk6Ar>cS[[[RUR55<S3n[ R U[-5 U$)Nz_ Editable install will be performed using .pth file to extend `sys.path` with: z )listrr\fspathrrwarning_LENIENT_WARNINGrUmsgs r;r _StaticPth.__enter__sH c"))T../ 034   ../ r>cgrPr?rs r;r_StaticPth.__exit__r r>rN)r@rArBrCrrGr rrr rr rrHr?r>r;rrsU)\))DJ) BkB$s)Bd3PS8nB  r>rc^\rSrSrSrS\S\S\S\4U4SjjrSS S \ \S \ \\44U4S jjr S \S\ \4Sjr SS\S\4SjjrSrSrSrSrU=r$)riaH 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. rYrprrc>[U5Ul[U5R5UlUR S5R Ul[TU]!XUR/5 g)Nr) rrrrr copy_file_filesuperr)rUrYrprr __class__s r;r_LinkTree.__init__sV"-0i002))*5??  d&8&8%9:r>rr!rrcH>URX#5 [TU] XU5 grP) _create_linksr5r)rUrrrr6s r;r_LinkTree.__call__s  5* w/r>filer/c [[5 [U5R5R UR 5n[ U5R[RS5sSSS5 $!,(df  g=f)N/) r ValueErrorrr relative_torrGreplacer\sep)rUr;r_s r;_normalize_output_LinkTree._normalize_outputsT j !:%%'33DNNCDt9$$RVVS1" ! !s AA55 Brelative_outputsrc_filecURU- nURR5(dURRSS9 UR X$US9 g)NT)parentslink)rris_dirrgr4)rUrDrErIdests r; _create_file_LinkTree._create_filesJ!!O3{{!!## KK  d  + 8 -r>cURRSSS9 [UR5(aSOSnUR5VVs0sHupEUR U5U_M nnnUR SS5 UH5nUR U5nU(dMX;dM$UR X5 M7 UR5HupUR XUS9 M gs snnf)NT)rGrdsymhardrH)rrg_can_symlink_filesitemsrBpoprL) rUoutputsoutput_mapping link_typekvmappingsoutputrelativesrcs r;r9_LinkTree._create_linkss    =/0B0BCCE =K=Q=Q=ST=STQD**1-q0=ST T4 F--f5HxH4!!(3 &^^-MH   h)  <.Us C$cBSn[RU[-5 U$)Nz=Strict editable install will be performed using a link tree. )rr*_STRICT_WARNINGr,s r;r _LinkTree.__enter__sNo-. r>cRSURS3n[R"SU5 g)Nz\ Strict editable installation performed using the auxiliary directory: z Please be careful to not remove this directory, otherwise you might not be able to import/use your package. Editable installation.)rrr8rUrrrr-s r;r_LinkTree.__exit__s2    !   5s;r>)r4rrrP)r@rArBrCrDrrGrrr r rrrBrLr9r rrH __classcell__)r6s@r;rrs ; ; ; ;  ;0k0$s)0d3PS8n0chsm.C.3. = <rcX\rSrSrS\S\4SjrSSS\\S\\\44S jr S r S r S r g )rirYrpcXlX lgrPrYrp)rUrYrps r;r_TopLevelFinder.__init__s   r>rr!rrc zURR=(d [Rn[ [ UR5[ UR55nURR=(d 0n[XVU5n[[ [URR=(d /U5S[U5555nURR=(d /V s0sH-n U [XURR=(d S5_M/ n n 0UEU EnSURS3n [ R""U 5n [%['XU5S5n UR)U S3U 5 [+SU SU S 35n UR)SURS 3U 5 gs sn f) Nc3(# UHo/4v M g7frPr?)rnss r;r+_TopLevelFinder.__call__..sD$Cbb$CsrNrz.finderutf-8z.pyzimport z; z .install()r!)rYr[r\r]rr_find_top_level_modulesr^_find_package_rootsdict_find_namespacesr_find_virtual_namespacesrrrprsafe_identifierbytes_finder_templater#r")rUrrrr[ top_levelr^roots namespaces_pkglegacy_namespacesrpfindercontents r;r_TopLevelFinder.__call__sy99%%2.35LTYY5WX ii++1r #IHE,0  !3!3!9r5AD$c6Sn[R"SU5 g)Nz Please be careful with folders in your working directory with the same name as your package as they may take precedence during imports. rb)rr8rcs r;r_TopLevelFinder.__exit__s  5s;r>rhN) r@rArBrCrrGrr r rr rrHr?r>r;rrsJ\AkA$s)Ad3PS8nA> rr}r/cB[RS:aSOSn[R"5n[R"X!5nUR U5 UR 5 URS5 UR5sSSS5 $!,(df  g=f)a.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 behaviour 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)``). )r" localeNr) sys version_infoioBytesIO TextIOWrapperwriteflushseekread)r}encodingbufferwrappers r;r"r"sf++w6xDH ""64 g  A{{} s AB Bbase_dirc<[[UR55S9n[US5[US5p2UR SSS9 [ [ [[5 [R"X#5 UR5(a%URSS9S:XaSSS5 SSS5 gSSS5 [R"X#5 SSS5 g !,(df  N/=f![anSn[U5UeSnAff=f!,(df  g=f) N)dirz file1.txtz file2.txtfile1rn)rTzFile system does not seem to support either symlinks or hard links. Strict editable installs require one of them to be supported.F)rrGrr write_textrAttributeErrorNotImplementedErrorOSErrorr\symlink is_symlink read_textrIrmLinksNotSupported)rrpath1path2exr-s r;rQrQ-s H$4$4$6 7 8CC-tC/Eu 73 n&97 C JJu $!!eoowo&G7&RD 9 8D  1 GGE !! 9 8D C 1P $C(b 0  1 9 8sOAD "AC"D 3D <C-D  C* &D - D 7DD  D  Drr^rSc ^^UVs0sHo3[X1U5_M nnU(d[U50S14;$[RR UR 5VVs/sHupV[ XV5PM snn5m[U4SjUR 555$s snfs snnf)aReturn ``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 rNc 3># UH7up[R"[T/URS5Q76U5v M9 g7fr~N)r same_pathrsplit)rkeyvaluers r;r!_simple_layout..ds:(JC V5ciin5u==(s?A)rrr\r_ commonpathrR _parent_pathall)rr^rSrzlayoutrWrXrs @r;rrAs>PX Xx$S{CCxF X ;B:-- WW    Oa!3 O PF  ,,.  Y!Ps B$"B) cURU5(aUS[U5*OUnURS[R-5$)aInfer 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=)rzlenrstripr\rA)rzpkg_pathrs r;rrjs?'/&7&7&<&rYc## [UR=(d /5ShvN UR=(d /nUVs/sH nSU;dM UPM nnUR(aURv OFUR=(d /nX4Vs/sH!nSUR ;dMUR PM# sn- nUHnUR S5un nUv M gNs snfs snf7f)Nr~)iterr py_modules ext_package ext_modulesrp rpartition) rYrmodnested_modulesrxmodulepackage_s r;rrxsDMM'R(((&BJ%/>Zc3#:cZN> &&," ;H;a#-6166;HH ))#. A !)? Is9"C-C!C- C#C#;C-C()C(9)C-# C-c## UR=(d /nSU5ShvN UR(d'UR=(d /nSU5ShvN ggN=N7f)Nc36# UHnSU;dM Uv M g7frr?)rrs r;r*_find_top_level_modules..s>#ejj011r>rc #"# UHnSU;aM URS5n[[U5S- SS5HLnSRUSU5n[ [ X@S55nUR 5(aX@;dMHUv MN M g7f)aBy carefully designing ``package_dir``, it is possible to implement the logical structure of PEP 420 in a package without the corresponding directories. Moreover a parent package can be purposefully/accidentally skipped in the discovery phase (e.g. ``find_packages(include=["mypkg.*"])``, when ``mypkg.foo`` is included by ``mypkg`` itself is not). We consider this case to also be a virtual namespace (ignoring the original directory) to emulate a non-editable installation. This function will try to find these kinds of namespaces. r~rrNrN)rrangerr`rrr{)rrzpartsi partial_namer_s r;rsrss c>  #s5zA~q"-A88E"1I.L),2FGD;;==L$A"" . s A# UH upTU:g=(a [TTX5v M" g7frP) _is_nested)rother other_pathr_rzs r;r!_remove_nested..s0 %6! 5L EZT5E E%6s(+)rqcopyreversedr(rRanyrS)rrZr_rzs @@r;rrsh ).." #Fd9??#456 T  %.__%6    JJsO 7 Mr>rzrr parent_pathc[R"U5nURUSS5RS5R S5nUR U5=(a# U[R"[ U/UQ765:H$)au Return ``True`` if ``pkg`` is nested inside ``parent`` both logically and in the file system. >>> _is_nested("a.b", "path/a/b", "a", "path/a") True >>> _is_nested("a.b", "path/a/b", "a", "otherpath/a") False >>> _is_nested("a.b", "path/a/b", "c", "path/c") False >>> _is_nested("a.a", "path/a/a", "a", "path/a") True >>> _is_nested("b.a", "path/b/a", "a", "path/a") False rNrr~)rnormpathr@stripr startswithr)rzrrr norm_pkg_pathrests r;rrsoNN8,M ;;vr1 % + +C 0 6 6s ;D >>& ! mu~~ [ 4 8'r>dir_c\[R"USS9 [R"U5 U$)zFCreate a directory ensured to be empty. Existing files may be removed.T) ignore_errors)rrmtreer\makedirs)rs r;rrs! MM$d+KK Kr>c&\rSrSrSrSrSrSrg)ricPXlX@lX lX0l/UlSUlg)NF)rZr[r editable_namerTdry_run)rUrZrrr[s r;r_NamespaceInstaller.__init__s'( 0*  r>c[RRURURUR -5$)zInstallation target.)r\r_r`rr nspkg_extrTs r;_get_nspkg_file#_NamespaceInstaller._get_nspkg_files,ww||D1143E3E3VWWr>c>[[UR55$)z1Where the modules/packages should be loaded from.)reprrGr[rTs r; _get_root_NamespaceInstaller._get_rootsC &''r>)rZrrrrTr[N)r@rArBrCrrrrHr?r>r;rrsX(r>ra 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 rprrcn[[UR5SS95n[R XUS9$)zWCreate a string containing the code for the``MetaPathFinder`` and ``PathEntryFinder``. c US$)Nrr?)rs r;"_finder_template.._s1r>)rrprr)rqrrR_FINDER_TEMPLATEformatrs r;rvrvYs1 6'--/~>?G  " "* " UUr>c\rSrSrSrSrg)riczCFile system does not seem to support either symlinks or hard links.r?N)r@rArBrCrDrHr?r>r;rrcsMr>rc \rSrSrSrSrSrSrg)rrigz!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 r2r?N)r@rArBrC_SUMMARY_DETAILS _SEE_DOCSrHr?r>r;rrrrgs2HH*2Ir>rr)YrDloggingrr\rrrn contextlibrenumrinspectr itertoolsrpathlibrtempfilertypingr r r r r rrrrrrNrrrrr discoveryrrYrwarningsrrrrrrr!rr$typing_extensionsabcr%rGrr& getLoggerr@rr)r_r+rJrrrrrur"boolrQrrrrorprrsrrrrr Installerrrrv FileErrorrrrr?r>r;r s  '   * /)v*# c4i T   H %&$D&$R G8WG8T x   .C< C