a0bi@ dSrSSKrSSKrSSKrSSKrSSKrSSKJr SSKJ r SSK J r SSK J r SSKJrJrJrJrJrJrJrJrJrJrJrJr SSKJr SS KJr SS KJr S S K J!r" S S K#J$r$ \(aSSK%J&r& SSK'J(r( SSK)J*r* \ RVr,\\-\R\4r/\"S5r0\"SSS9r1"SS5r2S@S\\-S\\/S\\-4Sjjr3S@S\\-\4\\/4S\-4Sjjr5S\\/S\\/4Sjr6S\\4\/4S\-4Sjr7S\/S\-4S jr8SAS!\-S"\\\-\-4S\\/4S#jjr9S$\-S%\\/S\ 4S&jr:S'\ S$\-S\4S(jr;S$\-S"\\\-\-4S\/S\\/\\-\-44S)jr<SAS*\-S"\\\-\-4S\\/S\4S+jjr=SAS,\\-\-4S"\\\-\-4S\\/S\\-\44S-jjr>SSSS..S/\\\-\-4S\\/S\\-4S0jjr?S1\/S2\/S\-4S3jr@S4\\\\\-\A4\-4S\-4S5jrBS6\CS\C4S7jrDS@S8\\E\C4S\\/S\\\-\\-44S9jjrFSBS:\-S\\-\C44S;jjrG"S<S=5rH"S>S?\\0\145rIg)CaiUtility functions to expand configuration directives or special values (such glob patterns). We can split the process of interpreting configuration files into 2 steps: 1. The parsing the file contents from strings to value objects that can be understand by Python (for example a string with a comma separated list of keywords into an actual Python list of strings). 2. The expansion (or post-processing) of these values according to the semantics ``setuptools`` assign to them (for example a configuration field with the ``file:`` directive should be expanded from a list of file paths to a single string with the contents of those files concatenated) This module focus on the second step, and therefore allow sharing the expansion functions among several configuration file formats. **PRIVATE MODULE**: API reserved for setuptools internal usage only. N)iglob) ConfigParser) ModuleSpec)chain) TYPE_CHECKINGCallableDictIterableIteratorListMappingOptionalTupleTypeVarUnioncast)Path) ModuleType)DistutilsOptionError) same_path)SetuptoolsWarning) Distribution)ConfigDiscovery)DistributionMetadata_K_VT) covariantcv\rSrSrSrS\S\4SjrS\\ \ R\ R44Sjr Sr S rg ) StaticModule>z>Proxy to a module object that avoids executing arbitrary code.namespecc[R"[R"UR5R 55n[ U5R[55 U? gN) astparsepathlibrorigin read_bytesvarsupdatelocalsself)r.r"r#modules ڑ/builddir/build/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/setuptools/config/expand.py__init__StaticModule.__init__As?7<< 4??AB T &(# Ireturnc#f^# URRHm[T[R5(a U4SjTR 5ShvN MB[T[R 5(dMcTR(dMvTRTR4v M gNY7f)Nc3>># UHoTR4v M g7fr%value).0target statements r0 1StaticModule._find_assignments..IsVDU&Y__5DUs) r/body isinstancer&Assigntargets AnnAssignr8r:)r.r;s @r0_find_assignmentsStaticModule._find_assignmentsFsp))I)SZZ00VIDUDUVVVIs}}55)/// ''99 *VsAB1B/#B1=B1 B1c^[U4SjUR555$![a n[URST35UeSnAff=f)zHAttempt to load an attribute "statically", via :func:`ast.literal_eval`.c3># UHPup[U[R5(dM&URT:XdM8[R"U5v MR g7fr%)r?r&Nameid literal_eval)r9r:r8attrs r0r<+StaticModule.__getattr__..PsI%=MFfchh/(4:II4E(  ''%=s%AAAz has no attribute N)nextrC ExceptionAttributeErrorr")r.rJes ` r0 __getattr__StaticModule.__getattr__Ms] P%)%;%;%=   P DII;.@!GHa O Ps"& AA  AN)__name__ __module__ __qualname____firstlineno____doc__strrr1r rr&ASTrCrP__static_attributes__rRr3r0r r >sAHS  :8E#''3772B,C#D: Pr3r patternsroot_dirr4c  ^^1Skn/nT=(d [R"5mUHm[U4SjU55(ak[RR [RR TT55nUR [U4Sj[USS9555 M[RRTT5R[RS5nURU5 M U$)zExpand the list of glob patterns, but preserving relative paths. :param list[str] patterns: List of glob patterns :param str root_dir: Path to which globs should be relative (current directory by default) :rtype: list >*?[]{}c3,># UH oT;v M g7fr%rR)r9charr8s r0r< glob_relative..hs9u}sc3># UHCn[RRUT5R[RS5v ME g7f)/N)ospathrelpathreplacesepr9rjr\s r0r<rfls; @GGOOD(3;;BFFCHH @sA AT) recursiverh) rigetcwdanyrjabspathjoinextendsortedrrkrlrmappend)r[r\glob_charactersexpanded_values glob_pathrjr8s ` @r0 glob_relativerzYs5OO&299;H 99 9 9 Xu(EFI  " " %i4 @ 77??5(3;;BFFCHD  " "4 (" r3 filepathsc^SSKJn [RR T=(d [R "55mU4SjU"U55nSR U4Sj[U555$)zReturn the content of the files concatenated using `` `` as str This function is sandboxed and won't reach anything outside ``root_dir`` (By default ``root_dir`` is the current directory). r)always_iterablec3d># UH%n[RRTU5v M' g7fr%)rirjrsrns r0r<read_files..s%V;U4"'',,x..;Us-0 c3`># UH#n[UT5(dM[U5v M% g7fr%) _assert_local _read_filerns r0r<rs,6D x (  46s..) setuptools.extern.more_itertoolsr}rirjrrrprs_filter_existing_files)r{r\r} _filepathss ` r0 read_filesrzsXAwwx6299;7HV?9;UVJ 99*:6 r3c## UHHn[RRU5(aUv M-[R"SU<S35 MJ g7f)NzFile z cannot be found)rirjisfileremit)r{rjs r0rrs? 77>>$  J  " "U4(2B#C D sAAfilepathcl[USS9nUR5sSSS5 $!,(df  g=f)Nzutf-8)encoding)openread)rfs r0rrs# h )Qvvx * ) )s% 3c[[RRU55[[RRU55R;aSU<SU<S3n[ U5eg)NzCannot access z (or anything outside )T)rrirjrrparentsr)rr\msgs r0rrsW BGGOOH %&d277??83L.M.U.UUxl*@ AN"3'' r3 attr_desc package_dircU=(d [R"5nUR5RS5nUR 5nSR U5nU=(d Sn[ XQU5upgn[XW5n[[XX5U5$![a [X5n [X5s$f=f)aReads the value of an attribute from a module. This function will try to read the attributed statically first (via :func:`ast.literal_eval`), and only evaluate the module if it fails. Examples: read_attr("package.attr") read_attr("package.module.attr") :param str attr_desc: Dot-separated string describing how to reach the attribute (see examples above) :param dict[str, str] package_dir: Mapping of package names to their location in disk (represented by paths relative to ``root_dir``). :param str root_dir: Path to directory containing all the packages in ``package_dir`` (current directory by default). :rtype: str .r1) rirpstripsplitpoprs _find_module _find_specgetattrr rM _load_spec) rrr\ attrs_path attr_name module_name _parent_pathrjr#r/s r0 read_attrrs,&299;H"((-J I((:&K+K&2;X&V#L k (D*|K6 BB *D.v))*sB B=<B=r module_pathc[RRX5nU=(d [RRU5nUc [ U5eU$r%) importlibutilspec_from_file_location find_specModuleNotFoundError)rrr#s r0rrsD >> 1 1+ KD  89>>++K8D |!+.. Kr3r#c[USU5nU[R;a[RU$[RR U5nU[RU'UR RU5 U$)NrS)rsysmodulesrrmodule_from_specloader exec_module)r#rr"r/s r0rrsd 4[ 1D s{{{{4  ^^ , ,T 2FCKKKKF# Mr3cpUnURS5nU(aUSU;ajXSnURSS5n[U5S:a([RR X&S5nUSnOUnSR U/USSQ5nO(SU;a"[RR X!S5n[RR "U/URS5Q76n[ US3[RR US54[US 355n [S U 5S5n X:U4$) a Given a module (that could normally be imported by ``module_name`` after the build is complete), find the path to the parent directory where it is contained and the canonical name that could be used to import it considering the ``package_dir`` in the build configuration and ``root_dir`` rrrhNz.pyz __init__.pyz.*c3r# UH-n[RRU5(dM)Uv M/ g7fr%)rirjr)r9xs r0r<_find_module..s!C:a1B:s(7 7) rrsplitlenrirjrsrrrL) rrr\ parent_path module_parts custom_pathparts parent_module path_start candidatesrs r0rrs(K$$S)L ?k )%1o6K&&sA.E5zA~ ggll81X> %a + ((M#EL4D#EFK ; '',,xRAKkCK,=,=c,BCJ  R>41A}QX6 6> RR Rs1) namespacesfill_package_dirr\rc ^ SSKJn SSKJnJn U(aSSKJn OSSKJn U=(d [RnURSS/5n/n Uc0OUn[U"U"U555m [T 5S:Xa1[U 4S jSU455(aURS T S5 T Hn [X*5n UR"U 40UD6n U R!U 5 U (dM;UR#S 5U :XaMR[R$R'X5(aMxUR)U"X55 M U $) aWorks similarly to :func:`setuptools.find_packages`, but with all arguments given as keyword arguments. Moreover, ``where`` can be given as a list (the results will be simply concatenated). When the additional keyword argument ``namespaces`` is ``True``, it will behave like :func:`setuptools.find_namespace_packages`` (i.e. include implicit namespaces as per :pep:`420`). The ``where`` argument will be considered relative to ``root_dir`` (or the current working directory when ``root_dir`` is not given). If the ``fill_package_dir`` argument is passed, this function will consider it as a similar data structure to the ``package_dir`` configuration parameter add fill-in any missing package location. :rtype: list r)construct_package_dir)unique_everseenr})PEP420PackageFinder) PackageFinderwhererrc3L># UHn[TSU5(+v M g7f)rN) _same_path)r9rsearchs r0r< find_packages..>s"VoJvay!$< < rr)rirjrsnormpath)rrjs r0rrMs2Y&6BGGLL,FD 77  D !!r3r8c[U5(aU"5n[[[[[ 4U5n[ U[5(d7[US5(a!SR[[U55nU$SU-nU$)zXWhen getting the version directly from an attribute, it should be normalised to string. __iter__rz%s) callablerr rrXintr?hasattrrsmapr7s r0versionrRsr %S/*E 2E eS ! ! 5* % %HHSe_-E L5LE Lr3 package_datac:SU;aURS5US'U$)Nr^r)r)rs r0canonic_package_datards% l'++C0 R r3 data_filesc [U[5(aU$UR5VVs/sHup#U[X154PM snn$s snnf)zFor compatibility with ``setup.py``, ``data_files`` should be a list of pairs instead of a dict. This function also expands glob patterns. )r?rrrz)rr\destr[s r0canonic_data_filesrjsS*d##)..0 0ND }X010  sAtextc [SSS9n[UlURX5 UR 5VVs0sHup4U[ UR 55_M! nnnUR URS5 U$s snnf)a+Given the contents of entry-points file, process it into a 2-level dictionary (``dict[str, dict[str, str]]``). The first level keys are entry-point groups, the second level keys are entry-point names, and the second level values are references to objects (that correspond to the entry-point value). N)=)default_section delimiters)rrX optionxform read_stringrdictrr)r text_sourceparserrrgroupss r0 entry_pointsr{so$6 BFF t)-3\\^ <^TQaaggi ^F < JJv%%t, M=s&Bcn\rSrSrSrS SjrSrSrSrS\ \ \ 44Sjr \ S\ \ \ 44S j5r S rg ) EnsurePackagesDiscoverediaSome expand functions require all the packages to already be discovered before they run, e.g. :func:`read_attr`, :func:`resolve_class`, :func:`cmdclass`. Therefore in some cases we will need to run autodiscovery during the evaluation of the configuration. However, it is better to postpone calling package discovery as much as possible, because some parameters can influence it (e.g. ``package_dir``), and those might not have been processed yet. cXlSUlg)NF)_dist_called)r. distributions r0r1!EnsurePackagesDiscovered.__init__s!  r3chUR(d!SUlURRSS9 gg)zBTrigger the automatic package discovery, if it is still necessary.TF)r"N)r r set_defaultsr.s r0__call__!EnsurePackagesDiscovered.__call__s*||DL JJ # # # /r3cU$r%rRrs r0 __enter__"EnsurePackagesDiscovered.__enter__s r3cpUR(a%URRR5 ggr%)r rr  analyse_name)r. _exc_type _exc_value _tracebacks r0__exit__!EnsurePackagesDiscovered.__exit__s$ << JJ # # 0 0 2 r3r4cJU"5 URRnUc0$U$r%)rr)r.pkg_dirs r0_get_package_dir)EnsurePackagesDiscovered._get_package_dirs% **((_r1'1r3c,[UR5$)zCProxy to ``package_dir`` that may trigger auto-discovery when used.)LazyMappingProxyrrs r0r$EnsurePackagesDiscovered.package_dirs  5 566r3)r rN)r r)rSrTrUrVrWr1rrrr rXrpropertyrrZrRr3r0rrsT0 32'#s("32 7WS#X.77r3rc\rSrSrSrS\/\\\444Sjr S\\\44Sjr S\S\4Sjr S\ 4S jr S\\4S jrS rg ) r ia]Mapping proxy that delays resolving the target object, until really needed. >>> def obtain_mapping(): ... print("Running expensive function!") ... return {"key": "value", "other key": "other value"} >>> mapping = LazyMappingProxy(obtain_mapping) >>> mapping["key"] Running expensive function! 'value' >>> mapping["other key"] 'other value' obtain_mapping_valuecXlSUlgr%_obtain_value)r.r$s r0r1LazyMappingProxy.__init__s+ 15 r3r4c^URcUR5UlUR$r%)r(r'rs r0_targetLazyMappingProxy._targets# ;; ,,.DK{{r3keyc(UR5U$r%)r+)r.r-s r0 __getitem__LazyMappingProxy.__getitem__s||~c""r3c4[UR55$r%)rr+rs r0__len__LazyMappingProxy.__len__s4<<>""r3c4[UR55$r%)iterr+rs r0rLazyMappingProxy.__iter__sDLLN##r3r&N)rSrTrUrVrWrr rrr1r+r/rr2r rrZrRr3r0r r sh 6Xb'"b&/6I-J6R #r#b###$(2,$r3r r%)NN)z entry-points)JrWr&rrir(rglobr configparserrimportlib.machineryr itertoolsrtypingrrr r r r r rrrrrrtypesrdistutils.errorsr_pathrrwarningsrsetuptools.distrrrdistutils.distr from_iterable chain_iterrXPathLike_Pathrrr rzbytesrrrrrrrrrrrrrrrrrrrrr rRr3r0rGs&   %*    1+(,43   c2;; T] TT"PP8:>sm'/ #YB%UHUO ;<PS$EhuoE(5/Eue|, ES04 $#*#*'#s(+,#*uo#*LChuo*Zcj11#+GCH,=#>1JO1 5(3- $%1H04 $ ' ''#s(+, 'uo ' '$04 $S cNS'#s(+,SuoS #x- S15 $ 2tCH~.2uo 2  #Y 2j"u"E"c" 58E#s(O#