UE0dZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z mZddlmZddlmZmZmZmZmZmZdd lmZdd lmZdd lmZd d lmZm Z d dl!m"Z"d dl#m$Z$erddl%m&Z&edZ'eddZ(GddZ) dWdXdZ* dWdYd!Z+dZd$Z,d[d'Z-d\d)Z. d]d^d-Z/d_d1Z0d`d4Z1dad6Z2 d]dbd9Z3 d]dcd=Z4dddd>dddAZ5dedDZ6dfdGZ7dgdJZ8 dWdhdNZ9didjdRZ:GdSdTZ;GdUdVee'e(fZProxy to a module object that avoids executing arbitrary code.namestrspecrctjtj|j}t |t|` dSN) astparsepathlibrorigin read_bytesvarsupdatelocalsself)r*rrmodules /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/setuptools/config/expand.py__init__zStaticModule.__init__;sP7< 44??AABB T &((### IIIreturn!Iterator[tuple[ast.AST, ast.AST]]c#K|jjD]gttjrfdjDEd{V6ttjrjrjjfVhdS)Nc3*K|] }|jfVdSr!)value).0target statements r, z1StaticModule._find_assignments..Cs*VV&VY_5VVVVVVr.) r+body isinstancer"Assigntargets AnnAssignr3r5)r*r6s @r,_find_assignmentszStaticModule._find_assignments@s) : :I)SZ00 :VVVVIDUVVVVVVVVVVVIs}55 :)/ : '9999  : :r.c tfd|DS#t$r}t|jd|d}~wwxYw)zHAttempt to load an attribute "statically", via :func:`ast.literal_eval`.c3K|]@\}}t|tjr!|jk*tj|VAdSr!)r9r"Nameid literal_eval)r4r5r3attrs r,r7z+StaticModule.__getattr__..Jsa!FEfch//5;I4E4E ''4E4E4E4Er.z has no attribute N)nextr= ExceptionAttributeErrorr)r*rCes ` r, __getattr__zStaticModule.__getattr__Gs P%)%;%;%=%=   P P P DI!G!G!G!GHHa O Ps,0 AAAN)rrrr)r/r0)__name__ __module__ __qualname____doc__r-r=rHr.r,rr8sVHH :::: P P P P Pr.rpatterns Iterable[str]root_dirStrPath | Noner/ list[str]c hd}g}ptj|D]tfd|Dr{tjtj}|tfdt|dDtj  tj d}| ||S)aExpand 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 K|]}|vV dSr!rM)r4charr3s r,r7z glob_relative..bs'99tu}999999r.c3K|]B}tj|tjdVCdS)/N)ospathrelpathreplacesepr4r_rPs r,r7z glob_relative..fsYGOOD(33;;BFCHHr.T) recursiver]) r^getcwdanyr_abspathjoinextendsortedrr`rarbappend)rNrPglob_charactersexpanded_values glob_pathr_r3s ` @r, glob_relativeroSs 544OO&29;;H)) 9999999 9 9 ) Xu(E(EFFI  " " %i4 @ @ @    7??5(33;;BFCHHD  " "4 ( ( ( ( r. filepathsStrPath | Iterable[StrPath]rcddlm}tjptjfd||D}dfdt|DS)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_iterablec3XK|]$}tj|V%dSr!r^r_rhrcs r,r7zread_files..s3VV4"',,x..VVVVVVr. c3VK|]#}t|t|V$dSr!) _assert_local _read_filercs r,r7zread_files..sO  x ( (4r.) setuptools.extern.more_itertoolsrsr^r_rgrerh_filter_existing_files)rprPrs _filepathss ` r, read_filesr}tsA@@@@@wx629;;77HVVVV??9;U;UVVVJ 99*:66  r.Iterable[StrPath]Iterator[StrPath]c#K|D]>}tj|r|V&tjd|d?dS)NzFile z cannot be found)r^r_isfileremit)rpr_s r,r{r{seEE 7>>$   EJJJJ  "#C4#C#C#C D D D D EEr.filepathbytes | StrPathct|d5}|cdddS#1swxYwYdS)Nzutf-8)encoding)openread)rfs r,ryrys h ) ) )Qvvxxs 377rcttj|ttj|jvrd|d|d}t |dS)NzCannot access z (or anything outside )T)rr^r_rgparentsr)rrPmsgs r,rxrxsg BGOOH % %&&d27??83L3L.M.M.UUUNxNNNNN"3''' 4r. attr_desc package_dirMapping[str, str] | Nonec|ptj}|d}|}d|}|pd}t |||}t||} tt|||S#t$r#t||}t||cYSwxYw)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 .r-) r^restripsplitpoprh _find_module _find_specgetattrrrE _load_spec) rrrP attrs_path attr_name module_namer_rr+s r, read_attrrs,&29;;H""((--J  I((:&&K+K  [( ; ;D k4 ( (D*|K66 BBB ***D+..vy)))))*s B***CCr module_pathrctj||}|ptj|}|t ||Sr!) importlibutilspec_from_file_location find_specModuleNotFoundError)rrrs r,rrsK > 1 1+{ K KD  89>++K88D |!+... Kr.rrct|d|}|tjvrtj|Stj|}|tj|<|j||S)NrI)rsysmodulesrrmodule_from_specloader exec_module)rrrr+s r,rrsi 4[ 1 1D s{{4  ^ , ,T 2 2FCKKF### Mr. str | Nonect||pi|tjfdtD}t d|DdS)aFind the path to the module named ``module_name``, considering the ``package_dir`` in the build configuration and ``root_dir``. >>> tmp = getfixture('tmpdir') >>> _ = tmp.ensure("a/b/c.py") >>> _ = tmp.ensure("a/b/d/__init__.py") >>> r = lambda x: x.replace(str(tmp), "tmp").replace(os.sep, "/") >>> r(_find_module("a.b.c", None, tmp)) 'tmp/a/b/c.py' >>> r(_find_module("f.g.h", {"": "1", "f": "2", "f.g": "3", "f.g.h": "a/b/d"}, tmp)) 'tmp/a/b/d/__init__.py' c3jK|]-}|tjd|fV.dS)r-Nru)r4ext path_starts r,r7z_find_module..s`%%     rw||J8H38H8HIIJ%%%%%%r.c3XK|]%}tj|!|V&dSr!)r^r_r)r4xs r,r7z_find_module..s5<>%%%J <zcmdclass..s+ R R R41aA}Q X66 R R Rr.)items)rrrPs ``r,cmdclassrs, S R R R R6<<>> R R RRr.) namespacesfill_package_dirrPrdict[str, str] | Nonec  ddlm}ddlm}m}|rddlm}nddlm}|p tj}| ddg}g} |in|}t||| t d kr9t fd d|fDr| d d D]} t|| } |j| fi|} | | | rX|d | ks?tj| |s||| | | S) 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_everseenrs)PEP420PackageFinder) PackageFinderwhererNrc3FK|]}td| VdS)rN) _same_path)r4rsearchs r,r7z find_packages../s4VVJvay!$<$< <VVVVVVr.)setuptools.discoveryrrzrrsrrr^curdirrlistlenall setdefault _nest_pathfindrigetr_samefiler()rrrPkwargsrrrsrrpackagesr_ package_pathpkgsrs @r, find_packagesr s0;:::::QQQQQQQQ7MMMMMMM666666$29H JJw & &EH-5rr;K ////%"8"899 : :F 6{{aCVVVVsHoVVVVV##Bq 222GG!(D11 !}!,99&99  G   $ $ , ,0@0@x0X0X ,  # #$9$9$$E$E F F F Or.parentr_c|dvr|ntj||}tj|S)N>rr)r^r_rhnormpath)rr_s r,rr>s;Y&&66BGLL,F,FD 7  D ! !!r.r3$Callable | Iterable[str | int] | strct|r |n|}t|tr|St|dr(dt t|Sd|zS)z`When getting the version directly from an attribute, it should be normalised to string. __iter__rz%s)callabler9rhasattrrhmap)r3_values r,versionrCsm! 2UUWWWUF&# vz""*xxC(())) &=r. package_datadictc>d|vr|d|d<|S)NrTr)r)rs r,canonic_package_datarPs+ l'++C00 R r. data_files list | dictlist[tuple[str, list[str]]]crt|tr|Sfd|DS)zFor compatibility with ``setup.py``, ``data_files`` should be a list of pairs instead of a dict. This function also expands glob patterns. c:g|]\}}|t|fSrM)ro)r4destrNrPs r, z&canonic_data_files..as<    D( }Xx001   r.)r9rr)rrPs `r,canonic_data_filesrVsT*d##    (..00   r. entry-pointstextdict[str, dict]ctdd}t|_|||d|D}||jd|S)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 delimiterscXi|]'\}}|t|(SrM)rr)r4rrs r,rz entry_points..qs, < < >> 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_valueCallable[[], Mapping[_K, _V]]c"||_d|_dSr!)_obtainr)r*r!s r,r-zLazyMappingProxy.__init__s+ .2 r.r/Mapping[_K, _V]cP|j||_|jSr!)rr$rs r,_targetzLazyMappingProxy._targets! ; ,,..DK{r.keyrrc6||Sr!)r')r*r(s r, __getitem__zLazyMappingProxy.__getitem__s||~~c""r.intcDt|Sr!)rr'rs r,__len__zLazyMappingProxy.__len__s4<<>>"""r. Iterator[_K]cDt|Sr!)iterr'rs r,rzLazyMappingProxy.__iter__sDLLNN###r.N)r!r")r/r%)r(rr/r)r/r+)r/r.) rIrJrKrLr-r'r*r-rrMr.r,rrs  3333 ########$$$$$$r.rr!)rNrOrPrQr/rR)rprqrPrQr/r)rpr~r/r)rrr/r)rrrPr)NN)rrrrrPrQ)rrrrQr/r)rrrrr/r)rrrrrPrr/r)rrrrrPrQr/r )rrrrrPrQr/r)rrrPrQr/rR)rrr_rr/r)r3rr/r)rrr/r)rrrPrQr/r)r)rrr/r)=rL __future__rr"rr^r$rglobr configparserrimportlib.machineryrr itertoolsrtypingr r r r r rrtypesrdistutils.errorsr_pathrrr discoveryrwarningsrsetuptools.distrrrrror}r{ryrxrrrrrrrrrrrrrrrMr.r,r=s(#"""""   %%%%%%8888888811111144444444))))))((((((-,,,,,, WT]] WTT"""PPPPPPPP89=DHL(EEEE -1##*#*#*#*#*LDDDD2-1# ' ' ' ' '$-1#SSSSS.2# 222222j""""    9="     #7#7#7#7#7#7#7#7L$$$$$wr2v$$$$$r.