zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
U
H=®dæhã @s¬dZddlZddlZddlZddlZddlmZmZz ddlZWne    k
r\ddl
ZYnXdddddd    d
d d d dg Z dd„Z ej ršej e ej ƒ¡Zn e e ¡ƒZejdkrÖdedd… ¡krÖe ej ee¡ƒZejdkr dedd… ¡kr e ej eee¡ƒZejdkrBdedd… ¡krBe ej eee¡ƒZdd„ZeƒZdadd„Ze ¡Ze d¡Zdd„Zd ejdd!…Zd"ejdd#…Z d$ejdd#…Z!ej "ej#¡Z$ej "ej%¡Z&da'dZ(d%d&„Z)d'd(„Z*d)d*„Z+d+d,„Z,d-d.„Z-d/d0„Z.dHd1d2„Z/d3d„Z0d4d5„Z1d6d7„Z2dId8d„Z3d9d„Z4d:d „Z5d;d    „Z6e-ƒdd<fd=d
„Z7e-ƒdd<fd>d„Z8d?d„Z9d@d„Z:dAd „Z;dBd „Z<dCdD„Z=dEdF„Z>e?dGkr¨e>ƒdS)Jz-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|ƒWStk
r"|YSXdS©N)rÚOSError)Úpath©rú^D:\z\workplace\VsCode\pyvenv\venv\Lib\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.localÚModulesTF)ÚosrÚisfileÚjoinÚ _PROJECT_BASE)ÚfnrrrÚis_python_build:srFc    CsŽtsŠddlm}t dd¡d}||ƒ}| d¡}|s>tdƒ‚| ¡}t     |¡W5QRXt
r†dD] }t  |d    d
¡t  |d d ¡qdd adS)Né)ÚfinderÚ.érz sysconfig.cfgzsysconfig.cfg exists)Ú posix_prefixÚ
posix_homeÚincludez{srcdir}/IncludeÚ platincludez{projectbase}/.T) Ú    _cfg_readÚ    resourcesrÚ__name__ÚrsplitÚfindÚAssertionErrorÚ    as_streamÚ_SCHEMESÚreadfpÚ _PYTHON_BUILDÚset)rZbackport_packageZ_finderZ_cfgfileÚsÚschemerrrÚ_ensure_cfg_readDs 
 
r2z \{([^{]*?)\}c
sÈtƒ| d¡r| d¡}ntƒ}| ¡}|D]8}|dkr<q.|D]$\}}| ||¡rVq@| |||¡q@q.| d¡| ¡D]H}t| |¡ƒ‰‡fdd„}| |¡D]\}}| ||t     
||¡¡q¢qzdS)NÚglobalscs$| d¡}|ˆkrˆ|S| d¡S©Nr r©Úgroup©ZmatchobjÚname©Ú    variablesrrÚ    _replaceros
z"_expand_globals.<locals>._replacer) r2Ú has_sectionÚitemsÚtupleÚsectionsÚ
has_optionr/Úremove_sectionÚdictÚ    _VAR_REPLÚsub)Úconfigr3r?ÚsectionÚoptionÚvaluer;rr9rÚ_expand_globalsYs$
 
  rIz%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¡}|ˆkrˆ|S|tjkr.tj|S| d¡Sr4)r6rÚenvironr7©Ú
local_varsrrr;‰s 
 
 
z_subst_vars.<locals>._replacer©rCrD)rrMr;rrLrÚ _subst_varsƒs rOcCs0| ¡}| ¡D]\}}||kr"q|||<qdSr)Úkeysr=)Ú target_dictÚ
other_dictÚ target_keysÚkeyrHrrrÚ _extend_dict“s
rUcCs`i}|dkri}t|tƒƒt |¡D]4\}}tjdkrDtj |¡}tj t    ||ƒ¡||<q&|S)N)Úposixr)
rUrr,r=rr8rÚ
expanduserÚnormpathrO)r1ÚvarsÚresrTrHrrrÚ _expand_vars›s 
 r[cs‡fdd„}t ||¡S)Ncs$| d¡}|ˆkrˆ|S| d¡Sr4r5r7©rYrrr;©s
zformat_value.<locals>._replacerrN)rHrYr;rr\rÚ format_value¨s r]cCstjdkrdStjS)NrVr!)rr8rrrrÚ_get_default_scheme±s
r^cCs’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)rrrWr)ÚargsrrrÚjoinuser»sz_getuserbase.<locals>.joinuserrÚAPPDATAú~ÚPythonÚdarwinZPYTHONFRAMEWORKÚLibraryz%d.%drz.local)rrKÚgetr8ÚsysÚplatformrÚ version_info)Úenv_baseraÚbaseZ    frameworkrrrÚ _getuserbase¸s$
 
 
 
 ÿrmc    Cst d¡}t d¡}t d¡}|dkr*i}i}i}tj|ddd}| ¡}W5QRX|D]š}    |     d¡sZ|     ¡d    krvqZ| |    ¡}
|
rZ|
 d
d ¡\} } |  ¡} |      d d    ¡} d | krº| || <qZz t
| ƒ} Wn$t k
rê|      d d ¡|| <YqZX| || <qZt |  ¡ƒ}d}t|ƒdkrÔt|ƒD]°}||}| |¡p>| |¡}
|
dk    rº|
 d
¡} d}| |krpt|| ƒ}nˆ| |kr€d}nx| tjkr˜tj| }n`| |krì| d¡rÆ|dd…|krÆd    }n$d| |krÚd}nt|d| ƒ}n d    || <}|rÌ||
 ¡d…}|d|
 ¡…||}d |kr:|||<n~z t
