zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
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
U
G=®deSã@s¼dZddlZddlZddlZddlZddlmZdejkZej     
ej ¡Z ej     
ej ¡Zej     
ej¡Zej     
ej¡Zdejkrej     ejd¡Zn&ejr®ej     ej     ej¡¡Zne ¡Zdd„Zeed    dƒZejd
krìd d „ZeeƒZeeƒZd d„ZeƒZdZ zes ej!Z Wne"k
r$YnXdd„Z#d-dd„Z$d.dd„Z%dd„Z&dd„Z'dd„Z(d/dd„Z)e *d¡Z+e *d¡Z,e *d ¡Z-d0d!d"„Z.d#d$„Z/da0d%d&„Z1d'd(„Z2d)d*„Z3d+d,„Z4dS)1aProvide 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:        <fdrake@acm.org>
éNé)ÚDistutilsPlatformErrorZ__pypy__Z_PYTHON_PROJECT_BASEcCs,dD]"}tj tj |d|¡¡rdSqdS)N)ÚSetupz Setup.localÚModulesTF)ÚosÚpathÚisfileÚjoin)ÚdÚfn©r úVD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/_distutils/sysconfig.pyÚ_is_python_source_dir,srÚ_homeÚntcCs0|r,tj |¡ tj tj td¡¡¡r,tS|S)NÚPCbuild)rrÚnormcaseÚ
startswithr    ÚPREFIX)r
r r r Ú _fix_pcbuild5s
ÿrcCstr ttƒSttƒS)N)Ú    _sys_homerÚ project_baser r r r Ú _python_build=srÚcCsdtjdd…S)z–Return 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_infor r r r Úget_python_versionQsrcCsÎ|dkr|rtpt}tr&tj |d¡Stjdkr|tr^|r@tp>t    Stj t
dƒd¡}tj  |¡Sdt ƒt }tj |d|¡Stjdkr¼tr®tj |d¡tjjtj |d¡Stj |d¡Std    tjƒ‚dS)
a¤Return 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'.
    NÚincludeÚposixÚsrcdirÚIncludeÚpythonrÚPCzFI don't know where Python installs its C header files on platform '%s')ÚBASE_EXEC_PREFIXÚ BASE_PREFIXÚIS_PYPYrrr    ÚnameÚ python_buildrrÚget_config_varÚnormpathrÚ build_flagsÚpathsepr)Ú plat_specificÚprefixÚincdirÚ
python_dirr r r Úget_python_incYs.  
 
 ÿÿÿr1cCsðtr8|dkrt}|r*tj |dtjd¡Stj |d¡S|dkr^|rR|rLtpNt}n |rZt    p\t}tj
dkr°|sp|r~t tddƒ}nd}tj ||dt ƒ¡}|r |Stj |d¡Sn<tj
d    krÞ|rÌtj |d
¡Stj |d
d¡Snt d tj
ƒ‚dS) 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'.
    Nz
lib-pythonrz site-packagesrZ
platlibdirÚlibr"rÚLibz?I don't know where Python installs its library on platform '%s')r&rrrr    rÚversionr$r%Ú EXEC_PREFIXr'Úgetattrrr)r-Ú standard_libr.ZlibdirÚ    libpythonr r r Úget_python_libƒs: 
 
ÿ
ÿÿr9c    Csö|jdkròtjdkr8tdƒs8ddl}| t¡dtd<tddd    d
d d d dƒ\}}}}}}}}    dtj    kr¨tj    d}
tjdkr¤d tj    kr¤| 
|¡r¤|
|t |ƒd…}|
}dtj    kr¼tj    d}d tj    krÐtj    d }dtj    krætj    d} n|d} dtj    kr |dtj    d}d    tj    kr<|dtj    d    }|dtj    d    }dtj    kr~| dtj    d} |dtj    d}|dtj    d}d tj    kr”tj    d }dtj    kr´|dtj    d} n |d|    } |d|} |j | | | d||||| d||_ dS)zÄDo any platform-specific customization of a CCompiler instance.
 
    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    ÚunixÚdarwinÚCUSTOMIZED_OSX_COMPILERrNÚTrueÚCCÚCXXÚCFLAGSÚCCSHAREDÚLDSHAREDÚ SHLIB_SUFFIXÚARÚARFLAGSÚCPPz -EÚLDFLAGSú ÚCPPFLAGS)Ú preprocessorÚcompilerÚ compiler_soÚ compiler_cxxÚ    linker_soÚ
linker_exeÚarchiver)Ú compiler_typerÚplatformr)Ú _osx_supportÚcustomize_compilerÚ _config_varsÚget_config_varsrÚenvironrÚlenÚset_executablesÚshared_lib_extension)rKrSÚccÚcxxÚcflagsÚccsharedÚldsharedÚ shlib_suffixÚarÚar_flagsÚnewccÚcpprPÚcc_cmdr r r rT¹sn 
 
