HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //proc/self/root/usr/local/lib/python3.10/dist-packages/distlib/__pycache__/markers.cpython-310.pyc
o

j�h��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZdgZ
e�d�Zd	d
hZdd�Zd
d�Zdd�ZGdd�de�Ze�d�Zdd�Ze�Z[e�Zddd�Zddd�ZdS)zG
Parser for the environment markers micro-language defined in PEP 508.
�N�)�string_types)�in_venv�parse_marker)�
LegacyVersion�	interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")�python_version�python_full_versioncCst|t�o|tvS�N)�
isinstancer�_VERSION_MARKERS��s�r�:/usr/local/lib/python3.10/dist-packages/distlib/markers.py�_is_version_markersrcCst|t�r|s	dS|ddvS)NFr�'")rr)�orrr�_is_literal"srcCsdd�t�|�D�S)NcSsh|]
}t|��d��qS)r)�LV�groups)�.0�mrrr�	<setcomp>)sz _get_versions.<locals>.<setcomp>)�_VERSION_PATTERN�finditerr
rrr�
_get_versions(src
@sfeZdZdZdd�dd�dd�dd�dd�dd�d	d�d
d�dd�dd�d
d�dd�d�Zdd�ZdS)�	Evaluatorz<
    This class is used to evaluate marker expressions.
    cC�||kSr
r��x�yrrr�<lambda>2�zEvaluator.<lambda>cCrr
rrrrrr"3r#cC�||kp||kSr
rrrrrr"4�cCs||kSr
rrrrrr"5r#cCs||kSr
rrrrrr"6r#cCs||kp||kSr
rrrrrr"7r%cCs||kSr
rrrrrr"8r#cCr$r
rrrrrr"9r%cCs|o|Sr
rrrrrr":r#cCs|p|Sr
rrrrrr";r#cCs||vSr
rrrrrr"<r#cCs||vSr
rrrrrr"=r#)�==�===�~=�!=�<�<=�>�>=�and�or�in�not inc	Cs"t|t�r#|ddvr|dd�}|S||vrtd|��||}|St|t�s*J�|d}||jvr9td|��|d}|d	}t|d�rVt|d	�rVtd
|||f��|�||�}|�||�}t|�sjt|�rw|dvrwt	|�}t	|�}nt|�r�|dvr�t	|�}t
|�}|j|||�}|S)
z�
        Evaluate a marker expression returned by the :func:`parse_requirement`
        function in the specified context.
        rrr���zunknown variable: %s�opzop not implemented: %s�lhs�rhszinvalid comparison: %s %s %s)r*r+r,r-r'r&r)r()r0r1)rr�SyntaxError�dict�
operations�NotImplementedErrorr�evaluaterrr)	�self�expr�context�resultr3�elhs�erhsr4r5rrrr:@s6
��

zEvaluator.evaluateN)�__name__�
__module__�__qualname__�__doc__r8r:rrrrr,s �rz\d+\.\d+c
Cs�dd�}ttd�r|tjj�}tjj}nd}d}t��}t�|�}|�	d�}||t
jt��t��t�
�t��t��tt��||tjd�}|S)NcSs<d|j|j|jf}|j}|dkr||dt|j�7}|S)Nz%s.%s.%s�finalr)�major�minor�micro�releaselevel�str�serial)�info�version�kindrrr�format_full_versionhs
z,default_context.<locals>.format_full_version�implementation�0�r)�implementation_name�implementation_version�os_name�platform_machine�platform_python_implementation�platform_release�platform_system�platform_version�platform_in_venvr	r�sys_platform)�hasattr�sysrPrM�name�platformr�_DIGITS�match�group�os�machine�python_implementation�release�systemrJr)rOrTrS�ppvr�pvr>rrr�default_contextfs.



�rkcCs"tt�}|r|�|�t�||�Sr
)r7�DEFAULT_CONTEXT�update�	evaluatorr:)r<�execution_contextr=rrr�interpret_parsed�s
rpc
Csdzt|�\}}Wnty}ztd||f��d}~ww|r-|ddkr-td||f��t||�S)z�
    Interpret a marker and return a result depending on environment.

    :param marker: The marker to interpret.
    :type marker: str
    :param execution_context: The context used for name lookup.
    :type execution_context: mapping
    z)Unable to interpret marker syntax: %s: %sNr�#z*unexpected trailing data in marker: %s: %s)r�	Exceptionr6rp)�markerror<�rest�errrr�s	��
r
)rDrd�rer^r`�compatr�utilrrrMrr�__all__�compilerrrrr�objectrrarkrlrnrprrrrr�<module>s,

7$