\bg#KbdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZdejvZejejZejejZejejZejejZd ejvr&ejejd ZnNejr8ejejejZnej Zd Z!e"ed dZ#d Z$ej%d kr!edZ&e&eZe&e#Z#dZ'e'Z(dZ) e(sej*Z)n #e+$rYnwxYwdZ,d,dZ-edZ.dZ/dZ0dZ1dZ2dZ3dZ4d-dZ5ej6dZ7dZ8dZ9dZ:d.d Z;ej<d!Z=ej<d"Z>ej<d#Z?d.d$Z@d%ZAdaBd&ZCd'ZDed(eEd)eEd*eEfd+ZFdS)/aProvide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are also available. Written by: Fred L. Drake, Jr. Email: N) pass_none)py39)DistutilsPlatformError)is_mingw__pypy___PYTHON_PROJECT_BASEctj|dtfddDS)z] Return True if the target directory appears to point to an un-installed Python. Modulesc3fK|]+}|V,dSN)joinpathis_file).0fnmoduless p/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/_distutils/sysconfig.py z(_is_python_source_dir..5s=QQ"w##++--QQQQQQ)Setupz Setup.local)pathlibPathrany)drs @r_is_python_source_dirr/sD l1oo&&y11G QQQQ8PQQQ Q QQr_homectj|tj|S)z, Return True if a is a parent of b. )ospathnormcase startswith)dir_adir_bs r _is_parentr$;s8 7  E " " - -bg.>.>u.E.E F FFrntc\ttf}fd|D}t|S)Nc3xK|]4}ttj|d0|V5dS)PCbuildN)r$rrjoin)rprefixrs rrz_fix_pcbuild..HsW  !RW\\&)<<==       r)PREFIX BASE_PREFIXnext)rprefixesmatcheds` r _fix_pcbuildr0DsI;&    "    GQrc`trttSttSr ) _sys_homer project_baserr _python_buildr5Ss&0$Y///  . ..rc0dtjddzS)zReturn a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' or '2.2'. z%d.%dN)sys version_infor4rrget_python_versionr;is S%bqb) ))rFc|rtnt}||n|}trdn tj} t d|}n+#t $rtdtjdwxYw||||S)aReturn the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely pyconfig.h). If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. Nposix_get_python_inc_zCI don't know where Python installs its C header files on platform '')BASE_EXEC_PREFIXr,rrnameglobalsKeyErrorr) plat_specificr*default_prefixresolved_prefixos_namegetters rget_python_incrIqs*7G%%KN & 2ffO!0ggG 7g778    $ 'G ' ' '    6/6= 9 99s A (A4cHtj|r|ndS)z5 Replace path with None if it doesn't exist. N)rrexists)rs r_extantrLs! 7>>$'' 144T1rctr0tjdkr tj|dSt |p+tt||pt|S)Ninclude) IS_PYPYr9r:rrr)_get_python_inc_posix_pythonrL_get_python_inc_from_config_get_python_inc_posix_prefixr* spec_prefixrDs r_get_python_inc_posixrXsh/3#f,,w||FI...$]33 0 .}kJJ K K 0 ' / /rctsdS|rtptStjt dd}tj|S)z Assume the executable is in the build directory. The pyconfig.h file should be in the same directory. Since the build directory may not be the source directory, use "srcdir" from the makefile to find the "Include" directory. NsrcdirInclude) python_buildr2r3rrr)get_config_varnormpath)rDincdirs rrSrSsW )(L( W\\.22I > >F 7  F # ##rc4|td|zdzSdS)aj If no prefix was explicitly specified, provide the include directory from the config vars. Useful when cross-compiling, since the config vars may come from the host platform Python installation, while the current Python executable is from the build platform installation. >>> monkeypatch = getfixture('monkeypatch') >>> gpifc = _get_python_inc_from_config >>> monkeypatch.setitem(gpifc.__globals__, 'get_config_var', str.lower) >>> gpifc(False, '/usr/bin/') >>> gpifc(False, '') >>> gpifc(False, None) 'includepy' >>> gpifc(True, None) 'confincludepy' NCONF INCLUDEPY)r])rDrWs rrTrTs*&f}4{BCCCrctrdnd}|tztz}tj|d|S)NpypypythonrQ)rRr; build_flagsrrr))r*implementation python_dirs rrUrUs>&4VVHN"4"6"66DJ 7<< : 6 66rctrctj|dtjjztjt jzStj|dS)NrQ)r\rrr)pathsepdirname sysconfigget_config_h_filenamerVs r_get_python_inc_ntrnsh  GLL + +go gooi=??@@ A 7<< * **rcJ|r|Stj|dS)N site-packages)rrr)) standard_lib libpython early_prefixr*s r _posix_librts&8w||I777rc$trktjdkr[|t}|r0tj|dtjjStj|dS|}|#|r|rtpt}n|rtpt}tj dkstrj|s|rttdd}nd}trdnd }tj|||tz}t||||Stj d krC|r tj|d Stj|d dSt!d tj d )aSReturn the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. rNNz lib-pythonrpr= platlibdirlibrdrer%LibzF  N7<< c6F6LMM Mw||FO444L ~  ="7'7F;FF"2{>*h77jnn]K@@ jnn  J   h-- d33 FC((h,,:>>*h77 e44 e$$FE**h..h.. e44 Z^^D" % %8bjnnYAAAcF")h&   x/ #cMH4% !  rz ! !h&:&>&>x&N&N !  $ $BJx,@ $ A A A(4%%%[ ,+++rc(tjS)z2Return full pathname of installed pyconfig.h file.)rlrmr4rrrmrmz  * , ,,rc(tjS)zAReturn full pathname of installed Makefile from the Python build.)rlget_makefile_filenamer4rrrrrrc.tj||S)zParse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. )vars)rlparse_config_h)fpgs rrrs  #BQ / / //rz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c6ddlm}||dddd}|i}i}i} |}|nt|}|r|dd\}} | } | d d } d | vr| ||<n? t| } | ||<n)#t$r| d d ||<YnwxYwd } |rt|D]} || } t | pt | }|rl|d}d}||vrt||}nz||vrd }ns|tjvrtj|}nR|| vrG| dr| dd| vrd }n*d|z|vrd }n t|d|z}nd x||<}|r| |d}| d||z|z} d |vr| || <8 t| } | || <n'#t$r| || <YnwxYw|| =| dr| dd| vr| dd} | |vr| || <|| =|||D]1\}} t-| tr| ||<2|||S)zParse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. r)TextFileTsurrogateescape)strip_comments skip_blanks join_lineserrorsNrr8z$$r6$)rLDFLAGSCPPFLAGSFPY_rO)distutils.text_filerreadline _variable_rxmatchgroupstripreplaceint ValueErrorlist _findvar1_rxsearch _findvar2_rxstrrrr!endstartcloseitems isinstanceupdate)rrrrdonenotdonelinemnvtmpvrenamed_variablesrAvaluefounditemafterks rparse_makefilers-,,,,,      B y  DG {{}} <    t $ $  771a==DAq A99T2&&Dd{{  AA  DGG "333iic22DGGG3! 4: /"MM. ". "DDME##E**Hl.A.A%.H.HA+ "GGAJJ99tAw<O2O2O!g-- % #4 ?33%''DGd3!!%%'')),E!+AGGII+.5=Ee||(- /$'JJE*/DJJ *777).DJJJ7$DM??5113d122hBS6S6S#'8D#4//-2T DMM_ /"bHHJJJ   1 a   ggiiDGHHTNNN Hs$!B66#CC-I!I&%I&c$ t|pt|}|rV|\}}|d|||dz||dz}nn|S)aExpand Makefile-style variables -- "${foo}" or "$(foo)" -- in 'string' according to 'vars' (a dictionary mapping variable names to values). Variables not present in 'vars' are silently expanded to the empty string. The variable values in 'vars' should not contain further variable expansions; if 'vars' is the output of 'parse_makefile()', you're fine. Returns a variable-expanded version of 's'. TrrN)rrrspanrr)srrbegrs rexpand_makefile_varsrs    " " tjat jt|r d|DntS)aWith no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile; on Windows it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. NcBg|]}t|Sr4) _config_varsr)rrAs r z#get_config_vars..0s& 4 4 4tL  T " " 4 4 4r)rrlrcopyradd_ext_suffix)argss rrr!sT 0227799  L)))8< N 4 4t 4 4 4 4,Nrc|dkr ddl}|dtdt|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) SOrNz SO is deprecated, use EXT_SUFFIXr8)warningswarnDeprecationWarningrr)rArs rr]r]3sH  t|| 8:LaPPP     & &&rrtypereturnc\tj|d}|r|d|n|S)z Add any flags from the environment for the given type. type is the prefix to FLAGS in the environment key (e.g. "C" for "CFLAGS"). FLAGSr)rrr)rrflagss rrr?s; JNNd>>> * *E!& 1e  e   E1r)FN)FFNr )G__doc__ functoolsrrrer9rljaraco.functoolsrcompatrrrutilrbuiltin_module_namesrRrr^r*r+ exec_prefixrz base_prefixr,base_exec_prefixr@rabspathr3 executablerkgetcwdrr{r2r$rAr0r5r\rfabiflagsAttributeErrorr;rIrLrXrSrTrUrnrtr} lru_cacherrrmrrcompilerrrrrrrr]rrr4rrrs     &&&&&&****** 0 0   #* % %gs// gs// 7##C$899 RZ''7??2:.D#EFFLL ~#wrws~'F'FGG !ry{{ RRR GC$ ' ' GGG7d??  Y  < --L Y''I/// }   #l     D ***::::2 22 2 $ $ $ DDD.777 +++8882 2 2 2 j "T5T5T5n--- --- 0000rz?@@ rz:;; rz899 m m m m `   2 OOO$ ' ' ' 2c22222 222s FFF