ÿÿ
 
 
ÿþ
 
 
 
 
 
 
ù    rTcCsDtr,tjdkr"tj tptd¡}q6tp(t}n
tdd}tj |d¡S)z2Return full pathname of installed pyconfig.h file.rr#r©r-z
pyconfig.h)r(rr'rr    rrr1)Úinc_dirr r r Úget_config_h_filenames 
 
 
rhcCs\trtj tptd¡Stddd}d tƒt    ¡}t
t j dƒrL|dt j j 7}tj ||d¡S)zAReturn full pathname of installed Makefile from the Python build.ÚMakefilerr©r-r7z config-{}{}Ú
_multiarchz-%s)r(rrr    rrr9Úformatrr+ÚhasattrrÚimplementationrk)Úlib_dirÚ config_filer r r Úget_makefile_filenames  rqcCsš|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_]+) [*]/
rrr)ÚreÚcompileÚreadlineÚmatchÚgroupÚintÚ
ValueError)ÚfpÚgÚ    define_rxÚundef_rxÚlineÚmÚnÚvr r r Úparse_config_hs&
 
 
 
 
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_]*)}c    Cs¶ddlm}||ddddd}|dkr*i}i}i}| ¡}|dkrDqÄt |¡}|r2| dd¡\}}    |     ¡}    |     dd    ¡}
d
|
krˆ|    ||<q2z t|    ƒ}    Wn$t    k
r¸|     dd
¡||<Yq2X|    ||<q2d } |rtt
|ƒD]˜} || } t   | ¡pöt   | ¡}|rj| d¡}d }||kr$t||ƒ}nˆ||kr4d }nx|tjkrLtj|}n`|| kr |  d¡rz| dd…| krzd    }n$d||krŽd }nt|d|ƒ}n d    ||<}|rp| | ¡d…}| d| ¡…||} d
|krî| || <nzz t| ƒ} Wn"t    k
r|  ¡|| <Yn
X| || <|| =|  d¡rp| dd…| krp| dd…} | |krp| || <qÖ|| =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.
    r)ÚTextFilerÚsurrogateescape)Ústrip_commentsÚ skip_blanksÚ
join_linesÚerrorsNrz$$rú$)r@rGrITFÚPY_é)Údistutils.text_filer‚rtÚ _variable_rxrurvÚstripÚreplacerwrxÚlistÚ _findvar1_rxÚsearchÚ _findvar2_rxÚstrrrWrÚendÚstartÚcloseÚitemsÚ
isinstanceÚupdate)r rzr‚ryÚdoneÚnotdoner}r~rr€ÚtmpvÚrenamed_variablesr'ÚvalueÚfoundÚitemÚafterÚkr r r Úparse_makefile=s„ 
 
 
 
 
 
 
 
 
  ÿ 
 
 
 
r£cCsVt |¡pt |¡}|rR| ¡\}}|d|…| | d¡¡||d…}qqRq|S)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'.
    rrN)rr‘r’ÚspanÚgetrv)ÚsÚvarsr~Úbegr”r r r Úexpand_makefile_vars§s  *r©c
Cs†tj ddjtjtjttjddƒd¡}zt    |t
ƒt ƒdgdƒ}Wn*t k
rlt    dt
ƒt ƒdgdƒ}YnX|j }iat |¡d    S)
z7Initialize the module as appropriate for POSIX systems.Ú_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rkr)ÚabirRÚ    multiarchÚbuild_time_varsrZ_sysconfigdataN)rrWr¥rlrÚabiflagsrRr6rnÚ
__import__ÚglobalsÚlocalsÚ ImportErrorr­rUr™)r'Ú_tempr­r r r Ú _init_posixÂs( ýÿÿ
r´cCs~i}tddd|d<tddd|d<tdd|d<t ¡d|d<d    |d
<tƒ d d ¡|d <tj tj     t
j ¡¡|d<|a dS)z+Initialize the module as appropriate for NTrrrjÚLIBDESTÚ
BINLIBDESTrfÚ    INCLUDEPYÚ
EXT_SUFFIXz.exeÚEXEÚ.rÚVERSIONÚBINDIRN) r9r1Ú_impÚextension_suffixesrrŽrrÚdirnameÚabspathrÚ
executablerU)rzr r r Ú_init_nt×srÂcGsbtdkr0tƒ dtj¡}|r(|ƒniattd<ttd<tst d¡}|dk    r\|td<t dt¡}tjdkr¢t    r”tj
  t ƒ¡}tj
  ||¡}ntj
  t ƒ¡}tj
 tj
 |¡¡td<t    rtjdkrt}tj
 td¡s|t ¡krtj
  |td¡}tj
 |¡td<tjd    kr0d
dl}| t¡|rZg}|D]}| t |¡¡q>|StSdS) aßWith 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.
    NÚ_init_r.Ú exec_prefixr¸ÚSOr rr;r)rUr°r¥rr'rr5r&rr(rr¿rqr    rÀr*ÚisabsÚgetcwdrrRrSÚcustomize_config_varsÚappend)ÚargsÚfuncrÅr ÚbaserSÚvalsr'r r r rVêsD
 
 
 
ÿ 
rVcCs*|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_SUFFIXr)ÚwarningsÚwarnÚDeprecationWarningrVr¥)r'rÎr r r r)5sr))rN)rrN)N)N)5Ú__doc__r½rrrrr‡rÚbuiltin_module_namesr&rr*r.rrÄr5Ú base_prefixr%Úbase_exec_prefixr$rWrÀrrÁr¿rÇrr6rr'rrr(r+r®ÚAttributeErrorrr1r9rTrhrqrrsrŒrr’r£r©rUr´rÂrVr)r r r r Ú<module>s\  
 
 
 
 
*
6I 
 
 
 
 
jK