관리-도구
편집 파일: markers.cpython-38.pyc
U ʗRe� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZm Z ddl mZ dgZ e�d�Zd d � Zdd� ZG d d� de�Ze�d�Zdd� Ze� Z[e� Zddd�ZdS )zG Parser for the environment markers micro-language defined in PEP 508. � N� )�string_types)�in_venv�parse_marker)�NormalizedVersion� interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")c C s t | t�r| sdS | d dkS )NFr �'")� isinstancer )�o� r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/distlib/markers.py�_is_literal s r c C s2 g }t �| �D ]}|�t|�� d �� qt|�S )Nr )�_VERSION_PATTERN�finditer�append�NV�groups�set)�s�result�mr r r � _get_versions! s r c @ sf e Zd ZdZdd� dd� dd� dd� dd� dd� d d� d d� dd� dd� d d� dd� d�Zdd� ZdS )� Evaluatorz; This class is used to evaluate marker expessions. c C s | |kS �Nr ��x�yr r r �<lambda>- � zEvaluator.<lambda>c C s | |kS r r r r r r r . r c C s | |kp| |kS r r r r r r r / r c C s | |kS r r r r r r r 0 r c C s | |k S r r r r r r r 1 r c C s | |kp| |k S r r r r r r r 2 r c C s | |kS r r r r r r r 3 r c C s | |kp| |kS r r r r r r r 4 r c C s | o|S r r r r r r r 5 r c C s | p|S r r r r r r r 6 r c C s | |kS r r r r r r r 7 r c C s | |kS r r r r r r r 8 r )�==�===�~=�!=�<�<=�>�>=�and�or�in�not inc C s" t |t�rB|d dkr$|dd� }n||kr8td| ��|| }n�t |t�sPt�|d }|| jkrntd| ��|d }|d }t|d �r�t|d �r�td |||f ��| �||�}| �||�}|dks�|dkr�|dkr�t |�}t |�}n$|dk�r|d k�rt |�}t |�}| j| ||�}|S )z� Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. r r r ���zunknown variable: %s�opzop not implemented: %s�lhs�rhszinvalid comparison: %s %s %s�python_version)r# r$ r% r&