|ƒ}Wn"t k
rh| ¡||<Yn
X|||<| |¡| d¡rÌ|dd…|krÌ|dd…}||krÌ|||<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ú#Úr rz$$ú$)ÚCFLAGSÚLDFLAGSÚCPPFLAGSrTFÚPY_rJ)ÚreÚcompileÚcodecsÚopenÚ    readlinesÚ
startswithÚstripÚmatchr6ÚreplaceÚintÚ
ValueErrorÚlistrPÚlenr>ÚsearchÚstrrrKÚendÚstartÚremover=Ú
isinstanceÚupdate)ÚfilenamerYÚ _variable_rxÚ _findvar1_rxÚ _findvar2_rxÚdoneÚnotdoneÚfÚlinesÚlineÚmÚnÚvÚtmpvr:Úrenamed_variablesr8rHÚfoundÚitemÚafterÚkrrrÚ_parse_makefileÕs    
 
 
 
 
 
 
 
 
 
 
 ÿ 
 
 
 ÿ 
 
 
ržcCsDtrtj td¡Sttdƒr,dttjf}nd}tj t    dƒ|d¡S)z Return the path of the Makefile.ÚMakefileÚabiflagsz config-%s%srEÚstdlib)
r.rrrrÚhasattrrhÚ_PY_VERSION_SHORTr r)Úconfig_dir_namerrrrKs 
c
Csètƒ}zt||ƒWnJtk
r^}z,d|}t|dƒrF|d|j}t|ƒ‚W5d}~XYnXtƒ}z"t|ƒ}t||ƒW5QRXWnJtk
rÒ}z,d|}t|dƒrº|d|j}t|ƒ‚W5d}~XYnXträ|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sÚstrerrorz (%s)NÚ    BLDSHAREDÚLDSHARED)    rržÚIOErrorr¢r¥rr{rr.)rYÚmakefileÚeÚmsgÚconfig_hr’rrrÚ _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¡ÚLIBDESTÚ
platstdlibÚ
BINLIBDESTr#Ú    INCLUDEPYz.pydÚSOz.exeÚEXEÚVERSIONÚBINDIRN)rÚ_PY_VERSION_SHORT_NO_DOTrrÚdirnamerrhÚ
executabler\rrrÚ_init_non_posixrs   r¹cCsš|dkr i}t d¡}t d¡}| ¡}|s.q–| |¡}|rx| dd¡\}}z t|ƒ}Wntk
rlYnX|||<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_]+) [*]/
r rr)rxryÚreadlinerr6rr‚)ÚfprYÚ    define_rxÚundef_rxr”r•r–r—rrrr‚s&
 
 
 
 
cCs:tr$tjdkrtj td¡}q,t}ntdƒ}tj |d¡S)zReturn the path of pyconfig.h.rÚPCr$z
pyconfig.h)r.rr8rrrr)Úinc_dirrrrr¡s 
cCsttt ¡ƒƒS)z,Return a tuple containing the schemes names.)r>Úsortedr,r?rrrrr ­scCs
t d¡S)z*Return a tuple containing the paths names.r!)r,Úoptionsrrrrr    ²sTcCs&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)r2r[rBr,r=)r1rYÚexpandrrrr
¸s
cCst|||ƒ|S)z[Return a path corresponding to the scheme.
 
    ``scheme`` is the install scheme name.
    )r
)r8r1rYrÂrrrrÅscGs¬tdkrziattd<ttd<ttd<ttd<tdtdtd<ttd    <ttd
<ttd <ztjtd <Wntk
r„d td <YnXt    j
dkr˜t tƒt    j
dkrªt tƒtj dkr¾tƒtd<dtkrÐttd<nttdƒtd<tr\t    j
dkr\t}z t     ¡}Wntk
rd}YnXt    j td¡s\||kr\t    j |td¡}t    j |¡td<tjdkrzt     ¡d}t| d¡dƒ}|dkrÊdD]2}t|}t dd|¡}t dd|¡}|t|<q”n°dt    jkrt    jd}dD]0}t|}t dd|¡}|d|}|t|<qät dd ¡}    t d|    ¡}
|
dk    rz|
  d¡} t    j !| ¡szdD]$}t|}t dd|¡}|t|<qT|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_prefixÚ
