bg2ddlZddlZddlZddlmZgdZejdZGddeZ GddeZ d Z d Z Gd d Z Gd dZdZdZdZdZd;dZd;dZiZd;dZedkrtddlmZddlZeZeddddedddded d!d"#ed$d%dd&ed'd(d)#ed*d+dd)ed,d-d.#eej\ZZ e!e d/kr e"d0ej#rBejd1Z$e$D]/Z%ee%Z&e'e&j(d2e&j(d3e&j)0e d4Z*ej+,d5Z-e-ree*d6d7e-gZ&nee*d6d7gZ&ej.rej.Z.nd8Z.ej/rWej0d9ej/Z1e1s e"d:e12d4Z(e12d/Z3e3e&j4e(<ej5re'e&5e.ej6re'e&6e.ej7re'e&j7ej8re'e&j7ej8kdSdSdS)<N)RawConfigParser) FormatError PkgNotFound LibraryInfo VariableSet read_config parse_flagsz\$\{([a-zA-Z0-9_-]+)\}ceZdZdZdZdZdS)rzQ Exception thrown when there is a problem parsing a configuration file. c||_dSNmsgselfrs q/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/numpy/distutils/npy_pkg_config.py__init__zFormatError.__init__ c|jSr r rs r__str__zFormatError.__str__ xrN__name__ __module__ __qualname____doc__rrrrrr s<rrceZdZdZdZdZdS)rz3Exception raised when a package can not be located.c||_dSr r rs rrzPkgNotFound.__init__rrc|jSr r rs rrzPkgNotFound.__str__rrNrrrrrrs8==rrcgggggd}d|zd}|D]d}d|z}t|dkrH|dr6|d|dd g|d r6|d |dd |d r6|d |dd |dr7|d|dd I|d|f|S)a Parse a line from a config file containing compile flags. Parameters ---------- line : str A single line containing one or more compile flags. Returns ------- d : dict Dictionary of parsed flags, split into relevant categories. These categories are the keys of `d`: * 'include_dirs' * 'library_dirs' * 'libraries' * 'macros' * 'ignored' ) include_dirs library_dirs librariesmacrosignored z --rz-Ir#Nz-Lr$z-lr%z-Dr&r')splitlen startswithappendstrip)linedflagsflags rr r s,Rb" & &A4Z  t $ $E * *Tz t99q==t$$ *.!((abb)9)9::::&& *.!((abb)9)9::::&& *+%%d122hnn&6&67777&& *( ""48>>#3#34444) ##D))) Hrc.|ddS)N\z\\)replace)vals r_escape_backslashr8Is ;;tV $ $$rc6eZdZdZd dZdZd dZd dZdZdS) ra$ Object containing build information about a library. Parameters ---------- name : str The library name. description : str Description of the library. version : str Version string. sections : dict The sections of the configuration file for the library. The keys are the section headers, the values the text under each header. vars : class instance A `VariableSet` instance, which contains ``(name, value)`` pairs for variables defined in the configuration file for the library. requires : sequence, optional The required libraries for the library to be installed. Notes ----- All input parameters (except "sections" which is a method) are available as attributes of the same name. Ncn||_||_|r||_ng|_||_||_||_dSr )name descriptionrequiresversion _sectionsvars)rr;r<r>sectionsr@r=s rrzLibraryInfo.__init__gsB &  $DMMDM ! rcNt|jS)z Return the section headers of the config file. Parameters ---------- None Returns ------- keys : list of str The list of section headers. )listr?keysrs rrAzLibraryInfo.sectionsr DN''))***rdefaultcv|j|j|d}t|S)Ncflagsr@ interpolater?r8rsectionr7s rrHzLibraryInfo.cflagss1i##DN7$;H$EFF %%%rcv|j|j|d}t|S)NlibsrIrKs rrNzLibraryInfo.libss1i##DN7$;F$CDD %%%rc(d|jzd|jzg}|jr|dn0|dd|jz|d|jzd|S)NzName: %szDescription: %sz Requires:z Requires: %s,z Version: %s )r;r<r=r.joinr>)rms rrzLibraryInfo.__str__s $) #%69I%I J = ? HH[ ! ! ! ! HH^chht}&=&== > > > -...yy||rr )rF) rrrrrrArHrNrrrrrrLsx4    +++ &&&&&&&&rrc<eZdZdZdZdZdZdZdZdZ dZ d S) ra Container object for the variables defined in a config file. `VariableSet` can be used as a plain dictionary, with the variable names as keys. Parameters ---------- d : dict Dict of items in the "variables" section of the configuration file. ctd|D|_i|_i|_|dS)Ncg|] \}}||f Srr).0kvs r z(VariableSet.__init__..s <<<$!Q1v<<._interpolatesDX]]__ @ @  Q??Lr)_VARsearch)rrgrknvalues` rrJzVariableSet.interpolateso     kk%   !\%((FE kk%     rcNt|jS)z Return the list of variable names. Parameters ---------- None Returns ------- names : list of str The names of all variables in the `VariableSet` instance. )rCr]rDrs r variableszVariableSet.variablesrErc|j|Sr )r])rr;s r __getitem__zVariableSet.__getitem__s~d##rcF||j|<|||dSr )r]rbrfs r __setitem__zVariableSet.__setitem__s*$t T5)))))rN) rrrrrr`rbrJrprrrtrrrrrs  '''###   +++"$$$*****rrc|dstdt|d}dD]}||vrtd|zd|vrg|d<|S)NmetazNo meta section found !)r;r<r>z6Option %s (section [meta]) is mandatory, but not foundr=) has_sectionrr[r\)configr1rXs r parse_metarys   f % %53444 V\\& ! !""A /%%Avv "#$%% % ??* Hrc|dstdi}|dD] \}}|||< t|S)NrpzNo variables section found !)rwrr\r)rxr1r;rgs rparse_variablesr{sb   k * *:8999 A||K00 e$ q>>rcttfSr )meta_dr)rxs rparse_sectionsrs 19rc d|zS)Nz%s.inir)pkg_names rpkg_to_filenamers h rc|rfd|D}ng}t}||}t|dkstdt |zt |}i}|dr-|dD]\}}t|||<d| D} i} i} | D]X} i} | | dr| | d| | <|| D] \}}|| |< | | | <Y||| | fS)NcPg|]"}tj|#Sr)ospathrR)rWr1filenames rrZz parse_config..s)===1RW\\!X..===rzCould not find file(s) %srpcg|]}|dv| S))rvrpr)rWss rrZz parse_config..s# K K K!5J0J0JA0J0J0Jrr=) rreadr,rstrryrwr\r8rA has_optionget)rdirs filenamesrxnrvr@r;rgsecsrAr=rr1s` r parse_configrs} ======= J   F IA q66Q;;5IFGGG f  D D +&&2!<< 44 2 2KD%*511DJJ L Kv(( K K KDHH     Q + + 4 **Q 33HQK!<<??  KD%AdGG x ))rc fd|\}}}}d|vr{d|vrw|d}|tjvrtd|d|dtj|}ttj|j|d<t|d|d|d|t| S) Ncdt|\}}}}|D]\}}t|\}}} } |D]\} } | |vr| || <| |D] \} }|r||| xxd|zz cc<!||||fS)Nz %s)rr\r)frvr@rAreqsrnamervaluenmetanvars nsectionsnreqsrXrYonameovalue _read_configrs rrz&_read_config_imp.._read_configs%1!T%:%:"dHd!ZZ\\ = =ME6-9\/&:Q:Q-R-R *E5)U   1DyyDG"+5!1!7!7!9!9 = = v=UOE***efn<*** =T8T))rpkgdirpkgnamezYou should import z to get information on r;r<r>)r;r<r>rAr@) sysmodules ValueErrorr8rrdirname__file__rr) rrrvr@rArrmodrs ` @r_read_config_imprs******$".i!8!8D$$ t   T 1 1y/#+%%*%ggtF||566 6k'"*27??3<+H+HIIX DLd=6IOh[=N=N P P PPrc t|S#t$r,tt||}|t|<|cYSwxYw)a Return library info for a package from its configuration file. Parameters ---------- pkgname : str Name of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini). dirs : sequence, optional If given, should be a sequence of directories - usually including the NumPy base directory - where to look for npy-pkg-config files. Returns ------- pkginfo : class instance The `LibraryInfo` instance containing the build information. Raises ------ PkgNotFound If the package is not found. See Also -------- misc_util.get_info, misc_util.get_pkg_info Examples -------- >>> npymath_info = np.distutils.npy_pkg_config.read_config('npymath') >>> type(npymath_info) >>> print(npymath_info) Name: npymath Description: Portable, core math library implementing C99 standard Requires: Version: 0.1 #random )_CACHEKeyErrorrr)rrrYs rrrFsVNg  _W55t < <ws 3AA__main__) OptionParserz--cflagsrH store_truez*output all preprocessor and compiler flags)destactionhelpz--libsrNzoutput all linker flagsz --use-sectionrLz/use this section instead of default for options)rrz --versionr>zoutput versionz--atleast-version min_versionzMinimal versionz --list-alllist_allz--define-variabledefine_variablez%Replace variable with the given valuer*z(Expect package name on the command line:z*.ini z - rNPY_PKG_CONFIG_PATHznumpy/core/lib/npy-pkg-config.rFz([\S]+)=([\S]+)zH--define-variable option should be of the form --define-variable=foo=barr )9rrdr configparserr__all__rerlOSErrorrrr r8rrryr{rrrrrrroptparserglobparser add_option parse_argsargvoptionsargsr,rrfilesrinfoprintr;r<renvironrr1rLrrmrSgrouprgr@rHrNr>rrrrrs" (((((( & & &rz+,,     '   '( ( ( T%%%FFFFFFFFPB*B*B*B*B*B*B*B*H     "*"*"*"*H"P"P"P"PP ,,,,f z%%%%%%KKK \^^F jx GIII hVL4666 oILNNN k ,+--- ) ,... lL,... )0ABDDD''11OWd s4yy1}}jCDDDL '"" L LA;q>>D E4999diii9I9IJ K K K KAwH ,--AM{8&EsA%NOO{8&Es%KLL/ BI('*A B B *BCC C771::DGGAJJE $~$ dkk'""###|" dii  !!! dl3 dlg1122222yv33r