grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|jÙkã @sDdZddlZddlZddlmZmZgd¢ZdhZdddd d d d d dœddddddd d dœdddddddd dœdœZdd„Z e ƒduZ e reeddddddddœd d d!d!d"d#ddœd$d$d%d%d"d#ddœd&œOZdZ ej   ¡dZejd›d'ejd(›�Zejd›ejd(›�Zej ej¡Zej ej¡Zej ej¡Zej ej¡ZdadZd)Zd*Zd+Z d,d-„Z!ej"r¾ej #e!ej"ƒ¡Z$ne!e %¡ƒZ$ej&d.krÚe$ '¡ (d/¡rÚe!ej )e$ee¡ƒZ$d0ej*vræe!ej*d0ƒZ$d1d2„Z+e,ed3dƒZ-ej&d.k�rd4d5„Z.e.e$ƒZ$e.e-ƒZ-dsd7d8„Z/e/d9ƒZ0e0�r&d:D]Z1ee1Z1e1d;e1d<<d=e1d;<d>e1d?<�qd@dA„Z2dBdC„Z3dDdE„Z4dFdG„Z5dHdI„Z6dJdK„Z7dtdLdM„Z8dNdO„Z9dPdQ„Z:dRdS„Z;dTdU„ZdZd[„Z?d\d]„Z@d^d_„ZAe7ƒdd9fd`da„ZBe7ƒdd9fdbdc„ZCddde„ZDdfdg„ZEdhdi„ZFdjdk„ZGdldm„ZHdndo„ZIdpdq„ZJeKdrk�r eJƒdSdS)vz-Access to Python's configuration information.éN)ÚpardirÚrealpath) Úget_config_h_filenameÚget_config_varÚget_config_varsÚget_makefile_filenameÚget_pathÚget_path_namesÚ get_pathsÚ get_platformÚget_python_versionÚget_scheme_namesÚparse_config_hZMACOSX_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Ú platstdlibÚpurelibÚplatlibÚincludeÚ platincludeÚscriptsÚdataz{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_homeÚntcCs�tj dd¡}|r |StjdkrdSdd„}tjdkr(tj d¡p"d}||dƒStjd krCtjrC|dd tjtjd ›d tjd ›�ƒS|ddƒS)NÚPYTHONUSERBASEÚvxworkscWstj tjj|Ž¡S©N)ÚosÚpathÚ expanduserÚjoin)Úargs©r"ú0/opt/alt/python310/lib64/python3.10/sysconfig.pyÚjoinuserIsz_getuserbase..joinuserrÚAPPDATAú~ÚPythonÚdarwinÚLibraryrÚ.éz.local)rÚenvironÚgetÚsysÚplatformÚnameÚ _frameworkÚ version_info)Úenv_baser$Úbaser"r"r#Ú _getuserbase@s    ÿ r5z({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_userÚosx_framework_userr*r+z"([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_]*)}cCs"zt|ƒWSty|YSwr)rÚOSError)rr"r"r#Ú_safe_realpathŒs   ÿr:r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]}tj tj |d|¡¡rdSqdS)N)ZSetupz Setup.localZModulesTF)rrÚisfiler )ÚdÚfnr"r"r#Ú_is_python_source_dir¡s ÿr>Ú_homecCs0|rtj |¡ tj tj td¡¡¡rtS|S)NZPCbuild)rrÚnormcaseÚ startswithr Ú_PREFIX)r<r"r"r#Ú _fix_pcbuildªs ÿrCFcCs|rtrttƒSttƒSr)Ú _sys_homer>Ú _PROJECT_BASE)Z check_homer"r"r#Úis_python_build²srFT)rrrZheadersz{srcdir}/Includez{projectbase}/.rc Cshz |jdi|¤ŽWSty3}zz|jditj¤ŽWWYd}~Sty.t|›ƒd‚wd}~ww)Nr")ÚformatÚKeyErrorrr,ÚAttributeError)ÚsZ local_varsÚvarr"r"r#Ú _subst_varsÅs   ÿ€ýrLcCs0| ¡}| ¡D] \}}||vrq|||<qdSr)ÚkeysÚitems)Z target_dictZ other_dictZ target_keysÚkeyÚvaluer"r"r#Ú _extend_dictÎs  ýrQcCsbi}|duri}t|tƒƒt| ¡D]\}}tjdvr#tj |¡}tj t ||ƒ¡||<q|S)N)Úposixr) rQrÚ_INSTALL_SCHEMESrNrr0rrÚnormpathrL)ÚschemeÚvarsÚresrOrPr"r"r#Ú _expand_varsÖs   rXcCs>tjdkr ddddœStjdkrtjrddddœSddddœS) Nrrr6)ÚprefixÚhomeÚuserr(rr8r7)rr0r.r/r1r"r"r"r#Ú_get_preferred_schemesãs ýýýr\cCs*tƒ|}|tvrt|›d|›d�ƒ‚|S)Nz returned z., which is not a valid scheme on this platform)r\rSÚ ValueError)rOrUr"r"r#Úget_preferred_scheme÷s ÿr^cCstdƒS)NrY)r^r"r"r"r#Úget_default_schemesr_c CsVddl}|dur i}i}i}t|t ¡dd�� }| ¡}Wdƒn1s&wY|D]S}| d¡s:| ¡dkr;q-| t|¡} | r€|   dd¡\} } |  ¡} |   d d¡} d | vr^| || <q-z | t vret ‚t | ƒ} Wnt y{|   d d ¡|| <Yq-w| || <q-t| ¡ƒ} d }t| ƒdk�rŽt| ƒD]ó}||}| t|¡}| t|¡}|r·|r·| ¡| ¡kr´|n|} n|r»|n|} | du�r{|   d¡} d }| |vrÔt|| ƒ}n@| |vrÛd }n9| tjvrætj| }n.| |v�r| d¡rû|dd…|vrûd}nd| |v�rd }nt|d| ƒ}nd|| <}|�rz||  ¡d…}|d|  ¡…||}d |v�r5|||<q”z |t v�r=t ‚t |ƒ}Wnt �yR| ¡||<Ynw|||<|  |¡| d¡�rz|dd…|v�rz|dd…}||v�rz|||<q”|�r‚|||<|  |¡q”t| ƒdks�| ¡D]\}} t| tƒ�r¢|  ¡||<�q’| |¡|S)zÌParse 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. rNÚsurrogateescape)ÚencodingÚerrorsú#Úr+éz$$ú$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_é)ÚreÚopenr.ÚgetfilesystemencodingÚ readlinesrAÚstripÚmatchÚ _variable_rxÚgroupÚreplaceÚ _ALWAYS_STRr]ÚintÚlistrMÚlenÚtupleÚsearchÚ _findvar1_rxÚ _findvar2_rxÚstartÚstrrr,ÚendÚremoverNÚ isinstanceÚupdate)ÚfilenamerVZkeep_unresolvedrhZdoneZnotdoneÚfÚlinesÚlineÚmÚnÚvZtmpvZ variablesZrenamed_variablesr0rPZm1Zm2ÚfoundÚitemZafterÚkr"r"r#Ú_parse_makefiles® ÿ þ     þ€                ÿ    €  ¿D  € r‰cCshtr tj tptd¡Sttdƒrdt›tj ›�}nd}ttj dƒr*|dtj j ›�7}tj t dƒ|d¡S)z Return the path of the Makefile.ZMakefileÚabiflagszconfig-ZconfigÚ _multiarchú-r) Ú _PYTHON_BUILDrrr rDrEÚhasattrr.Ú_PY_VERSION_SHORTrŠÚimplementationr‹r)Zconfig_dir_namer"r"r#r…s  rc Cs2ttjddƒ}tj ddtj›dtj›d|›�¡S)Nr‹rdZ_PYTHON_SYSCONFIGDATA_NAMEZ_sysconfigdata_Ú_)Úgetattrr.r�rr,r-rŠr/)Z multiarchr"r"r#Ú_get_sysconfigdata_name’s þr“c Csddl}i}tƒ}zt||ƒWn#ty3}zd|›�}t|dƒr+|›d|j›d�}t|ƒ‚d}~wwtƒ}zt|dd�� }t||ƒWdƒn1sNwYWn#tyw}zd|›�}t|dƒro|›d|j›d�}t|ƒ‚d}~wwt r€|d |d <t ƒ}d t j vr™ddl }| |¡} || _| t j|<d tƒ›d t›�} tt dƒr«| d7} tj| dd�tj | |d¡} t| ddd��}| d¡| d¡|j||d�Wdƒn1sÞwYtdddd��}| | ¡WdƒdS1sûwYdS)z;Generate the Python module containing build-time variables.rNz,invalid Python installation: unable to open Ústrerrorz (ú)zutf-8)raZLDSHAREDZ BLDSHAREDr(z build/lib.rŒZgettotalrefcountz-pydebugT)Úexist_okz.pyÚwÚutf8zB# system configuration generated and used by the sysconfig module zbuild_time_vars = )Ústreamzpybuilddir.txt)Úpprintrr‰r9rŽr”rrirr�r“r.r/ÚtypesÚ ModuleTypeÚbuild_time_varsÚmodulesr r�rÚmakedirsrr Úwrite) ršrVZmakefileÚeÚmsgZconfig_hr€r0r›ÚmoduleZ pybuilddirZdestfiler"r"r#Ú_generate_posix_varsšs\  €ü ÿ€  €ü       ü "ÿr¤cCs0tƒ}t|tƒtƒdgdƒ}|j}| |¡dS)z7Initialize the module as appropriate for POSIX systems.r�rN)r“Ú __import__ÚglobalsÚlocalsr�r~)rVr0Z_tempr�r"r"r#Ú _init_posixÙsr¨cCsnddl}tdƒ|d<tdƒ|d<tdƒ|d<| ¡d|d <d |d <t|d <tj ttj ƒ¡|d <d|d<dS)z+Initialize the module as appropriate for NTrNrZLIBDESTrZ BINLIBDESTrZ INCLUDEPYÚ EXT_SUFFIXz.exeZEXEZVERSIONZBINDIRrdZTZPATH) Ú_imprÚextension_suffixesÚ_PY_VERSION_SHORT_NO_DOTrrÚdirnamer:r.Ú executable)rVrªr"r"r#Ú_init_non_posixás    r¯c Cs®|duri}ddl}| d¡}| d¡} | ¡}|s |S| |¡}|rH| dd¡\}}z |tvr4t‚t|ƒ}Wn tyBYnw|||<n| |¡}|rVd|| d¡<q)zÌParse 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_]+) [*]/ Tr+re)rhÚcompileÚreadlinermrorqr]rr) ÚfprVrhZ define_rxZundef_rxr‚rƒr„r…r"r"r#rós2   ò  ÿ  ïrcCsBtrtjdkrtj tp td¡}n tpt}ntdƒ}tj |d¡S)zReturn the path of pyconfig.h.rZPCrz pyconfig.h)r�rr0rr rDrEr)Zinc_dirr"r"r#rs   rcCs tttƒƒS)z,Return a tuple containing the schemes names.)ruÚsortedrSr"r"r"r#r !s r cCótS)z*Return a tuple containing the paths names.)Ú _SCHEME_KEYSr"r"r"r#r &sr cCs|rt||ƒSt|S)z°Return 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. )rXrS)rUrVÚexpandr"r"r#r +s r cCst|||ƒ|S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r0rUrVr¶r"r"r#r7srcGs¦tdur¾iattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd <ttd <ttd <t j td <zt j td <Wn t yGdtd <Ynwz t j  dd¡td<Wn t y`dtd<Ynwtjdkrjttƒtjdkrsttƒt d¡}|dur€|td<tr‡tƒtd<t dt¡}tjdkrªtr£tj tƒ¡}tj ||¡}ntj tƒ¡}t|ƒtd<t jdkr¾ddl}| t¡|rÑg}|D] }| t |¡¡qÄ|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. NrYÚ exec_prefixZ py_versionZpy_version_shortZpy_version_nodotZinstalled_baser4Zinstalled_platbaseZplatbaseZ projectbaseÚ platlibdirrŠrdr*Zpy_version_nodot_platrrRr©ÚSOÚuserbaseÚsrcdirr(r) Ú _CONFIG_VARSrBÚ _EXEC_PREFIXÚ _PY_VERSIONr�r¬Ú _BASE_PREFIXÚ_BASE_EXEC_PREFIXrEr.r¸rŠrIÚwinverrprr0r¯r¨r-Ú_HAS_USER_BASEr5r�rr­rr r:r/Ú _osx_supportZcustomize_config_varsÚappend)r!r¹r»r4rÃZvalsr0r"r"r#r?s`    þ  ÿ         rcCs*|dkrddl}| dtd¡tƒ |¡S)z“Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) r¹rNz SO is deprecated, use EXT_SUFFIXre)ÚwarningsÚwarnÚDeprecationWarningrr-)r0rÅr"r"r#r’s rc CsÒtjdkr#dtj ¡vrdSdtj ¡vrdSdtj ¡vr dStjStjdks-ttd ƒs0tjSd tjvr:tjd St ¡\}}}}}| ¡  d d ¡}|  d d¡}|  d d¡}|dd…dkrf|›d|›�S|dd…dkr—|ddkr–d}t |dƒd›d|dd…›�}dddœ}|d|tj ›�7}nH|dd…dkr¨ddl m }|ƒS|dd…d krÇd }ddl}| d!¡}| |¡} | rÆ|  ¡}n|dd…d"krßddl} |  tƒ|||¡\}}}|›d|›d|›�S)#aöReturn 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'. rZamd64z win-amd64z(arm)z win-arm32z(arm64)z win-arm64rRÚunameZ_PYTHON_HOST_PLATFORMú/rdú r‘rŒNéZlinuxZsunosrÚ5Zsolarisrgr*reZ32bitZ64bit)iÿÿÿlÿÿÿÿZaix)Ú aix_platforméÚcygwinz[\d.]+r()rr0r.ÚversionÚlowerr/rŽr,rÈrprrÚmaxsizeZ _aix_supportrÍrhr°rmrorÃZget_platform_osxr) ZosnameZhostÚreleaserÐÚmachineZbitnessrÍrhZrel_rerƒrÃr"r"r#r žsV      " €   € þr cCr´r)r�r"r"r"r#r ïsr cCsdddl} | t|¡p| t|¡}|r.| ¡\}}|d|…| | d¡¡||d…}n |Sq)a¨Expand 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'. rNTr+)rhrvrwrxÚspanr-ro)rJrVrhrƒZbegr{r"r"r#Úexpand_makefile_varsós *ùrÖcCsNtt| ¡ƒƒD]\}\}}|dkrt|›d�ƒtd|›d|›d�ƒqdS)Nrz: ú z = "ú")Ú enumerater³rNÚprint)ÚtitlerÚindexrOrPr"r"r#Ú _print_dict s ýrÝcCsrdtjvr tƒdStdtƒ›d�ƒtdtƒ›d�ƒtdtƒ›d�ƒtƒtdtƒƒtƒtdt ƒƒdS) z*Display all information sysconfig detains.z--generate-posix-varsNz Platform: "rØzPython version: "zCurrent installation scheme: "ZPathsZ Variables) r.Úargvr¤rÚr r r_rÝr rr"r"r"r#Ú_mains  rßÚ__main__)F)NTr)LÚ__doc__rr.Zos.pathrrÚ__all__rqrSr5rÂrµrÐÚsplitr¾r2r�r¬rrTrYrBÚ base_prefixr¿r·r½Úbase_exec_prefixrÀr¼Z _USER_BASErnrwrxr:r®r­rEÚgetcwdr0rÑÚendswithr r,r>r’rDrCrFr�rUrLrQrXr\r^r_r‰rr“r¤r¨r¯rrr r r rrrr r rÖrÝrßÚ__name__r"r"r"r#Úsÿö ø øé& ù ù ùì   ÿ          ? "  S Q  ÿ