py_versionÚpy_version_shortrrÚpy_version_nodotrlÚplatbaseÚ projectbaser rr)rZos2rVz2.6ÚuserbaseÚsrcdirreré)ruZ
BASECFLAGSrtZ    PY_CFLAGSr¦z -arch\s+\w+\sú z-isysroot [^     ]*Z    ARCHFLAGSrtz-isysroot\s+(\S+)r z-isysroot\s+\S+(\s|$))#Ú _CONFIG_VARSÚ_PREFIXÚ _EXEC_PREFIXÚ _PY_VERSIONr£rrhr ÚAttributeErrorrr8r¹r­Úversionrmrr.ÚgetcwdrrÚisabsrrXriÚunamerÚsplitrxrDrKrgr…r6ÚexistsÚappend)r`rlÚcwdrËZkernel_versionÚ major_versionrTÚflagsÚarchrtr•ZsdkÚvalsr8rrrrÍs‚
 
 
 
 
 
 
ÿ  
 
 
 
 cCs 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)
    )rrg)r8rrrrPscCs^tjdkrnd}tj |¡}|dkr(tjStj d|¡}tj|t|ƒ|… ¡}|dkr\dS|dkrhdStjStjd    ks‚ttd
ƒsˆtjSt     ¡\}}}}}| ¡ 
d d ¡}| 
d d¡}| 
d d¡}|dd…dkrÞd||fS|dd…dkr&|ddkrPd}dt |dƒd|dd…f}n*|dd…dkrDd||fS|dd…dkrdd|||fS|dd…d kr d }t   d!¡}    |     |¡}
|
rP|
 ¡}n°|dd…d"krPtƒ} |  d#¡} | } z td$ƒ}Wntk
rèYnJXzt  d%| ¡¡}
W5| ¡X|
dk    r2d& |
 d'¡ d&¡dd…¡} | s<| } | rP| }d(}| d&d)krd*tƒ d+d ¡ ¡krd,}tƒ d+¡}t  d-|¡}ttt|ƒƒƒ}t|ƒd'kr´|d}n^|d.krÄd,}nN|d/krÔd0}n>|d1kräd2}n.|d3krôd4}n|d5krd6}ntd7|fƒ‚n<|d8kr0tjd9krPd:}n |d;krPtjd9krLd<}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 (éÿÿÿÿú)Úamd64z    win-amd64Zitaniumzwin-ia64rVrÖú/rrrÍÚ_ú-NéÚlinuxz%s-%sÚsunosrÚ5Úsolarisz%d.%srJréZirixÚaixz%s-%s.%séÚcygwinz[\d.]+reÚMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>rr Úmacosxz10.4.z-archrtÚfatz -arch\s+(\S+))Úi386Úppc)rñÚx86_64Úintel)rñròróZfat3)Úppc64róÚfat64)rñròrõróÚ    universalz%Don't know machine value for archs=%rrñlró)ÚPowerPCÚPower_Macintoshrõròz%s-%s-%s) rr8rhrÓr)rir„Úlowerr¢rÖr€rrxryrr6rrgr{r¨Úcloser…Úreadrr×r~Úfindallr>rÀr/r‚Úmaxsize)rÃÚiÚjZlookÚosnameÚhostÚreleaserÓÚmachineÚrel_rer•ZcfgvarsZmacverZ
macreleaser’ÚcflagsZarchsrrrr Ys¨
    $ 
 
 
 ÿ
 
ÿ  
 
 
 
 
 
ÿ
 
 cCstSr)r£rrrrr ûscCsFtt| ¡ƒƒD]0\}\}}|dkr0td|ƒtd||fƒqdS)Nrz%s: z
    %s = "%s")Ú    enumeraterÀr=Úprint)ÚtitleÚdataÚindexrTrHrrrÚ _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"ÚPathsÚ    VariablesN)rr r r^r r
rrrrrÚ_mains rÚ__main__)N)N)@Ú__doc__rzrrxrhÚos.pathrrÚ configparserÚ ImportErrorÚ ConfigParserÚ__all__rr¸rr·rrÔr8rúrrr.r%r2ÚRawConfigParserr,ryrCrIrjrÑr£r¶rXrÃrÏrÄrÐrÎÚ
_USER_BASErOrUr[r]r^rmržrr­r¹rrr r    r
rrrr r r rr'rrrrÚ<module>sŽ õ ""
!     
v 
      #