zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
G=®dã@sœddlZddlZddlZddlmZddlmZddlmZm    Z    m
Z
m Z ddl mZddd    d
gZ Gd d„dƒZd d „Zddd    „Zddd
„Zdd„ZeƒdS)éN)Ú StrictVersioné)ÚBytecode)Ú find_moduleÚ PY_COMPILEDÚ    PY_FROZENÚ    PY_SOURCE)Ú
py27compatÚRequirerÚget_module_constantÚextract_constantc@sHeZdZdZddd„Zdd„Zdd    „Zdd d „Zdd d„Zddd„Z    dS)r
z7A prerequisite to building or installing a distributionÚNcCsF|dkr|dk    rt}|dk    r0||ƒ}|dkr0d}|j tƒ¡|`dS)NÚ __version__)rÚ__dict__ÚupdateÚlocalsÚself)rÚnameÚrequested_versionÚmoduleZhomepageÚ    attributeÚformat©rúID:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/depends.pyÚ__init__szRequire.__init__cCs |jdk    rd|j|jfS|jS)z0Return full package/distribution name, w/versionNz%s-%s)rr)rrrrÚ    full_name#s
zRequire.full_namecCs*|jdkp(|jdkp(t|ƒdko(||jkS)z%Is 'version' sufficiently up-to-date?NÚunknown)rrÚstrr)rÚversionrrrÚ
version_ok)sÿzRequire.version_okrcCs€|jdkrFz$t|j|ƒ\}}}|r*| ¡|WStk
rDYdSXt|j|j||ƒ}|dk    r|||k    r||jdk    r|| |¡S|S)a×Get version number of installed module, 'None', or 'default'
 
        Search 'paths' for module.  If not found, return 'None'.  If found,
        return the extracted version attribute, or 'default' if no version
        attribute was specified, or the value cannot be determined without
        importing the module.  The version is formatted according to the
        requirement's version format (if any), unless it is 'None' or the
        supplied 'default'.
        N)rrrÚcloseÚ ImportErrorr r)rÚpathsÚdefaultÚfÚpÚiÚvrrrÚ get_version.s
 
zRequire.get_versioncCs| |¡dk    S)z/Return true if dependency is present on 'paths'N)r()rr"rrrÚ
is_presentIszRequire.is_presentcCs | |¡}|dkrdS| |¡S)z>Return true if dependency is present and up-to-date on 'paths'NF)r(r)rr"rrrrÚ
is_currentMs
zRequire.is_current)r NN)Nr)N)N)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrr(r)r*rrrrr
sþ
 
 
cCs"tjdd„ƒ}|s|ƒSt |¡S)Ncss
dVdS)NrrrrrÚemptyVszmaybe_close.<locals>.empty)Ú
contextlibÚcontextmanagerÚclosing)r$r/rrrÚ maybe_closeUs
 
r3éÿÿÿÿc
CsÊzt||ƒ\}}\}}}}    Wntk
r4YdSXt|ƒz|tkr^| d¡t |¡}
nV|tkrtt     ||¡}
n@|t
krŽt | ¡|dƒ}
n&t  |||    ¡} t | |dƒW5QR£SW5QRXt|
||ƒS)züFind 'module' by searching 'paths', and extract 'symbol'
 
    Return 'None' if 'module' does not exist on 'paths', or it does not define
    'symbol'.  If the module defines 'symbol' as a constant, return the
    constant.  Otherwise, return 'default'.NéÚexec)rr!r3rÚreadÚmarshalÚloadrr    Úget_frozen_objectrÚcompileZ
get_moduleÚgetattrr ) rÚsymbolr#r"r$ÚpathÚsuffixÚmodeÚkindÚinfoÚcodeZimportedrrrr `s
 
 "c Cs„||jkrdSt|jƒ |¡}d}d}d}|}t|ƒD]H}|j}    |j}
|    |krZ|j|
}q6|
|krz|    |ksr|    |krz|S|}q6dS)aExtract the constant value of 'symbol' from 'code'
 
    If the name 'symbol' is bound to a constant value by the Python code
    object 'code', return that value.  If 'symbol' is bound to an expression,
    return 'default'.  Otherwise, return 'None'.
 
    Return value is based on the first assignment to 'symbol'.  'symbol' must
    be a global, or at least a non-"fast" local in the code block.  That is,
    only 'STORE_NAME' and 'STORE_GLOBAL' opcodes are checked, and 'symbol'
    must be present in 'code.co_names'.
    NéZéaéd)Úco_namesÚlistÚindexrÚopcodeÚargÚ    co_consts) rCr=r#Zname_idxÚ
STORE_NAMEÚ STORE_GLOBALÚ
LOAD_CONSTÚconstZ    byte_codeÚoprKrrrr }s
  cCs>tj d¡stjdkrdSd}|D]}tƒ|=t |¡q"dS)z•
    Patch the globals to remove the objects not available on some platforms.
 
    XXX it'd be better to test assertions about bytecode instead.
    ÚjavaÚcliN)r r )ÚsysÚplatformÚ
startswithÚglobalsÚ__all__Úremove)Z incompatiblerrrrÚ_update_globals¡s rZ)r4N)r4)rTr8r0Zdistutils.versionrZ
py33compatrr    rrrrr rXr
r3r r rZrrrrÚ<module>s"   ÿD
 
$