/opt/alt/python38/lib/python3.8/site-packages/setuptools/__pycache__
Edit: /opt/alt/python38/lib/python3.8/site-packages/setuptools/__pycache__/depends.cpython-38.pyc (5198B)
U
ab @ s d dl Z d dlZd dlZd dlZd dlmZ ddlmZmZm Z m
Z
ddlmZ dddd gZG d
d dZ
dd ZdddZddd Zdd Ze dS ) N)
StrictVersion )find_modulePY_COMPILED PY_FROZEN PY_SOURCE)_impRequirer get_module_constantextract_constantc @ sH e Zd ZdZdddZdd Zdd ZdddZdd
dZdddZ dS )r z7A prerequisite to building or installing a distribution Nc C sF |d kr|d k rt }|d k r0||}|d kr0d}| jt | `d S )N__version__)r __dict__updatelocalsself)r namerequested_versionmoduleZhomepage attributeformat r :/tmp/pip-install-7tp5dx2w/setuptools/setuptools/depends.py__init__ s zRequire.__init__c C s | j dk rd| j| j f S | jS )z0Return full package/distribution name, w/versionNz%s-%s)r r )r r r r full_name" s
zRequire.full_namec C s* | j dkp(| jdkp(t|dko(|| jkS )z%Is 'version' sufficiently up-to-date?Nunknown)r r strr )r versionr r r
version_ok( s zRequire.version_okr c C s | j dkrFz$t| j|\}}}|r*| |W S tk
rD Y dS X t| 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)r r r closeImportErrorr
r )r pathsdefaultfpivr r r get_version- s
zRequire.get_versionc C s | |dk S )z/Return true if dependency is present on 'paths'N)r' )r r! r r r
is_presentH s zRequire.is_presentc C s | |}|dkrdS | |S )z>Return true if dependency is present and up-to-date on 'paths'NF)r' r )r r! r r r r
is_currentL s
zRequire.is_current)r NN)Nr )N)N)
__name__
__module____qualname____doc__r r r r' r( r) r r r r r s
c C s" t jdd }| s| S t | S )Nc s s
d V d S )Nr r r r r emptyU s zmaybe_close.
.empty)
contextlibcontextmanagerclosing)r# r. r r r maybe_closeT s
r2 c
C s zt | | \}}\}}}} W n tk
r4 Y dS X t|z |tkr^|d t|}
nV|tkrtt | |}
n@|t
krt| |d}
n&t| || }t
||dW 5 Q R S W 5 Q R X t|
||S )zFind '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)r r r2 r readmarshalloadr r get_frozen_objectr compileZ
get_modulegetattrr )r symbolr" r! r# pathsuffixmodekindinfocodeZimportedr r r r
_ s
"c C s || j krdS t| j |}d}d}d}|}t| D ]H}|j} |j}
| |kr\| j|
}q8|
|kr|| |kst| |kr|| S |}q8dS )a Extract 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'.
NZ a d )co_nameslistindexdisBytecodeopcodearg co_consts)rB r<