????
Your IP : 3.142.201.19
a
���fb�@s�ddlZddlZddlZddlZddlmZddlmZmZm Z m
Z
ddlmZgd�ZGdd�d�Z
d d
�Zddd
�Zddd�Zdd�Ze�dS)�N)�
StrictVersion�)�find_module�PY_COMPILED� PY_FROZEN� PY_SOURCE)�_imp)�Requirer�get_module_constant�extract_constantc@sHeZdZdZddd�Zdd�Zdd �Zddd�Zdd
d�Zddd�Z dS)r z7A prerequisite to building or installing a distribution�NcCsF|dur|durt}|dur0||�}|dur0d}|j�t��|`dS)N�__version__)r�__dict__�update�locals�self)r�name�requested_version�moduleZhomepage� attribute�format�r�6/usr/lib/python3.9/site-packages/setuptools/depends.py�__init__szRequire.__init__cCs |jdurd|j|jfS|jS)z0Return full package/distribution name, w/versionNz%s-%s)rr)rrrr� full_name"s
zRequire.full_namecCs*|jdup(|jdup(t|�dko(||jkS)z%Is 'version' sufficiently up-to-date?N�unknown)rr�strr)r�versionrrr�
version_ok(s�zRequire.version_okrcCs~|jdurDz$t|j|�\}}}|r*|��|WStyBYdS0t|j|j||�}|durz||urz|jdurz|�|�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|�|�duS)z/Return true if dependency is present on 'paths'N)r')rr!rrr�
is_presentHszRequire.is_presentcCs |�|�}|durdS|�|�S)z>Return true if dependency is present and up-to-date on 'paths'NF)r'r)rr!rrrr�
is_currentLs
zRequire.is_current)rNN)Nr)N)N)
�__name__�
__module__�__qualname__�__doc__rrrr'r(r)rrrrr s�
r cCs"tjdd��}|s|�St�|�S)Ncss
dVdS)Nrrrrr�emptyUszmaybe_close.<locals>.empty)�
contextlib�contextmanager�closing)r#r.rrr�maybe_closeTs
r2���cCs�zt||�\}}\}}}} Wnty2YdS0t|���|tkr\|�d�t�|�}
nX|tkrrt� ||�}
nB|t
kr�t|��|d�}
n(t�||| �}t
||d�Wd�SWd�n1s�0Yt|
||�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 r2r�read�marshal�loadrr�get_frozen_objectr�compileZ
get_module�getattrr)r�symbolr"r!r#�path�suffix�mode�kind�info�codeZimportedrrrr
_s
8r
cCs�||jvrdSt|j��|�}d}d}d}|}t�|�D]H}|j} |j}
| |kr\|j|
}q8|
|kr|| |kst| |kr||S|}q8dS)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�index�disZBytecodeZopcode�arg� co_consts)rBr<r"Zname_idxZ
STORE_NAMEZSTORE_GLOBALZ
LOAD_CONST�constZ byte_code�oprJrrrr|s
rcCs>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.
�javaZcliN)rr
)�sys�platform�
startswith�globals�__all__�remove)Zincompatiblerrrr�_update_globals�srU)r3N)r3)rOr7r/rIZdistutils.versionrrrrrrrrSr r2r
rrUrrrr�<module>sD
$