bg] ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl mZddlmZddlZddlmZeZgZdZejegdZGddZd Zd Zd Zd Zd_d ZdZ d_dZ!dZ"dZ#dZ$d`dZ%dadZ&dZ'e're(ddddddddd Z)dbd"Z*ndcd#Z*d$Z+d%Z,d&Z-d'Z.d(Z/d)Z0d*e1d+e1fd,Z2d-Z3d.Z4d/Z5d0Z6ej7d1ej8j9Z:ej7d2ej8j9Z;ej7d3ej8j9Z<ej7d4ej8j9Z=d5Z>d6Z?d7Z@d8ZAd9ZBd:ZCd;ZDd<ZEd=ZFd>ZGd?ZHd@ZIdAZJdBZKdCZLdDZMdEZNdFZOdGZPdHZQdddIZRdJZSdKZTdedLZUGdMdNZVifdOZWdPZXdQZYd_dRZZd_dSZ[dTZ\dfdUZ]dVZ^dWZ_dXZ`dYZadZZbd[d\hZcd]Zdd^ZedS)gN)local)reduce)DistutilsErrorcvt/tD])} tj|#t$rY$wxYwdSdSN)_tmpdirsshutilrmtreeOSError)ds l/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/numpy/distutils/misc_util.pyclean_up_temporary_directoryrsa  A  a           s ' 44)* Configurationget_numpy_include_dirsdefault_config_dict dict_append appendpathgenerate_config_pyget_cmdallpath get_mathlibsterminal_has_colorsred_text green_text yellow_text blue_text cyan_text cyg2win32mingw32 all_strings has_f_sourceshas_cxx_sourcesfilter_sourcesget_dependenciesis_local_src_dirget_ext_source_filesget_script_filesget_lib_source_filesget_data_filesdot_join get_frame minrelpathnjoin is_sequence is_stringas_listgpaths get_languageget_build_architectureget_info get_pkg_infoget_num_build_jobssanitize_cxx_flagsexec_mod_from_locationceZdZdZdZdS)InstallableLiba Container to hold information on an installable library. Parameters ---------- name : str Name of the installed library. build_info : dict Dictionary holding build information. target_dir : str Absolute path specifying where to install the library. See Also -------- Configuration.add_installed_library Notes ----- The three parameters are stored as attributes with the same names. c0||_||_||_dSr)name build_info target_dir)selfr<r=r>s r __init__zInstallableLib.__init__Fs $$N)__name__ __module__ __qualname____doc__r@rAr r:r:0s-*%%%%%rAr:cnddlm} ttjd}n##t $rt j}YnwxYwt|d}ttj d|}|}||St| dddt| dddt| d ddf}td |Dr|Std |DS) a Get number of parallel build jobs set by the --parallel command line argument of setup.py If the command did not receive a setting the environment variable NPY_NUM_BUILD_JOBS is checked. If that is unset, return the number of processors on the system, with a maximum of 8 (to prevent overloading the system if there a lot of CPUs). Returns ------- out : int number of parallel jobs that can be run rget_distributionNPY_NUM_BUILD_JOBSNbuildparallel build_ext build_clibc3K|]}|duV dSrrF.0xs r z%get_num_build_jobs..ks& & &19 & & & & & &rAc3K|]}||V dSrrFrQs r rTz%get_num_build_jobs..ns"77177rA)numpy.distutils.corerIlenossched_getaffinityAttributeErrormultiprocessing cpu_countminintenvirongetgetattrget_command_objallmax)rIr\envjobsdistcmdattrs r r6r6LsK6555550,Q//00 000#-// 0Iq!!I"*..!5yAABBG    D |t++G44j$GGt++K88*dKKt++L99:tLLNG & &g & & &&&877g777777s!*A  A cddl}|dtdt|}t t |D] }||}d|vr|ddvrd|z||<!|S) z8Quote list of arguments. .. deprecated:: 1.22. rNz"quote_args" is deprecated. stacklevel z"'z"%s")warningswarnDeprecationWarninglistrangerW)argsrmias r quote_argsrups OOO MM/$444 ::D 3t99  ## G !88!E))lDG KrAcR|d}tjj|S)zDConvert a /-separated pathname to one using the OS's path separator./)splitrXpathjoin)r<rxs r rrs JJsOOE 7< rAcPtjtj|}tjtj|}t |t |kr|S||krdS||dt |krh|t |tjfvs,Jt ||t |f|t |dzd}|S)z$Return path relative to parent_path.N)rXryrealpathabspathrWseprepr)ry parent_pathpdapaths r rel_pathrs   "'//+66 7 7B G  RW__T22 3 3E 5zzCGG  {{r U8CGG8_SWW~"&)))4uSWW~0F+G+G)))SWWQYZZ  KrAcZ td|j|j}tjtj|}n#t$rtd|j|j}t|tj |}t|drBtjtj|j }ntjd}YnwxYw|t||}|pdS)zReturn path of the module given a frame object from the call stack. Returned path is relative to parent_path when given, otherwise it is absolute path. __file__rB.)eval f_globalsf_localsrXrydirnamer NameError __import__sysmoduleshasattrrr)framer caller_filer caller_namemods r get_path_from_framers%:uGG GOOBGOOK88 9 9  % % %:uGG ;k+& 3 # # % = =>>AA$$A % Q $ $ 8OsAAB7DDczg}|D]T}t|r|t|.t|sJ||U|}|sd}nt jj|}tjjdkr%|dtjj}t|S)a2Join two or more pathname components + - convert a /-separated pathname to one using the OS's path separator. - resolve `..` and `.` from path. Either passing n arguments as in njoin('a','b'), or a sequence of n names as in njoin(['a','b']) is handled, or a mixture of such arguments. r|rw) r.appendr-r/rXryrzrreplacer,)rypathspjoineds r r-r-s E  q>>  LL # # # #Q<<  < LLOOOO D %t$ w{cRW[11 f  rAcN|!tj|d}nht}|D]E}tj|d}tj|r|}nFt d|t |5}g}d}|D]j}||rS|t|d }|r(| | dk dddn #1swxYwY|S)z/Return the MATHLIB line from numpyconfig.h Nz_numpyconfig.hz/_numpyconfig.h not found in numpy include dirs z#define MATHLIB,) rXryrzrexistsropen startswithrWstripextendrx) ry config_filedirsfnfidmathlibsslinevalues r rrsz gll4)9:: &'' % %Dd$455Bw~~b!!   !.!T"$%% % k  6c  6 6Dq!! 6SVVWW ++--6OOEKK$4$4555  6666666666666666 OsA2DD!Dct|s|Sd|vr|S|tj}|r- |dd}n#t $rYn wxYw||=|-d}|rJ |d|}n#t $rYn&wxYw||dz dkr|dz }n ||=||dz =d}|J|sdStj|S)z$Resolve `..` and '.' from path. rr}z..r|)r/rxrXrindex ValueErrorrz)rylrsjs r r,r,s/ T??  $  26A  QAA    E  aD  A  a  AA    E  QqS64<< FAA!a!fA  r 6;;q>>s#A AA+B BBcDttj|S)z}sorts output of python glob for https://bugs.python.org/issue30461 to allow extensions to have reproducible build results)sortedglob)fileglobs r sorted_globrs $)H%% & &&rAcBt|s$Jtt|g}t|rJt||D]}t|rXd|vsd|vrt |}t t ||}|r||_|r||w|r||td|d|t ||}tj |r||tj |r||n|r||tj |std|d|kt|r&|t|||||d|DS)N*?zcould not resolve pattern in z: znon-existing path in c,g|]}t|SrF)r,)rRrs r z_fix_paths..-s - - -aJqMM - - -rA) r.rtyper/rr-rrprintrXryr _fix_paths)r local_pathinclude_non_existing new_pathsnrp2n2s r rr sG u  00tDKK0000 I,,e,,     Q<< axx3!88NN z1!5!566-$$R((((-$$Q''''+,!((+++E'ZZ,----:q))7>>"%% 1$$R((((w~~a((,!((++++-,!((+++7>>!,,1!+QQ0111^^   Z:7KLL M M M M   Q     - -9 - - --rAr|TcHt|r|f}t|||S)z:Apply glob to paths and prepend local_path if needed. )r/r)rrrs r r1r1/s. eZ)= > >>rAc*ttdsAtjt_t tjtj||tj|\}}tj |d}||fS)Ntempdir)suffixprefixdirtextw) r_tdatatempfilemkdtemprrrmkstemprXfdopen)rrrrr<fos r make_temp_filer6s| 69 % %(!)++''' (.%+^&*,,,IC 3  B t8OrAcDtjdkrdtjvrdSt tjdrtjr ddl}|| ddkr| ddkrk| d| d?| d | d | d d Sn#t$rYnwxYwdS) Ncygwin USE_COLORrisattycolorspairssetfsetbsetafsetabscpr}) rplatformrXr_rstdoutrcurses setuptermtigetnumtigetstr Exception)rs r rrCs |X+RZ"?"?qsz8$$ ):):)<)<   MMM      ))Q..OOG,,11oof--9 //&11=11=#__W55A..:q    D  1sB3D DDr}ri ) blackredgreenyellowbluemagentacyanwhitedefaultFcg}|r|d|rRdt|dz}|t ||rRdt|dz}|t ||rdd|d|d S|S) N1r(rz[;mz)r _colour_codesr`lowerstrrz)rfgbgboldseqfgcodebgcodes r colour_textras   JJsOOO  $-++BHHJJ:::F JJs6{{ # # #  $-++BHHJJ:::F JJs6{{ # # #   *-((3----; ;HrAc|SrrF)rrrs r rrpsrAc"t|dS)Nrrrs r default_textrss q) $ $$rAc"t|dS)Nrrrs r rrus q%  rAc"t|dS)Nrrrs r rrws q' " ""rAc"t|dS)Nrrrs r rrys q( # ##rAc"t|dS)Nrrrs r rr{ q& ! !!rAc"t|dS)Nrrrs r rr}r rAryreturncXtjdkr|Stjdd|gdS)a(Convert a path from Cygwin-native to Windows-native. Uses the cygpath utility (part of the Base install) to do the actual conversion. Falls back to returning the original path if this fails. Handles the default ``/cygdrive`` mount prefix as well as the ``/proc/cygdrive`` portable prefix, custom cygdrive prefixes such as ``/`` or ``/mnt``, and absolute paths such as ``/usr/src/`` or ``/home/username`` Parameters ---------- path : str The path to convert Returns ------- converted_path : str The converted path Notes ----- Documentation for cygpath utility: https://cygwin.com/cygwin-ug-net/cygpath.html Documentation for the C function it wraps: https://cygwin.com/cygwin-api/func-cygwin-conv-path.html rz/usr/bin/cygpathz --windowsT)r)rr subprocess check_output)rys r rrs<< |x  " [$/d   rActjdkrLtjdddkrdStjdddkrdSdS) z0Return true when using mingw32 environment. win32OSTYPEr|msysTMSYSTEMMINGW32F)rrrXr_r`rFrAr rrsV |W :>>(B ' ' / /4 :>>)R ( () 3 34 5rActjd}|dkr(ttj|dz|dz}nd}|S)zGReturn version of MSVC runtime library, as defined by __MSC_VER__ macrozMSC v.r N)rversionfindr^)msc_posmsc_vers r msvc_runtime_versionr sMkx((G"}}ck'!)GBJ"6788 NrAcFt}|r|dkrd|zSd|zSdS)zFReturn name of MSVC runtime library if Python was built with MSVC >= 7zmsvcr%iz vcruntime%iN)msvc_runtime_major)vers r msvc_runtime_libraryr%s8   C  99s? " 3& &trAcXdddddddtd}|S) zFReturn major version of MSVC runtime coded like get_build_msvc_versionFGPZdr")iiixii@ilN)r`r )majors r r#r#sB     c  $''   LrAz.*\.(cpp|cxx|cc)\Zz.*\.(f90|f95|f77|for|ftn|f)\Zz.*\.(f90|f95)\Zz\s*module\s*(?P[\w_]+)ct|sgSg}t|5}|D]=}t|}|r*|d}||> dddn #1swxYwY|S)zRReturn a list of Fortran f90 module names that given source file defines. r<N) f90_ext_matchrf90_module_name_matchgroupr)sourcerfrrr<s r _get_f90_modulesr3s   G f% % %D%d++A %wwvt$$$  %%%%%%%%%%%%%%%% NsAA11A58A5c,t|tSr) isinstancerrs r r/r/s a  rAc4|D]}t|sdSdS)z4Return True if all items in lst are string objects. FTr/)lstitems r r r s0 55  4rAclt|rdS t|n#t$rYdSwxYwdS)NFT)r/rWrrs r r.r.sN~~u C uu 4s # 11c0t|od|vpd|vS)Nrrr7rs r is_glob_patternr=s Q<< 2SAX12rAcDt|rt|S|gSr)r.rpr;s r r0r0s%3Cyyu rAcd}|D];}t|tr$t|rd}nt|rd}<|S)z2Determine language value (c,f77,f90) from sources Nf90f77)r5rr.fortran_ext_match)sourceslanguager1s r r2r2s_H!! fc " " !V$$ ! "6** !  OrAc4|D]}t|rdSdS)z.Return True if sources contains Fortran files TF)rBrCr1s r r!r!s2 V $ $ 44  5rAc4|D]}t|rdSdS)z*Return True if sources contains C++ files TF) cxx_ext_matchrFs r r"r"s2   44  5rAc4g}g}g}g}|D]}t|r=t|}|r||8||Nt|r||s||||||fS)ztReturn four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively. )rBr3rrH)rC c_sources cxx_sources f_sourcesfmodule_sourcesr1rs r r#r#s IKIO % % V $ $ %&v..G )&&v....  (((( 6 " " %   v & & & &   V $ $ $ $ k9o ==rAcg}|D]D}ttj|d}||E|S)Nz*.h)rrXryrzr)directory_listheadersr heads r _get_headersrR5sMG 27<<51122t NrAcg}|D]R}tj|}|ddkr%|d|vr||dS|S)Nrr|)rXryrxr)list_of_sourcesdirecsr2r s r _get_directoriesrV=s^ F    GMM!   Q42::adfnn MM!A$    MrAcd}|d|z }|d|z }|d|dzz }|S)zb Return commandline representation used to determine if a file needs to be recompiled z commandline: rl rz)cc_argsextra_postargspp_optscmdlines r _commandline_dep_stringr^FsU G sxx   G sxx'''G sxx  4''G NrAc:tt|Sr)rRrV)rCs r r$r$Rs (11 2 22rAct|sdStj|}tjtj|g}|t |dtj}|r|ds |dd}|r|ddkrdStj |}tj |S)z1Return true if directory is local directory. FNrr}rL) r/rXryr commonprefixgetcwdrWrxrrzisdir) directoryabs_dircnew_dirs r r%r%Vs Y  ugooi((G bikk7344Ac!ffgg$$RV,,Gwqz!""+71:w&&ufkk'""G 7== ! !!rAc#Kddddtjd}tj|dD]W\}}}fd|D}||dd<|D]9}||s"tj||V:XdS)Nr}CVS.svnrL(?:[~#]|\.py[co]|\.o)$Ttopdowncg|]}|v| SrFrFrRr pruned_directoriess r rz(general_source_files..i$GGG!3E*E*E1*E*E*ErA)recompilerXwalksearchryrz)top_pathprune_file_patdirpathdirnames filenamesprunedr2rqs @r general_source_filesr}es !!Q77Z 9::N(*$(G(G(G//$9GGGGhGGG  / /A!((++ /gll7A..... ///rAc# Kgd tjd tj|dD]\}}} fd|D}||dd<|D]}tj|| t |}g}tj D]k}tj |} tj| r* | s| | l||fV| t |} fdtj D}d|D}||fVdS) zJReturn a directory name relative to top_path and files contained. rirlTrmcg|]}|v| SrFrFrps r rz4general_source_directories_files..vrrrANczg|]7}|tj|8SrF)rvrXryrz)rRr2dpathrxs r rz4general_source_directories_files..sK222A&--a002eQ''222rAcPg|]#}tj|!|$SrF)rXryisfile)rRr2s r rz4general_source_directories_files..s+ 7 7 71RW^^A%6%6 7Q 7 7 7rA) rsrtrXruryrzrlistdirrrvr) rwryrzr{r|r rpathfilesr2rrrxrqs @@@r general_source_directories_filesros211Z 9::N(*$(G(G(G  $9GGGGhGGG   AGLL!,,EUH--EEZ&& % %W\\%++7>>"%%%n.C.CB.G.G%LL$$$,      E UH % %E22222E1B1B222I 7 7 7 7 7E ,rAcg}d|jD}|||t||jD]u}t |r0|t t |Atj |r| |v|S)Nc0g|]}t||SrFr7rR_ms r rz(get_ext_source_files..s#999b9R==9r999rA) rCrr$dependsr%rpr}rXryrr)extr{rCr s r r&r&sI99CK999G W %g../// [   A     T"6q"9"9:: ; ; ; ; W^^A     Q    rAcd|D}|S)Nc0g|]}t||SrFr7rs r rz$get_script_files..#555by}}5r555rArF)scriptss r r'r's55G555G NrAcg}|ddg}d|D}|||t||ddg}|D]u}t|r0|t t |At j|r| |v|S)Nr}rCc0g|]}t||SrFr7rs r rz(get_lib_source_files..rrAr) r`rr$r%rpr}rXryrr)libr{rCrr s r r(r(sI!fjjB''G55G555G W %g..///!fjjB''G    A     T"6q"9"9:: ; ; ; ; W^^A     Q    rActj}|dd}|stjdstjdrd}nutjdrd}nStjdrd }n1d |vr-|d |d zdd }|S) aReturn the correct file extension for shared libraries. Parameters ---------- is_python_ext : bool, optional Whether the shared library is a Python extension. Default is False. Returns ------- so_ext : str The shared library extension. Notes ----- For Python shared libs, `so_ext` will typically be '.so' on Linux and OS X, and '.pyd' on Windows. For Python >= 3.2 `so_ext` has a tag prepended on POSIX systems according to PEP 3149. EXT_SUFFIXr|linux gnukfreebsdz.sodarwinz.dylibwinz.dllSOABIrr}) distutils sysconfigget_config_varsr`rrrr) is_python_extconfvarsso_exts r get_shared_lib_extensionrs("2244H \\, + +F L L # #G , , L L # #M 2 2 LFF \ $ $X . . LFF \ $ $U + + LFF(""hll7.C.C(CRKK MrAct|r|gS|d}g}|D]}t|drt|r0|t t |Rt|rFt j|r| |td|tt||S)Nr}__call__zNot existing data file:) r/rr%rrpr}rXryrrr TypeErrorr)datarCr{rs r r)r)sv 1gGI  % % 1j ! !   A   %   T"6q"9"9:: ; ; ; ; q\\ %w~~a   4  ####/3333DGG$$ $ rAc@dd|DS)Nrcg|]}||SrFrF)rRrts r rzdot_join..s***1*Q***rArY)rrs r r*r*s# 88***** + ++rAc tj|dzS#t$r?tjdj}t |dzD] }|j} |cYSwxYw)z:Return frame object from call stack with given level. r}ri)r _getframerZexc_infotb_framerqf_back)levelr_s r r+r+st}U1W%%%  q!*uQw ! !ALEE sAA"!A"c>eZdZgdZddgZddgZgZ d2d Zd Zd Z d Z d Z dZ d3dZ d3dZ d4dZ d5dZdZdZdZdZdZdZdZdZdZdZdZd6dZd6d Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd7d+Z(d8d-Z)d8d.Z*d9d0Z+d1Z,dS):r) packages ext_modules data_files include_dirs librariesrPr py_modulesinstalled_libraries define_macros package_dirinstalled_pkg_configr<rNr}setup.pyc ht|||_d|_t|}t |||_||j}d|_||j}nGt jt|j|rt|j|}t j|pdst|d||_ ||_ t jj |jd|_|jdd|_|jdd|_|jD]H} t)j|| g} t-|| t/| I|jD];} t)j|| i} t-|| | <|j|jz} |jdd|_|D]} | | vr|| } t-|| | t7| t8r|j| Pt7| t<r|j| |j| t jt|dr.|j |j||j!|j<t=dddd|_"d} tGdd D]Q} t|}n#t$rYn2wxYw tId |j%|j&} n#tN$rYNwxYwt7| |j(r| j"d r|j)d i| j"||_*dS) aConstruct configuration instance of a package. package_name -- name of the package Ex.: 'distutils' parent_name -- name of the parent package Ex.: 'numpy' top_path -- directory of the toplevel package Ex.: the directory where the numpy package source sits package_path -- directory of package. Will be computed by magic from the directory of the caller module if not specified Ex.: the directory where numpy.distutils is caller_level -- frame level to caller namespace, internal parameter. Nr|rz is not a directory __init__.pyF)ignore_setup_xxx_pyassume_default_configurationdelegate_options_to_subpackagesquietr}rr?rrF)+r*r<rr+rrrXryrcr-rrw package_pathrzrxpath_in_package _list_keys list_keys _dict_keys dict_keyscopyr`setattrr0 _extra_keys extra_keyskeysr5rprdictrrroptionsrqrrrr __class__ set_options setup_name)r? package_name parent_namerwr caller_levelrattrs caller_framerv known_keysrtcaller_instancersr2s r r@zConfiguration.__init__s*[,77   .. -lHEE  H DO  ?LL W]]5,?? @ @ @ ,??Lw}}\0S11 H FGG G  (!w|TY__S-A-AB++ ) )A %))Ar**++A D!WQZZ ( ( ( (  A %))Ar**++A D!Q    ^dn4 *111- * *AJaA D!Q   !T"" *%%a((((At$$ *%%a((((&&q)))) 7>>% m<< = = 7 M  + + +*6D TY '"'+0.3  q!  A aLL     "&vq{AJ"G"G     ot~ 6 6 <&'HI <  ;;?#:;;;$s$(L88 MM M'' M43M4c|i}|j|jz|jz}|D]}t ||}|r|||<|S)z Return a dictionary compatible with the keyword arguments of distutils setup function. Examples -------- >>> setup(**config.todict()) #doctest: +SKIP )_optimize_data_filesrrrra)r?r rrrts r todictzConfiguration.todictbse !!### ^dn4tF   Aa  A !rAcB|jdst|dSdS)Nr)rrr?messages r infozConfiguration.infous*|G$  'NNNNN  rAcLtjd|ddS)Nz Warning: rX)rstderrwriters r rnzConfiguration.warnys( GGG566666rAc |D]*\}}||jvr ||j|<td|zdS)z Configure Configuration instance. The following options are available: - ignore_setup_xxx_py - assume_default_configuration - delegate_options_to_subpackages - quiet zUnknown option: N)itemsrr)r?rkeyrs r rzConfiguration.set_options|sY"--// 9 9JCdl""$) S!! !3C!7888  9 9rAc"ddlm}|S)z2Return the distutils distribution object for self.rrH)rVrI)r?rIs r rIzConfiguration.get_distributions#999999!!!rAc0|d}t|jg|z}dt|D}g}|D]}tjt|ds0d|tjvrRd|tjt| d} | | ||dz} | | |S)NrcPg|]#}tj|!|$SrF)rXryrcrs r rz:Configuration._wildcard_get_subpackage..s+OOOrRW]]2=N=NOOOOrArrLr}rr) rxr-rrrXryrrrzrWget_subpackager) r?subpackage_namerrrsubpackage_pathr config_listr rrfs r _wildcard_get_subpackagez&Configuration._wildcard_get_subpackages  ! !# & & 1! 344OO[99OOO  " "A7>>%="9"9:: !''"&//))#a&&233A##A2=3?>$CCA   q ! ! ! !rActjdtj| tjtj|d}t|j||}td | d|}t|dsB|j ds|d|zt|||j||dz} nUt|g| ddd z} | f} |jjjdkr | |jfz} |j| } | jt||kr.|d t||d | jtjd=n#tjd=wxYw| S) Nrrr configurationrzCAssuming default configuration (%s does not define configuration())r}rrz Subpackage z configuration returned as )rryinsertrXrsplitextbasenamer*r<r8rzrxrrrnrrwr__code__ co_argcount) r?setup_pyrrrrrr setup_moduleconfigpnrrs r _get_configuration_from_setup_pyz.Configuration._get_configuration_from_setup_pys 27??844555 ))"'*:*:8*D*DEEaHJOZ@@A1 # 6 6BBL<99 ;|$BC0IIE!-/000' '+}o6BQ6FHHH 0E0Ec0J0J3B30O OQu-6BQFF4="22D33T:{H[/BBBB #KAAAA6;;PQQQ  OOOO s E? J W__X6666IJJJ#?K#'=/2>q.BBBFF::+a/ ;11F  8OIrAFc0|rd}n|j}||||d}|s|d|D]}|}t|tr|}t|t s$Jtt|| d| dd|j|j d i|| }||d|zdSdS) aAdd a sub-package to the current Configuration instance. This is useful in a setup.py script for adding sub-packages to a package. Parameters ---------- subpackage_name : str name of the subpackage subpackage_path : str if given, the subpackage path such as the subpackage is in subpackage_path / subpackage_name. If None,the subpackage is assumed to be located in the local path / subpackage_name. standalone : bool Nrirz0No configuration returned, assuming unavailable.z Appending r<z configuration to zTdistutils distribution has been initialized, it may be too late to add a subpackage rF) r<rrnr5rrrrrrr`rrI) r?rr standalonerrrr rfs r add_subpackagezConfiguration.add_subpackages\&  $KK)K))/?8C9:*<<  J IIH I I I! " "FA&-00 $MMOOa&& 5 5T!WW 5 5& IIIv 3 4 4 4 D  ! !q ! ! ! !$$&&   IIABQR S S S S S  rAc t|r|\}ndt|rfd|DdSt|std|jtj|r4tj||fS||fS|d}t|rPtr"t tj }| ttt!|dz }| |D] }||s||=|D]}tj|st%d|3t'|j}| tj }| g} d}|D]} t| rD|t!|krt+d d || ||nD| ||ks#Jt/| |||||f| | |dz }||drd |d || tj | |fn|D]}|fdStrJt/} | | j| j} nj} |D]a}tt9|D]B\} }tjj| }| ||fCbdS) aRecursively add files under data_path to data_files list. Recursively add files under data_path to the list of data_files to be installed (and distributed). The data_path can be either a relative path-name, or an absolute path-name, or a 2-tuple where the first argument shows where in the install directory the data directory should be installed to. Parameters ---------- data_path : seq or str Argument can be either * 2-sequence (, ) * path to data directory where python datadir suffix defaults to package dir. Notes ----- Rules for installation paths:: foo/bar -> (foo/bar, foo/bar) -> parent/foo/bar (gun, foo/bar) -> parent/gun foo/* -> (foo/a, foo/a), (foo/b, foo/b) -> parent/foo/a, parent/foo/b (gun, foo/*) -> (gun, foo/a), (gun, foo/b) -> gun (gun/*, foo/*) -> parent/gun/a, parent/gun/b /foo/bar -> (bar, /foo/bar) -> parent/bar (gun, /foo/bar) -> parent/gun (fun/*/gun/*, sun/foo/bar) -> parent/fun/foo/gun/bar Examples -------- For example suppose the source directory contains fun/foo.dat and fun/bar/car.dat: >>> self.add_data_dir('fun') #doctest: +SKIP >>> self.add_data_dir(('sun', 'fun')) #doctest: +SKIP >>> self.add_data_dir(('gun', '/full/path/to/fun'))#doctest: +SKIP Will install data-files to the locations:: / fun/ foo.dat bar/ car.dat sun/ foo.dat bar/ car.dat gun/ foo.dat car.dat Nc>g|]}|fSrF) add_data_dir)rRrr r?s r rz.Configuration.add_data_dir..ks+ : : :1T  1v & & : : :rAznot a string: Frr}zNot a directory, skippingrzcannot fill pattern z with zmismatch of pattern_list=z and path_list=)r.r/rrXryisabsrrrr=rrxrreverserprqrWrcrrrrrrrnrzrIrrr)r? data_pathr pattern_listrlrsryr path_list target_listrrfrd1r2 target_pathr s` @r rzConfiguration.add_data_dir.s>p y ! ! $LAyyA y ! !  : : : : : : : : : F## ?)))=>> > 9w}}Y'' S(("'*:*:9*E*Ey)QRRR$$i%;<< < 95 AA 9 % %% q!!# 1&qzz//77 $$&&&%L 1 1! 34455rzz|||,,A'?,(O!HHD7==..!94@@@ $T4?;;E % BF 3 3I%%'''"$KA)  *1--2 #i..00&0j)*DD22'3'3!3'..y|<<<<#$il???D!Yq\9VWY]_d9e4f4f???'..q111Q }? %1\\99#>???'')))%%rv{{;'?'?&FGGGG/H2"11D%%q$i0000 F"1%%..tAww..%$$&&   ;JJJ 4 4D>tDDEE 4 4A gll4+?BGG !!;"23333 4 4 4rAci}|jD]:\}}||vrt||<|D]}|||;d|D|jdd<dS)Nc6g|]\}}|t|fSrF)rp)rRrrs r rz6Configuration._optimize_data_files..s'QQQ81eq$u++.QQQrA)rsetaddr)r? data_dictrrr2s r rz"Configuration._optimize_data_filess  $ $HAu !!"uu !  $ $!   #### $QQy?P?PQQQrAct|dkr|D]}||dSt|dksJt|dr |d\}}nd}t|r|}nrt|r:t|dkr |d}nG|D]}|||fdSt t t ||mt|drd}nAtj |rd}ntj |}|||fdS| |d}t|r?t|r|tj}||D]}|tj}||g} d} |D]G} t| r!| || | dz } 2| | H| |tj| |fn|||fdSt|rJt ||f|} | | j| j} n|j} | tj |j||fdS)aAdd data files to configuration data_files. Parameters ---------- files : sequence Argument(s) can be either * 2-sequence (,) * paths to data files where python datadir prefix defaults to package dir. Notes ----- The form of each element of the files sequence is very flexible allowing many combinations of where to get the files from the package and where they should ultimately be installed on the system. The most basic usage is for an element of the files argument sequence to be a simple filename. This will cause that file from the local path to be installed to the installation path of the self.name package (package path). The file argument can also be a relative path in which case the entire relative path will be installed into the package directory. Finally, the file can be an absolute path name in which case the file will be found at the absolute path name but installed to the package path. This basic behavior can be augmented by passing a 2-tuple in as the file argument. The first element of the tuple should specify the relative path (under the package install directory) where the remaining sequence of files should be installed to (it has nothing to do with the file-names in the source distribution). The second element of the tuple is the sequence of files that should be installed. The files in this sequence can be filenames, relative paths, or absolute paths. For absolute paths the file will be installed in the top-level package installation directory (regardless of the first argument). Filenames and relative path names will be installed in the package install directory under the path name given as the first element of the tuple. Rules for installation paths: #. file.txt -> (., file.txt)-> parent/file.txt #. foo/file.txt -> (foo, foo/file.txt) -> parent/foo/file.txt #. /foo/bar/file.txt -> (., /foo/bar/file.txt) -> parent/file.txt #. ``*``.txt -> parent/a.txt, parent/b.txt #. foo/``*``.txt`` -> parent/foo/a.txt, parent/foo/b.txt #. ``*/*.txt`` -> (``*``, ``*``/``*``.txt) -> parent/c/a.txt, parent/d/b.txt #. (sun, file.txt) -> parent/sun/file.txt #. (sun, bar/file.txt) -> parent/sun/file.txt #. (sun, /foo/bar/file.txt) -> parent/sun/file.txt #. (sun, ``*``.txt) -> parent/sun/a.txt, parent/sun/b.txt #. (sun, bar/``*``.txt) -> parent/sun/a.txt, parent/sun/b.txt #. (sun/``*``, ``*``/``*``.txt) -> parent/sun/c/a.txt, parent/d/b.txt An additional feature is that the path to a data-file can actually be a function that takes no arguments and returns the actual path(s) to the data-files. This is useful when the data files are generated while building the package. Examples -------- Add files to the list of data_files to be included with the package. >>> self.add_data_files('foo.dat', ... ('fun', ['gun.dat', 'nun/pun.dat', '/tmp/sun.dat']), ... 'bar/cat.dat', ... '/full/path/to/can.dat') #doctest: +SKIP will install these data files to:: / foo.dat fun/ gun.dat nun/ pun.dat sun.dat bar/ car.dat can.dat where is the package (or sub-package) directory such as '/usr/lib/python2.4/site-packages/mypackage' ('C: \Python2.4 \Lib \site-packages \mypackage') or '/usr/lib/python2.4/site- packages/mypackage/mysubpackage' ('C: \Python2.4 \Lib \site-packages \mypackage \mysubpackage'). r}Nrrr|Fr)rWadd_data_filesr.r/rrrrrXryrrrr=rxrrpoprrzrIrr)r?rr2r filepatrrryr r rsrrfrs r rzConfiguration.add_data_filessXp u::a<< ' '##A&&&& F5zz1}}}} uQx  QxHAuuA U   /GG    /5zz1}}(00A''A////De--.. . 9w ++ -w'' -GOOG,,   E + + + F 7 ?? 7 # # q!! 0 wwrv $$&&&! J JD $ 26 2 2I%%'''MMOOO"$KA)22*1--2'..y|<<<FAA'..q1111'')))''[)A)A4(HIIII J##QJ/// F"1%%99tQL'9'999%$$&&   ;JJJ27<<(// directory. If an item of files is a tuple, then its first argument specifies the actual installation location relative to the path. Parameters ---------- files : str or seq Argument(s) can be either: * 2-sequence (,) * path(s) to header file(s) where python includedir suffix will default to package name. cHg|]}j|fSrF)rr<)rRrrPr?s r rz-Configuration.add_headers..~s+JJJAA//JJJrAricJg|]}d|f Sr)r)rRrrPrys r rz-Configuration.add_headers..s-KKK!a! --KKKrAr}N) r/rr5tuplerprWrrrIrPr)r?rrfrPrys` @@r add_headerszConfiguration.add_headersis$ L LD LJJJJJD9I9IJJJJJ!$ 660#d))q..#DJJ///KKKKKtzz$q'7J7JKKKKK$$&&  |#! L   ( ( ( ( ( L   ( ( ( ( (rAc\|dd}t||j|S)aApply glob to paths and prepend local_path if needed. Applies glob.glob(...) to each path in the sequence (if needed) and pre-pends the local_path if needed. Because this is called on all source lists, this allows wildcard characters to be specified in lists of sources for extension modules and libraries and scripts and allows path-names be relative to the source directory. rT)rr)r`r1r)r?rkwsrs r rzConfiguration.pathss> #ww'=tDDe#'?+?AAA ArAc|D](}||}|dvr||}|||<)dS)N)rCrr library_dirs module_dirs extra_objects)rr)r?kwkrnew_vs r _fix_paths_dictzConfiguration._fix_paths_dictsW  A1A555 1 1   rAc ptj|}t|j||d<||d<d|vra|d}|d=t|tr|g}|D];}t|tsJt |t |fi|<|||dg}g}g|d<|D]d} t| tr|| dd| vr| dd\} } tj t|j| } tj | r|d| d } t| t$r| } d | dgDD]I} | d dd }|| kr%| ddt |fi| nJO|| f||dz|d<|j|d gz|d <d dlm}|di|}|j||}||d|z|S)aAdd extension to configuration. Create and add an Extension instance to the ext_modules list. This method also takes the following optional keyword arguments that are passed on to the Extension constructor. Parameters ---------- name : str name of the extension sources : seq list of the sources. The list of sources may contain functions (called source generators) which must take an extension instance and a build directory as inputs and return a source file or list of source files or None. If None is returned then no sources are generated. If the Extension instance has no sources after processing all source generators, then no extension module is built. include_dirs : define_macros : undef_macros : library_dirs : libraries : runtime_library_dirs : extra_objects : extra_compile_args : extra_link_args : extra_f77_compile_args : extra_f90_compile_args : export_symbols : swig_opts : depends : The depends list contains paths to files or directories that the sources of the extension module depend on. If any path in the depends list is newer than the extension module, then the module will be rebuilt. language : f2py_options : module_dirs : extra_info : dict or list dict or list of dict of keywords to be appended to keywords. Notes ----- The self.paths(...) method is applied to all lists that may contain paths. r<rC extra_inforr}@Nrircg|] }|d SrrF)rRrs r rz/Configuration.add_extension..sCCCqadCCCrA__OF__rr ExtensionzTdistutils distribution has been initialized, it may be too late to add an extension rF)rr*r<r5rrrr+r`r rxrXryrr-rrcrrrrrrrVr2rrIrn)r?r<rCr(ext_argsr-rrlibnameslibnamelnamelpathrfrllnamer2rrfs r add_extensionzConfiguration.add_extensions`9R==#DIt44% 8 # #!,/J&*d++ *(\ " - -!$--99tDzz99-H,,t,,,, X&&&LLb11  "  % %G'5)) 1$$WQZ000g~~&}}S!44 udou(E(EFF7=='' ++D%;<,>>A!!]33'HHJJCCAEE+r,B,BCCC""!"1!5!5a!8!U??EE&$///'551555!E+ OOG $ $ $ $ (8K+@ @  or!B!B B ! 322222i##(## $$$$$&&   IIAAEF G G G rAc |||d||}||d|zdSdS)a Add library to configuration. Parameters ---------- name : str Name of the extension. sources : sequence List of the sources. The list of sources may contain functions (called source generators) which must take an extension instance and a build directory as inputs and return a source file or list of source files or None. If None is returned then no sources are generated. If the Extension instance has no sources after processing all source generators, then no extension module is built. build_info : dict, optional The following keys are allowed: * depends * macros * include_dirs * extra_compiler_args * extra_f77_compile_args * extra_f90_compile_args * f2py_options * language NzQdistutils distribution has been initialized, it may be too late to add a library ) _add_libraryrIrn)r?r<rCr=rfs r add_libraryzConfiguration.add_library sp: $z:::$$&&   II>?CD E E E E E  rActj|}||d<d|vrg|d<|||j||fdS)z\Common implementation for add_library and add_installed_library. Do not use directlyrCrN)rr+rrr?r<rC install_dirr=s r r;zConfiguration._add_library-skYz** ' 9J&&$&Jy ! Z((( tZ011111rAc|si}tj|j|}||||||jt|||dS)aQ Similar to add_library, but the specified library is installed. Most C libraries used with `distutils` are only used to build python extensions, but libraries built through this method will be installed so that they can be reused by third-party packages. Parameters ---------- name : str Name of the installed library. sources : sequence List of the library's source files. See `add_library` for details. install_dir : str Path to install the library, relative to the current sub-package. build_info : dict, optional The following keys are allowed: * depends * macros * include_dirs * extra_compiler_args * extra_f77_compile_args * extra_f90_compile_args * f2py_options * language Returns ------- None See Also -------- add_library, add_npy_pkg_config, get_info Notes ----- The best way to encode the options required to link against the specified C libraries is to use a "libname.ini" file, and use `get_info` to retrieve the required options (see `add_npy_pkg_config` for more information). N)rXryrzrr;rrr:r>s r add_installed_libraryz#Configuration.add_installed_library=smX Jgll4#4kBB  $jAAA  ''tZ(U(UVVVVVrAc|i}tj|j|}|j|jvr*|j|j|||fdS|||fg|j|j<dS)a Generate and install a npy-pkg config file from a template. The config file generated from `template` is installed in the given install directory, using `subst_dict` for variable substitution. Parameters ---------- template : str The path of the template, relatively to the current package path. install_dir : str Where to install the npy-pkg config file, relatively to the current package path. subst_dict : dict, optional If given, any string of the form ``@key@`` will be replaced by ``subst_dict[key]`` in the template file when installed. The install prefix is always available through the variable ``@prefix@``, since the install prefix is not easy to get reliably from setup.py. See also -------- add_installed_library, get_info Notes ----- This works for both standard installs and in-place builds, i.e. the ``@prefix@`` refer to the source directory for in-place builds. Examples -------- :: config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': bar}) Assuming the foo.ini.in file has the following content:: [meta] Name=@foo@ Version=1.0 Description=dummy description [default] Cflags=-I@prefix@/include Libs= The generated file will have the following content:: [meta] Name=bar Version=1.0 Description=dummy description [default] Cflags=-Iprefix_dir/include Libs= and will be installed as foo.ini in the 'lib' subpath. When cross-compiling with numpy distutils, it might be necessary to use modified npy-pkg-config files. Using the default/generated files will link with the host libraries (i.e. libnpymath.a). For cross-compilation you of-course need to link with target libraries, while using the host Python installation. You can copy out the numpy/core/lib/npy-pkg-config directory, add a pkgdir value to the .ini files and set NPY_PKG_CONFIG_PATH environment variable to point to the directory with the modified npy-pkg-config files. Example npymath.ini modified for cross-compilation:: [meta] Name=npymath Description=Portable, core math library implementing C99 standard Version=0.1 [variables] pkgname=numpy.core pkgdir=/build/arm-linux-gnueabi/sysroot/usr/lib/python3.7/site-packages/numpy/core prefix=${pkgdir} libdir=${prefix}/lib includedir=${prefix}/include [default] Libs=-L${libdir} -lnpymath Cflags=-I${includedir} Requires=mlib [msvc] Libs=/LIBPATH:${libdir} npymath.lib Cflags=/INCLUDE:${includedir} Requires=mlib N)rXryrzrr<rr)r?templater? subst_dicts r add_npy_pkg_configz Configuration.add_npy_pkg_configps~  J7<< 18<< 91 1 1  %di 0 7 7;9     6>{54D %di 0 0 0rAc||}|}|*|jg|_|j|dS|j|dS)zAdd scripts to configuration. Add the sequence of files to the beginning of the scripts list. Scripts will be installed under the /bin/ directory. N)rrIrr)r?rrrfs r add_scriptszConfiguration.add_scriptsss**U##$$&&  |#! L   ( ( ( ( ( L   ( ( ( ( (rAc 0|jD];}t||}|||g<|jD];}t||}|||i<|j|jz|jz}|D]}||vrt||d}|r |||kr&|d|d||d|ddt|||||j |||jvr4| d|dt||d||d ||vrtd |zdS) NzInheriting attribute =z from r<rzIgnoring attempt to set z (from z to )zDon't know about key=%r) rrarr`rupdaterrrnrrrr)r?rrrtrs r rzConfiguration.dict_appends> ( (Cc""A HHTXXc2&& ' ' ' '> ( (Cc""A HHTXXc2&& ' ' ' '^dn4tF 99;; D DC*$$D#t,,/DIx  SS$s)))TXXfc-B-B-BDEEEc49---&&s++++''  SS'$"4"4"4"4d3iiiABBBB "" !:c!BCCC D DrAcddlm}|j|jz|jz}d}|d|jzdzz }||D])}t||d}|r||d||dz }*|dz }|S) Nr)pformatz<----- zConfiguration of z: z = rXz----->)pprintrMrrrr<sortra)r?rMrrr)rts r __str__zConfiguration.__str__s""""""^dn4tF   *5 00 3 3Aa&&A 3AAAwwqzzzz22 [rAc td}|d|_d|_tjd}|r0tjd|g}|tjd<|S)zF Returns the numpy.distutils config command instance. rrPATHr) rensure_finalized dump_sourcenoisyrXr_r`pathseprz)r?cmdold_pathrys r get_config_cmdzConfiguration.get_config_cmdsth  :>>&))  &:??C?33D!%BJv  rAcVtd}||jS)zh Return a path to a temporary directory where temporary files should be placed. rL)rrS build_temp)r?rWs r get_build_temp_dirz Configuration.get_build_temp_dirs+ g ~rAc`d}|}||d}|S)aSCheck for availability of Fortran 77 compiler. Use it inside source generating function to ensure that setup distribution instance has been initialized. Notes ----- True if a Fortran 77 compiler is available (because a simple Fortran 77 code was able to be compiled successfully). / subroutine simple end rAlangrY try_compiler?simple_fortran_subroutine config_cmdflags r have_f77czConfiguration.have_f77c(;% !((** %%&?e%LL rAc`d}|}||d}|S)aRCheck for availability of Fortran 90 compiler. Use it inside source generating function to ensure that setup distribution instance has been initialized. Notes ----- True if a Fortran 90 compiler is available (because a simple Fortran 90 code was able to be compiled successfully) r^r@r_rarcs r have_f90czConfiguration.have_f90c;rhrAc@t|r#|\}}t||j|jdSddlm}t ||sJt||j|j|j|jdS)zEAppend libraries, include_dirs to extension or library item. )rrrr1N) r.rrrrVr2r5rr)r?extliblib_namer=r2s r append_tozConfiguration.append_toNs v   :#) Hj  "&.%)%6 8 8 8 8 8 8 7 6 6 6 6 6fi00 > >$v,, > >0   # #DN 3 3 3   & &t'8 9 9 9 9 9rAc> tjdg|}tjd|}|r"t |dSn#tjtf$rYnwxYwtj dkr2tj ddrt|dd }nt|d d }tj|rt!|5}|}dddn #1swxYwY|dd d kr:tjd |}|r"t |dSn9tjd|}|r"t |dSdS)z+Return path's SVN revision number. svnversioncwd(?P\d+)revisionrSVN_ASP_DOT_NET_HACKN_svnentriesrkrz\d+)"zdir[\n\r]+(?P\d+))rrrsmatchr^r0CalledProcessErrorr rrrXr_r`r-ryrrreadrv)r?ryoutputrrwr2fstrs r _get_svn_revisionzConfiguration._get_svn_revision\s 0,l^FFFF.77A 0177:../// 0 -w7    D  < RZ^^4JD%Q%Q D&)44GGD&)44G 7>>' " " 4g !vvxx               BQBx7""I=tDD4qwwz223334I>) $ $ +Gi -AFFHHNN,,  - - - - - - - - - - - - - - -Jo&& 4!44D*.**,,rr*:&GY )++")!$' NN %!!! !*3Jw''4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4>>'** *tsYAA-,A-'C55C9<C9,E1>E E1 EE1E E11E58E5cBt|dd}||S|)d|jdddzddd g}n|g}|'dd |jddd zg}n|g}|D]R}t|j|}t j|rd }t jt j |d } t|j| } td | d|} n;#t$r.} |t| d} Yd} ~ nd} ~ wwxYw| |D]} t| | d}|n | d}n#t"$rYnwxYw|nT| ||_|S||j}|||j}|t|}||_|S)aTry to get version string of a package. Return a version string of the current package or None if the version information could not be detected. Notes ----- This method scans files named __version__.py, _version.py, version.py, and __svn_version__.py for string variables version, __version__, and _version, until a version number is found. rNz__version__.pyrrz _version.pyz version.py__svn_version__.py__hg_version__.py __version___version)z.pyUr}rr)rar<rxr-rrXryrrrr*r8rz ImportErrorrnr get_versionsrZrr}r)r? version_fileversion_variablerr version_varsr2rrr<rversion_moduleertrts r get_versionzConfiguration.get_versionsr$ 400  N  %Y__S))"-m;!)( *EE "NE  #%) IOOC004Z?ALL--L  At**Bw~~b!! &w''(8(8(<(<==a@TY--*%;(+(>(>&D&DNN"***IIc!ff%%%%)NNNNNN*")%A%na>>G*+,99;;IFGG%D&E  "DLN))$/::  ,,T_==H  (mmG"DLs*6D;; E3$E..E3F00 F=<F=TctjdjtjsdSfd}d|fdS)aAppends a data function to the data_files list that will generate __svn_version__.py file to the current package directory. Generate package __svn_version__.py file from SVN revision number, it will be removed after python exits but will be available when sdist, etc commands are executed. Notes ----- If __svn_version__.py existed before, nothing is done. This is intended for working with source directories that are in an SVN repository. rNc^tjskt}dd|dt d5}|d|zdddn #1swxYwYjffd }tj|S)N Creating (version=rJr version = %r crntj||d|zn#t$rYnwxYwtj|dz|d|zdzdS#t$rYdSwxYwdSNzremoved rfrXremover r2rdeletes r rm_filezSConfiguration.make_svn_version_py..generate_svn_version_py..rm_file-Yq\\\11Z\????&,,,,Yqu---qqAc1A/B/B/B/B/B&,,,, --"' 44(A!! A/.A/ rXryrrrrratexitregisterrr2rrrtr?targets r generate_svn_version_pyzBConfiguration.make_svn_version_py..generate_svn_version_pyw~~f-->!(mmGIIIFFFGGGLMMMfc**>a 0G <===>>>>>>>>>>>>>>>%ty------((( BBBr|)r-rr}rXryrr)r?rrrtrs`` @@r make_svn_version_pyz!Configuration.make_svn_version_pys t(<==))$/:: 7>>& ! ! AX%5 F        $   %<%<%>%> ? @ @ @ @ @rActjdjtjsdSfd}d|fdS)aAppends a data function to the data_files list that will generate __hg_version__.py file to the current package directory. Generate package __hg_version__.py file from Mercurial revision, it will be removed after python exits but will be available when sdist, etc commands are executed. Notes ----- If __hg_version__.py existed before, nothing is done. This is intended for working with source directories that are in an Mercurial repository. rNc^tjskt}dd|dt d5}|d|zdddn #1swxYwYjffd }tj|S)NrrrJrrcrntj||d|zn#t$rYnwxYwtj|dz|d|zdzdS#t$rYdSwxYwdSrrrs r rzQConfiguration.make_hg_version_py..generate_hg_version_py..rm_file/rrrrs r generate_hg_version_pyz@Configuration.make_hg_version_py..generate_hg_version_py(rrr|)r-rrrXryrr)r?rrrtrs`` @@r make_hg_version_pyz Configuration.make_hg_version_pyst(;<<((99 7>>& ! ! @X%5 F        $   %;%;%=%= > ? ? ? ? ?rA __config__cT|j|j|tfdS)zGenerate package __config__.py file containing system_info information used during building the package. This file is installed to the package installation directory. N)rrr<r)r?r<s r make_config_pyzConfiguration.make_config_py<s*  41CDEEEEErAcHddlm}m}i}|D]}||fi|||S)zGet resources information. Return information (from system_info.get_info) for all of the names in the argument list in a single dictionary. r})r4r) system_infor4r)r?namesr4r info_dictrts r r4zConfiguration.get_infoFsY 76666666  1 1A K 0 0HHQKK 0 0 0 0rA)NNNNr}r)r})NNr})NFrNN)T)r)-rBrCrDrrrnumpy_include_dirsr@rrrnrrIrrrrrrrrrr!rr+r9r<r;rArErGrrPrYr\rgrjrnr}rrrrrr4rFrAr rrs+:::J !78J9%K#!"& _%_%_%_%B&777999""""12.9: D(,#'&';;;;|(,$))S)S)S)SVw4w4w4rRRRUJUJUJr . . . 333 ) ) )D A A AeeeN"E"E"EH222 1W1W1W1WfhhhhV))) DDD2      && : : ::###LJJJJX'A'A'A'AR&@&@&@&@PFFFF     rArc||vr=ddl}|jj}|ddlm}|d||}|||<||S)Nr)DistutilsInternalErrorz+setup distribution instance not initialized)distutils.corecore_setup_distributiondistutils.errorsrrb)cmdname_cacherrfrrWs r rrSs{f~1 < ? ? ? ? ? ?((?AA A""7++w '?rAcdtjdd}|sddl}|g}|S)Nr)rrnumpy get_include)rrs r rr_s> 3AAA6L / **,,. rActjd}||Stjd}tjtj|j ddd}|S)aReturn the path where to find the npy-pkg-config directory. If the NPY_PKG_CONFIG_PATH environment variable is set, the value of that is returned. Otherwise, a path inside the location of the numpy module is returned. The NPY_PKG_CONFIG_PATH can be useful when cross-compiling, maintaining customized npy-pkg-config .ini files for the cross-compilation environment, and using them when cross-compiling. NPY_PKG_CONFIG_PATHNrrrznpy-pkg-config) rXr_r` importlibutil find_specryrzrorigin)r specs r get_npy_pkg_dirrhsk ,--A} > # #G , ,D  RW__T[11 E+ - -A HrAcddlm}|r"|tntg}|||S)a Return library info for the given package. 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 additional directories where to look for npy-pkg-config files. Those directories are searched prior to the NumPy directory. Returns ------- pkginfo : class instance The `LibraryInfo` instance containing the build information. Raises ------ PkgNotFound If the package is not found. See Also -------- Configuration.add_npy_pkg_config, Configuration.add_installed_library, get_info r) read_config)numpy.distutils.npy_pkg_configrrr)pkgnamerrs r r5r5|sY<;::::: # O%%&&&&!!" ;w % %%rAc.ddlm}t||}||}||D] \}}|||!|d|d<|d=|d=|S)a9 Return an info dict for a given C library. The info dict contains the necessary options to use the C library. 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 additional directories where to look for npy-pkg-config files. Those directories are searched prior to the NumPy directory. Returns ------- info : dict The dictionary with build information. Raises ------ PkgNotFound If the package is not found. See Also -------- Configuration.add_npy_pkg_config, Configuration.add_installed_library, get_pkg_info Examples -------- To get the necessary information for the npymath library from NumPy: >>> npymath_info = np.distutils.misc_util.get_info('npymath') >>> npymath_info #doctest: +SKIP {'define_macros': [], 'libraries': ['npymath'], 'library_dirs': ['.../numpy/core/lib'], 'include_dirs': ['.../numpy/core/include']} This info dict can then be used as input to a `Configuration` instance:: config.add_extension('foo', sources=['foo.c'], extra_info=npymath_info) r) parse_flagsrrignored)rrr5cflagslibsrr)rrrpkg_inforr)rs r r4r4sZ;:::::GT**H ;x(( ) )D HMMOO,,22441 Qq!ND X Y KrAc@ddl} |jdS#t$rYdSwxYw)NrTF)builtins__NUMPY_SETUP__rZ)rs r is_bootstrappingrs@OOO  t uus  cddl}|d|d|d|d|d|d|d d t|||}|S) zqReturn a configuration dictionary for usage in configuration() function defined in file setup_.py. rNzUse Configuration(rz ,top_path=z,) instead of deprecated default_config_dict(rJrirj)rmrnrr)r<rrrmrfs r rrs{OOO MMMTT;;; TT;;; $% &&& dK44A 88::rAc |D]M\}}||vr?||}t|tr|||<,|||H|||<NdSr)rr5rr)r r#r)rovs r rrsv 1 661B"c"" !! AAaDDrActjjdkrJ|dtjj}|dtjj}d}tj|rtj|d}tjtj|d}tj|\}}tj||g}tj|dt||t|d|ksNtj|dt||t|d|krtj |}|t|d}tj|r |dd}n|}tj t||z|S)Nrwr|rr}) rXryrrr splitdriverrarzrWrnormpathr-)rrydrive absprefix pathdriver subpaths r rr s w{cRW[11||C-- E w}}T ""6**1-G&&rwv'>'>??B ',,T22 4 G )T!2 3 3 7<< '3q66'*Ic!ffgg,> ? ?9 L Lgll4Q=$s1vvww-88D@@""As1vvww- 7== ! ! "abbkG 7  E%&.':: ; ;;rAcddlm}ddlm}|tj|t|d5}|dtj tj dz|d|d|tj d|jD] \}}||d |d !|tj d d d d n #1swxYwY|S) zGenerate config.py file containing system_info information used during building the package. Usage: config['py_modules'].append((packagename, '__config__',generate_config_py)) r)r)mkpathrz'# This file is generated by numpy's %s zH# It contains system_info results at the time of building this package. z__all__ = ["get_info","show"] a import os import sys extra_dll_dir = os.path.join(os.path.dirname(__file__), '.libs') if sys.platform == 'win32' and os.path.isdir(extra_dll_dir): os.add_dll_directory(extra_dll_dir) rIrXa} def get_info(name): g = globals() return g.get(name, g.get(name + "_info", {})) def show(): """ Show libraries in the system on which NumPy was built. Print information about various resources (libraries, library directories, include directories, etc.) in the system on which NumPy was built. See Also -------- get_include : Returns the directory containing NumPy C header files. Notes ----- 1. Classes specifying the information to be printed are defined in the `numpy.distutils.system_info` module. Information may include: * ``language``: language used to write the libraries (mostly C or f77) * ``libraries``: names of libraries found in the system * ``library_dirs``: directories containing the libraries * ``include_dirs``: directories containing library header files * ``src_dirs``: directories containing library source files * ``define_macros``: preprocessor macros used by ``distutils.setup`` * ``baseline``: minimum CPU features required * ``found``: dispatched features supported in the system * ``not found``: dispatched features that are not supported in the system 2. NumPy BLAS/LAPACK Installation Notes Installing a numpy wheel (``pip install numpy`` or force it via ``pip install numpy --only-binary :numpy: numpy``) includes an OpenBLAS implementation of the BLAS and LAPACK linear algebra APIs. In this case, ``library_dirs`` reports the original build time configuration as compiled with gcc/gfortran; at run time the OpenBLAS library is in ``site-packages/numpy.libs/`` (linux), or ``site-packages/numpy/.dylibs/`` (macOS), or ``site-packages/numpy/.libs/`` (windows). Installing numpy from source (``pip install numpy --no-binary numpy``) searches for BLAS and LAPACK dynamic link libraries at build time as influenced by environment variables NPY_BLAS_LIBS, NPY_CBLAS_LIBS, and NPY_LAPACK_LIBS; or NPY_BLAS_ORDER and NPY_LAPACK_ORDER; or the optional file ``~/.numpy-site.cfg``. NumPy remembers those locations and expects to load the same libraries at run-time. In NumPy 1.21+ on macOS, 'accelerate' (Apple's Accelerate BLAS library) is in the default build-time search order after 'openblas'. Examples -------- >>> import numpy as np >>> np.show_config() blas_opt_info: language = c define_macros = [('HAVE_CBLAS', None)] libraries = ['openblas', 'openblas'] library_dirs = ['/usr/local/lib'] """ from numpy.core._multiarray_umath import ( __cpu_features__, __cpu_baseline__, __cpu_dispatch__ ) for name,info_dict in globals().items(): if name[0] == "_" or type(info_dict) is not type({}): continue print(name + ":") if not info_dict: print(" NOT AVAILABLE") for k,v in info_dict.items(): v = str(v) if k == "sources" and len(v) > 200: v = v[:60] + " ...\n... " + v[-60:] print(" %s = %s" % (k,v)) features_found, features_not_found = [], [] for feature in __cpu_dispatch__: if __cpu_features__[feature]: features_found.append(feature) else: features_not_found.append(feature) print("Supported SIMD extensions in this NumPy install:") print(" baseline = %s" % (','.join(__cpu_baseline__))) print(" found = %s" % (','.join(features_found))) print(" not found = %s" % (','.join(features_not_found))) N)numpy.distutils.system_infordistutils.dir_utilrrXryrrrrrargvtextwrapdedent saved_resultsr)rrrr2r)rss r rr s877777)))))) F27??6 " "### fc  ua ;rw?O?OPSPXYZP[?\?\]^^^ [\\\ 3444  !      -3355 ( (DAq GGAAA& ' ' ' ' b!bbb b b 'uuuuuuuuuuuuuuun MsC8E  E E cT|jdkstd|jz|jS)zdReturn version major and minor of compiler instance if it is MSVC, raise an exception otherwise.msvcz"Compiler instance is not msvc (%s)) compiler_typer_MSVCCompiler__version)compilers r msvc_versionr s;  !V + +=#1233 3  **rAc"ddlm}|S)Nrr3)distutils.msvccompilerr3rs r r3r3 s%>===== ! ! # ##rAz%-Werror=implicit-function-declarationz-std=c99cd|DS)z= Some flags are valid for C but not C++. Prune them. c$g|] }|tv |SrF)_cxx_ignore_flags)rRrfs r rz&sanitize_cxx_flags.. s# G G GT5F)F)FD)F)F)FrArF)cxxflagss r r7r7 s H GX G G GGrActj||}tj|}|j||S)z Use importlib machinery to import a module `modname` from the file `modfile`. Depending on the `spec.loader`, the module may not be registered in sys.modules. )rrspec_from_file_locationmodule_from_specloader exec_module)modnamemodfilerfoos r r8r8 sK > 1 1'7 C CD . ) )$ / /CKC   JrAr)r|T)r|r|T)NNFr)Fr)NNN)frXrsrrrrrrr r[rimportlib.utilr threadingrtlocal functoolsrrrrrrrr__all__r:r6rurrrr-rr,rrr1rrrrrrrrrrrrrrr r%r#rtIrxrHrBr.r/r3r/r r.r=r0r2r!r"r#rRrVr^r$r%r}rr&r'r(rr)r*r+rrrrr5r4rrrrrrr3rr7r8rFrAr r sB  %%%%%%++++++  ,--- % % %%%%%%%%%8"8"8"8H"     <66:''' #.#.#.J????       6Dqaq!QHHHM     %%%!!!###$$$"""""" "C"C""""J       0"$77= BJ?FFL -rt44: " #BBDIIO 333   >>>.   333 " " "///4      ))))V&,,,    YYYYYYYYx*       ($&$&$&$&L::::x       <<<*AAAF+++$$$=jIHHH     rA