a ˆljæhã@s”dZddlZddlZddlZddlZddlmZmZz ddlZWne yZddl ZYn0gd¢Z dd„Z ej r†ej e ej ƒ¡Zn e e ¡ƒZejdkrÂded d… ¡vrÂe ej ee¡ƒZejdkrôd ed d… ¡vrôe ej eee¡ƒZejdkr*d ed d… ¡vr*e ej eee¡ƒZdd„ZeƒZdadd„Ze ¡Ze d¡Zdd„Zdejdd…Zdejdd…Z dejdd…Z!ej "ej#¡Z$ej "ej%¡Z&da'dZ(dd„Z)dd„Z*dd „Z+d!d"„Z,d#d$„Z-d%d&„Z.dId'd(„Z/d)d*„Z0d+d,„Z1d-d.„Z2dJd/d0„Z3d1d2„Z4d3d4„Z5d5d6„Z6e-ƒdd7fd8d9„Z7e-ƒdd7fd:d;„Z8dd?„Z:d@dA„Z;dBdC„Ze?dHkre>ƒdS)Kz-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_hcCs&z t|ƒWSty |YS0dS©N)rÚOSError)Úpath©rúK/usr/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyÚ_safe_realpath"s  rÚntZpcbuildiøÿÿÿz\pc\viöÿÿÿz\pcbuild\amd64iòÿÿÿcCs,dD]"}tj tj td|¡¡rdSqdS)N)z Setup.distz Setup.localZModulesTF)ÚosrÚisfileÚjoinÚ _PROJECT_BASE)ÚfnrrrÚis_python_build:srFcCs¢tsžddlm}t dd¡d}||ƒ}| d¡}|s>Jdƒ‚| ¡}t |¡Wdƒn1sf0Yt ršdD] }t  |d d ¡t  |d d ¡qxd adS)Né)ÚfinderÚ.érz sysconfig.cfgzsysconfig.cfg exists)Ú posix_prefixZ posix_homeÚincludez{srcdir}/IncludeÚ platincludez{projectbase}/.T) Ú _cfg_readZ resourcesrÚ__name__ÚrsplitÚfindZ as_streamÚ_SCHEMESZreadfpÚ _PYTHON_BUILDÚset)rZbackport_packageZ_finderZ_cfgfileÚsÚschemerrrÚ_ensure_cfg_readDs    (r,z \{([^{]*?)\}c sÈtƒ| d¡r| d¡}ntƒ}| ¡}|D]8}|dkr._replacer) r,Z has_sectionÚitemsÚtupleÚsectionsZ has_optionr)Zremove_sectionÚdictÚ _VAR_REPLÚsub)Úconfigr-r8ÚsectionÚoptionÚvaluer5rr3rÚ_expand_globalsYs$       r@z%s.%s.%séz%s.%srz%s%scs‡fdd„}t ||¡S)z»In the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8| d¡}|ˆvrˆ|S|tjvr.tj|S| d¡Sr.)r0rÚenvironr1©Ú local_varsrrr5‰s    z_subst_vars.._replacer©r:r;)rrDr5rrCrÚ _subst_varsƒs rFcCs0| ¡}| ¡D]\}}||vr"q|||<qdSr)Úkeysr6)Z target_dictZ other_dictZ target_keysÚkeyr?rrrÚ _extend_dict“s rIcCs`i}|duri}t|tƒƒt |¡D]4\}}tjdvrDtj |¡}tj t ||ƒ¡||<q&|S)N)Úposixr) rIrr'r6rr2rÚ expanduserÚnormpathrF)r+ÚvarsÚresrHr?rrrÚ _expand_vars›s   rOcs‡fdd„}t ||¡S)Ncs$| d¡}|ˆvrˆ|S| d¡Sr.r/r1©rMrrr5©s zformat_value.._replacerrE)r?rMr5rrPrÚ format_value¨s rQcCstjdkrdStjS)NrJr )rr2rrrrÚ_get_default_scheme±s rRcCs’tj dd¡}dd„}tjdkrBtj d¡p.d}|r8|S||dƒStjdkr|td ƒ}|r||r`|S|dd |d tjdd …ƒS|r„|S|dd ƒSdS)NÚPYTHONUSERBASEcWstj tjj|Ž¡Sr)rrrKr)ÚargsrrrÚjoinuser»sz_getuserbase..joinuserrÚAPPDATAú~ÚPythonÚdarwinZPYTHONFRAMEWORKÚLibraryz%d.%drz.local)rrBÚgetr2ÚsysÚplatformrÚ version_info)Úenv_baserUÚbaseZ frameworkrrrÚ _getuserbase¸s$     ÿrac Cst d¡}t d¡}t d¡}|dur*i}i}i}tj|ddd}| ¡}Wdƒn1s`0Y|D]˜} |  d¡sn|  ¡d krŠqn| | ¡} | rn|  d d ¡\} } |  ¡} |   d d ¡} d | vrÎ| || <qnz t | ƒ} Wn"t yü|   d d ¡|| <Yqn0| || <qnt |  ¡ƒ}d}t|ƒdkrät|ƒD]®}||}| |¡pP| |¡} | durÊ|  d ¡} d}| |vr‚t|| ƒ}nˆ| |vr’d}nx| tjvrªtj| }n`| |vrþ| d¡rØ|dd…|vrØd }n$d| |vrìd}nt|d| ƒ}n d || <}|rÜ||  ¡d…}|d|  ¡…||}d |vrL|||<n|z t |ƒ}Wn t yx| ¡||<Yn 0|||<| |¡| d¡rÜ|dd…|vrÜ|dd…}||vrÜ|||<n|||<| |¡q.q| ¡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. 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_]*)}Nzutf-8Úsurrogateescape)ÚencodingÚerrorsú#Úrrz$$ú$)ÚCFLAGSÚLDFLAGSZCPPFLAGSrTFZPY_rA)ÚreÚcompileÚcodecsÚopenÚ readlinesÚ startswithÚstripÚmatchr0ÚreplaceÚintÚ ValueErrorÚlistrGÚlenr7ÚsearchÚstrrrBÚendÚstartÚremover6Ú isinstanceÚupdate)ÚfilenamerMZ _variable_rxZ _findvar1_rxZ _findvar2_rxZdoneZnotdoneÚfÚlinesÚlineÚmÚnÚvZtmpvr4Zrenamed_variablesr2r?ÚfoundÚitemZafterÚkrrrÚ_parse_makefileÕs   &               ÿ      ÿ     rˆcCsDtrtj td¡Sttdƒr,dttjf}nd}tj t dƒ|d¡S)z Return the path of the Makefile.ZMakefileÚabiflagsz config-%s%sr<Ústdlib) r(rrrrÚhasattrr\Ú_PY_VERSION_SHORTr‰r)Zconfig_dir_namerrrrKs  rc Cstƒ}zt||ƒWnLty`}z4d|}t|dƒrD|d|j}t|ƒ‚WYd}~n d}~00tƒ}z6t|ƒ}t||ƒWdƒn1s’0YWnLtyê}z4d|}t|dƒrÎ|d|j}t|ƒ‚WYd}~n d}~00trü|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sÚstrerrorz (%s)NÚ BLDSHAREDZLDSHARED) rrˆÚIOErrorr‹rrrmrr()rMZmakefileÚeÚmsgZconfig_hrrrrÚ _init_posixVs&  , r’cCsVtdƒ|d<tdƒ|d<tdƒ|d<d|d<d |d <t|d <tj ttjƒ¡|d <d S)z+Initialize the module as appropriate for NTrŠZLIBDESTZ platstdlibZ BINLIBDESTr!Z INCLUDEPYz.pydZSOz.exeZEXEZVERSIONZBINDIRN)rÚ_PY_VERSION_SHORT_NO_DOTrrÚdirnamerr\Ú executablerPrrrÚ_init_non_posixrs   r–cCs˜|dur i}t d¡}t d¡}| ¡}|s.q”| |¡}|rv| dd¡\}}z t|ƒ}WntyjYn0|||<q | |¡}|r d|| d¡<q |S)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. Nz"#define ([A-Z][A-Za-z0-9_]+) (.*) z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/ rrr)rjrkÚreadlinerqr0rsrt)ÚfprMZ define_rxZundef_rxrr‚rƒr„rrrr‚s&       rcCs:tr$tjdkrtj td¡}q,t}ntdƒ}tj |d¡S)zReturn the path of pyconfig.h.rZPCr"z pyconfig.h)r(rr2rrrr)Zinc_dirrrrr¡s  rcCsttt ¡ƒƒS)z,Return a tuple containing the schemes names.)r7Úsortedr'r8rrrrr ­sr cCs t d¡S)z*Return a tuple containing the paths names.r )r'Úoptionsrrrrr ²sr TcCs&tƒ|rt||ƒStt |¡ƒSdS)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. N)r,rOr9r'r6)r+rMÚexpandrrrr ¸s r cCst|||ƒ|S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r2r+rMr›rrrrÅsrcGs¨tdurviattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ztjtd <Wnty‚d td <Yn0t j dvr–t tƒt j dkr¨t tƒtj dkr¼tƒtd<dtvrÎttd<nttdƒtd<trXt j dkrXt}z t  ¡}Wntyd}Yn0t j td¡sX||krXt j |td¡}t j |¡td<tjdkrvt  ¡d}t| d¡dƒ}|dkrÆdD]2}t|}t dd|¡}t dd|¡}|t|<qn°dt jvrt jd}dD]0}t|}t dd|¡}|d|}|t|<qàt dd ¡} t d| ¡} | durv|   d¡} t j !| ¡svdD]$}t|}t dd|¡}|t|<qP|r g} |D]} |  "t | ¡¡q„| StSdS)ayWith 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 and Mac OS 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. NÚprefixÚ exec_prefixZ py_versionZpy_version_shortrrZpy_version_nodotr`ZplatbaseZ projectbaser‰rf)rZos2rJz2.6ÚuserbaseÚsrcdirrYré)riZ BASECFLAGSrhZ PY_CFLAGSrŽz -arch\s+\w+\sú z-isysroot [^ ]*Z ARCHFLAGSrhz-isysroot\s+(\S+)rz-isysroot\s+\S+(\s|$))#Ú _CONFIG_VARSÚ_PREFIXÚ _EXEC_PREFIXÚ _PY_VERSIONrŒrr\r‰ÚAttributeErrorrr2r–r’Úversionrarr(ÚgetcwdrrÚisabsrrLr]ÚunamersÚsplitrjr;rBr[rwr0ÚexistsÚappend)rTr`ÚcwdrŸZkernel_versionÚ major_versionrHÚflagsZarchrhr‚ZsdkZvalsr2rrrrÍs‚         ÿ           rcCs 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) )rr[)r2rrrrPsrcCsdtjdkrnd}tj |¡}|dkr(tjStj d|¡}tj|t|ƒ|… ¡}|dkr\dS|dkrhdStjStjd ks‚ttd ƒsˆtjSt  ¡\}}}}}| ¡  d d ¡}|  d d¡}|  d d¡}|dd…dkrÞd||fS|dd…dkr&|ddkrVd}dt |dƒd|dd…f}n0|dd…dkrDd||fS|dd…dkrdd|||fS|dd…d kr d }t   d!¡} |  |¡} | rV|  ¡}n¶|dd…d"krVtƒ} |  d#¡} | } z td$ƒ}WntyæYnR0zt  d%| ¡¡} W| ¡n | ¡0| dur8d& |  d'¡ d&¡dd…¡} | sB| } | rV| }d(}| d&d)krd*tƒ d+d ¡ ¡vrd,}tƒ d+¡}t  d-|¡}ttt|ƒƒƒ}t|ƒd'krº|d}n^|d.krÊd,}nN|d/krÚd0}n>|d1krêd2}n.|d3krúd4}n|d5kr d6}ntd7|fƒ‚n<|d8kr6tjd9krVd:}n |d;vrVtjd9krRd<}nd=}d>|||fS)?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; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit (éÿÿÿÿú)Zamd64z win-amd64Zitaniumzwin-ia64rJrªú/rfr¡Ú_ú-NéZlinuxz%s-%sZsunosrÚ5Zsolarisz%d.%srAréZirixZaixz%s-%s.%séÚcygwinz[\d.]+rYZMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)rrZmacosxz10.4.z-archrhZfatz -arch\s+(\S+))Úi386Úppc)r»Úx86_64Zintel)r»r¼r½Zfat3)Úppc64r½Zfat64)r»r¼r¾r½Ú universalz%Don't know machine value for archs=%rr»lr½)ZPowerPCZPower_Macintoshr¾r¼z%s-%s-%s) rr2r\r§r&r]rvÚlowerr‹rªrrrsrjrkrqr0rr[rmrrwÚreadÚcloserr«rpÚfindallr7r™r)rtÚmaxsize)rœÚiÚjZlookZosnameÚhostÚreleaser§ÚmachineZrel_rer‚ZcfgvarsZmacverZ macreleaserZcflagsZarchsrrrr Ys¨     $      ÿ ÿ        ÿ    r cCstSr)rŒrrrrr ûsr cCsFtt| ¡ƒƒD]0\}\}}|dkr0td|ƒtd||fƒqdS)Nrz%s: z %s = "%s")Ú enumerater™r6Úprint)ÚtitleÚdataÚindexrHr?rrrÚ _print_dictÿs rÏcCsRtdtƒƒtdtƒƒtdtƒƒtƒtdtƒƒtƒtdtƒƒdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ VariablesN)rËr r rRrÏr rrrrrÚ_mains rÐÚ__main__)N)N)@Ú__doc__rlrrjr\Zos.pathrrZ configparserÚ ImportErrorZ ConfigParserÚ__all__rr•rr”rr¨r2rÀrrr(r#r,ZRawConfigParserr'rkr:r@r^r¥rŒr“rLrœr£rr¤r¢Z _USER_BASErFrIrOrQrRrarˆrr’r–rrr r r rrrr r rÏrÐr$rrrrÚsx   " !   v     #