fkv dZddlZddlZddlmZmZgdZdhZdddd d d d d dddddddd d ddddddddd ddddd d d d d ddddddddd ddZej dkr eded<n eded<dZ e duZ e r!edddddd d!d"d#d#d$d$d%d&d!d"d'd'd(d(d%d&d!d"d)zZd"Z ej dZejdd*ejd+Zejdejd+ZejejZejejZejejZejejZdadZd,Zd-Z d.Z!d/Z"ej#r)ej$e"ej#Z%ne"ej&Z%e'ed0dZ(e(re(Z%ej dkr,e"e%)e"ed1reZ%d2ej*vre"ej*d2Z%dUd3Z+e+Z,e,r#d4D]Z-ee-Z-e-d5e-d6<d7e-d5<d8e-d9< [-d:Z.d;Z/d<Z0d=Z1d>Z2d?Z3dVdAZ4dBZ5dCZ6dDZ7dEZ8dFZ9dUdGZ:dHZ;dIZe3dd@fdLZ?dMZ@dNZAdOZBdPZCdQZDdRZEdSZFeGdTkr eFdSdS)Wz-Access to Python's configuration information.N)pardirrealpath) get_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hMACOSX_DEPLOYMENT_TARGETz6{installed_base}/{platlibdir}/python{py_version_short}z0{platbase}/{platlibdir}/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz>{platbase}/{platlibdir}/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z {base}/binz{base})stdlib platstdlibpurelibplatlibinclude platincludescriptsdataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz {base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scripts) posix_prefix posix_homent posix_venvnt_venvrrvenvrc tjdd}|r|StjdvrdSd}tjdkr-tjdpd}||dStjdkrItjr=|dd tjtjd d tjd S|dd S)NPYTHONUSERBASE>wasivxworks emscriptencbtjtjj|SN)ospath expanduserjoin)argss 0/opt/alt/python311/lib64/python3.11/sysconfig.pyjoinuserz_getuserbase..joinuservs!w!!"',"5666rAPPDATA~PythondarwinLibraryr.z.local)r&environgetsysplatformname _framework version_info)env_baser,bases r+ _getuserbaser>msz~~.55H |888t777 w$z~~i((/Cxh''' |xCNxY+A.FF1A!1DFFHH H 8C " ""r-z({userbase}/Python{py_version_nodot_plat}z6{userbase}/Python{py_version_nodot_plat}/site-packagesz0{userbase}/Python{py_version_nodot_plat}/Includez0{userbase}/Python{py_version_nodot_plat}/Scriptsz {userbase})rrrrrrrz0{userbase}/{platlibdir}/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packages)nt_user posix_userosx_framework_userr3r4z"([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_]*)}cF t|S#t$r|cYSwxYwr%)rOSError)r's r+_safe_realpathrDs7~~  s   _homez\PCbuild_PYTHON_PROJECT_BASEc|!ddl}|dtddD]H}tjtjtd|rdSIdS) Nrz.check_home argument is deprecated and ignored.) stacklevel)Setupz Setup.localModulesTF)warningswarnDeprecationWarningr&r'isfiler) _PROJECT_BASE) check_homerLfns r+is_python_buildrSs| F(Q  8 8 8& 7>>"',,}iDD E E 44  5r-)rrrheadersz{srcdir}/Includez{projectbase}/.rc |jdi|S#t$rA} |jditjcYd}~S#t$rt |dwxYwd}~wwxYw)N)formatKeyErrorr&r5AttributeError)s local_varsvars r+ _subst_varsr]s5qx%%*%%% 555 518))bj)) ) ) ) ) ) ) 5 5 5 C** 4 55s#  A6AAAAcv|}|D]\}}||vr |||<dSr%)keysitems) target_dict other_dict target_keyskeyvalues r+ _extend_dictrfsW""$$K &&((!! U +    C!!r-c|i}|i}t|ttjdkr|ddiz}t|D]b\}}tjdvrtj|}tjt||||<c|S)Nr platlibdirlib)posixr) rfrr&r9_INSTALL_SCHEMESr`r'r(normpathr])schemevarsresrdres r+ _expand_varsrps C |(())) w$|U++&v.4466>> U 7o % %G&&u--E7##Kt$<$<==C Jr-c~tjdkrddddStjdkrtjrddddSddddS) Nrrr?)prefixhomeuserr1rrAr@)r&r9r7r8r:rVr-r+_get_preferred_schemesrusm w$     |xCN$ (   !  r-c|dkrtjtjkrdSt|}|tvrt |d|d|S)Nrrrz returned z., which is not a valid scheme on this platform)r7rr base_prefixrurk ValueError)rdrms r+get_preferred_schemery+sq h3:88v # % %c *F %%%         Mr-c tdS)Nrr)ryrVr-r+get_default_schemer{7s  ) ))r-TcPddl}|i}i}i}t|tjd5}|}dddn #1swxYwY|D]}|ds|dkr0|t|} | r| dd\} } | } | d d} d | vr| || < | tvrtt| } | || <#t$r| d d || <YwxYwt|} d }t!| dkrLt#| D]'}||}|t&|}|t(|}|r1|r/||kr|n|} n|r|n|} | | d} d }| |vrt-|| }nz| |vrd }ns| t.jvrt.j| }nR| |vrG|dr|dd|vrd}n*d| z|vrd }n t-|d| z}ndx|| <}|r|| d}|d| |z|z}d |vr|||<s |tvrtt|}|||<n'#t$r|||<YnwxYw| ||dr|dd|vr|dd}||vr|||< |r|||<| |)t!| dkL|D]1\}} t9| t,r| ||<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. rNsurrogateescape)encodingerrors#r4rHz$$$)CFLAGSLDFLAGSCPPFLAGSTFPY_)reopenr7getfilesystemencoding readlines startswithstripmatch _variable_rxgroupreplace _ALWAYS_STRrxintlistr_lentuplesearch _findvar1_rx _findvar2_rxstartstrr&r5endremover` isinstanceupdate)filenamernkeep_unresolvedrdonenotdoneflineslinemnvtmpv variablesrenamed_variablesr9rem1m2founditemafterks r+_parse_makefiler;sIII | DG h!:!s1<>>> 7<<**OZ H HHr-c ttjdd}tjddtjdtjd|S)Nrr_PYTHON_SYSCONFIGDATA_NAME_sysconfigdata__)getattrr7rr&r5r6rr8) multiarchs r+_get_sysconfigdata_namersP*L"==I :>>$C#,CCCC CC  r-cddl}i}t} t||nC#t$r6}d|}t |dr |d|jd}t|d}~wwxYwt } t|d5}t||dddn #1swxYwYnC#t$r6}d|}t |dr |d|jd}t|d}~wwxYwtr |d |d <t}d tj vr/ddl }||} || _| tj|<d t#d t$} t tdr| dz } t'j| dt&j| |dz} t| dd5}|d|d|||dddn #1swxYwYtddd5}|| ddddS#1swxYwYdS)z;Generate the Python module containing build-time variables.rNz,invalid Python installation: unable to open strerrorz ()zutf-8)r~LDSHARED BLDSHAREDr1z build/lib.rgettotalrefcountz-pydebugT)exist_okz.pywutf8zB# system configuration generated and used by the sysconfig module zbuild_time_vars = )streamzpybuilddir.txt)pprintrrrCrrrrrrrr7r8types ModuleTypebuild_time_varsmodulesr rr&makedirsr'r)write) rrnmakefileemsgconfig_hrr9rmodule pybuilddirdestfiles r+_generate_posix_varsrs}MMM D$&&H$'''' GXGG 1j ! ! *))AJ)))Ccll  %&&H (W - - - $ 1d # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ GXGG 1j ! ! *))AJ)))Ccll - ,[ # $ $D3< !!$''!%" DBlnnBB/@BBJs&''!j K T****w||Ju 55H hf - - -& * + + + $%%% d1 %%% &&&&&&&&&&&&&&& f 5 5 5  su' A'1A""A'9B3 B' B3'B++B3.B+/B33 C3=1C..C3AHH#&H#<II#&I#ct}t|ttdgd}|j}||dS)z7Initialize the module as appropriate for POSIX systems.rrN)r __import__globalslocalsrr)rnr9_temprs r+ _init_posixrsP # $ $D tWYY3D2Eq I IE+OKK     r-cNddl}td|d<td|d<td|d<|d|d <d |d <t|d <tjttj |d <d|d<dS)z+Initialize the module as appropriate for NTrNrLIBDESTr BINLIBDESTr INCLUDEPY EXT_SUFFIXz.exeEXEVERSIONBINDIRrTZPATH) _impr extension_suffixes_PY_VERSION_SHORT_NO_DOTr&r'dirnamerDr7 executable)rnrs r+_init_non_posixrsKKKx((DO!,//D ++D002215DDK.DOW__^CN%C%CDDDNDNNNr-c|i}ddl}|d}|d} |}|sn||}|rP|dd\}} |t vrt t|}n#t $rYnwxYw|||<n/||}|rd||d<|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. Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*) z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/ Tr4rH)rcompilereadlinerrrrxr) fprnr define_rxundef_rxrrrrs r+rr)s  | III @AAIzzCDDH%{{}}   OOD ! ! %771a==DAq  ##$$FF    DGGt$$A %#$QWWQZZ #%$ Ks<B B)(B)ctr>tjdkr&tjt d}nt }nt d}tj|dS)zReturn the path of pyconfig.h.rPCrz pyconfig.h)rr&r9r'r)rPr )inc_dirs r+rrKsV* 7d??gll=$77GG#GG=)) 7<< . ..r-cDtttS)z,Return a tuple containing the schemes names.)rsortedrkrVr-r+rrWs ()) * **r-ctS)z*Return a tuple containing the paths names.) _SCHEME_KEYSrVr-r+r r \s r-c@|rt||St|S)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. )rprk)rmrnexpands r+r r as' (FD)))''r-c0t||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r9rmrnrs r+r r ms VT6 * *4 00r-ctiattd<ttd<ttd<ttd<t td<t td<ttd<ttd <ttd <ttd <tj td < tj td <n#t$r dtd <YnwxYw tj ddtd<n#t$r dtd<YnwxYwtjdkr(t#ttjtd<tjdkrt'tt(rt+td<tdt}tjdkr~t.rLtjt5}tj||}n+tjt5}t9|td<tjdkrddl}|t|r6g}|D]/}| t|0|StS)anWith no arguments, return a dictionary of all configuration variables relevant for the current platform. 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. Nrr exec_prefix py_versionpy_version_shortpy_version_nodotinstalled_baser=installed_platbaseplatbase projectbaserhrrr3py_version_nodot_platrVPATHrjuserbasesrcdirr1r)! _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrr _BASE_PREFIX_BASE_EXEC_PREFIXrPr7rhrrYwinverrr&r9r_vpathr_HAS_USER_BASEr>r6rr'rrr)rDr8 _osx_supportcustomize_config_varsappend)r*rr=rvalsr9s r+rrusv ") X&2 ]#%0 \"+< '(+C '()5 %&& V-> )*#/ Z &3 ]#%(^ \" *'*|L $ $ * * *')L $ $ $ * 747J4F4FsB4O4OL0 1 1 7 7 746L0 1 1 1 7 7d?? L ) ) )$'JL ! 7g    % % %  6(4~~L $!!(M:: 7g   Bw'<'>'>??dF33 )>)@)@AA!/!7!7 X <8 # #      . .| < < <  0 0D KK ((.. / / / / s$6C C"!C"&(DD&%D&cDt|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rr6)r9s r+rrs     & &&r-ctjdkrrdtjvrdSdtjvrdSdtjvrdStjStjdkst td s tjSd tjvrtjd Stj\}}}}}| d d }| d d}| d d}|dddkr|d|S|dddkrQ|ddkrDd}t|ddz d|dd}ddd}|d|tj z }n|dddkrddl m }|S|ddd krGd }ddl}|d!}||} | r| }n:|ddd"kr,ddl} | t)|||\}}}|d|d|S)#aReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; on Linux, the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. ramd64z win-amd64z(arm)z win-arm32z(arm64)z win-arm64rjuname_PYTHON_HOST_PLATFORM/r rrNlinuxsunosr5solarisrr3rH32bit64bit)ilaix) aix_platformcygwinz[\d.]+r1)r&r9r7versionlowerr8rr5r!rrmaxsize _aix_supportr-rrrrrget_platform_osxr) osnamehostreleaser0machinebitnessr-rrel_rerrs r+r r s* w$ ck'')) ) ); ck'')) ) );  ))++ + +;| w'W!5!5|"*,,z122/1hjj+FD'7G\\^^ # #C , ,Fooc3''Gooc3''G bqbzW%%G%%% w   1:  FWQZ1,<>&&|U A:: U,,,    $3$$E$$$%%%%&&r-cdtjvrtdStdt dtdt dtdt dttdtttdtdS) z*Display all information sysconfig detains.z--generate-posix-varsNz Platform: "rBzPython version: "zCurrent installation scheme: "Paths Variables) r7argvrrDr r r{rGr rrVr-r+_mainrLDs#(** )  ) ) )*** 5022 5 5 5666 B+=+?+? B B BCCC GGG%%% GGG _../////r-__main__r%)NT)H__doc__r&r7os.pathrr__all__rrkr9r>rrr0splitrr;rrr'rlrrrrwrrrbase_exec_prefixrr _USER_BASErrrrDrrrPgetcwdr _sys_homerr5rSrrmr]rfrpruryr{rrrrrrrrrr r r rrr r r?rGrL__name__rVr-r+rWs33 $$$$$$$$     KHFS I M   0)&&48   )"---1# 8KHFS I M   )"---1#   }HHV7d??/ :V/ =V ###,,..,ADOOII ILNND' .1<<D' )># k!!!$ '*BBS-=a-@BB!.q1H33CA3FHH '  3: & &w00 w00 G$$S%9::  5 / -  >0GOONN3>$B$BCCMM#N929;;//M GC$ ' '  M7d?? ~m$$// Nl555 6 688%$ RZ''"N2:.D#EFFM !!  022 "&)"9-y.y 1}555!!!$(   ***}}}}@ I I I===~!!!   $D / / /+++  ('))T ( ( ( (-,..T$1111MMM`'''N+N+N+b   4&&& 0 0 0 z EGGGGGr-