관리-도구
편집 파일: specifiers.cpython-39.pyc
a ?&Nb�} � @ s\ d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZddl m Z mZ ddlm Z ddlmZ ddlmZmZmZ e r�d dlmZmZmZmZmZmZmZmZ eeef Zeeeef Zeeege f Z!G d d � d e"�Z#G dd� deej$e%��Z&G d d� de&�Z'G dd� de'�Z(dd� Z)G dd� de'�Z*e�+d�Z,dd� Z-dd� Z.G dd� de&�Z/dS )� )�absolute_import�division�print_functionN� )�string_types�with_metaclass)� TYPE_CHECKING)�canonicalize_version)� LegacyVersion�Version�parse)�Callable�Dict�Iterable�Iterator�List�Optional�Tuple�Unionc @ s e Zd ZdZdS )�InvalidSpecifierzH An invalid specifier was found, users should refer to PEP 440. N)�__name__� __module__�__qualname__�__doc__� r r �8/usr/lib/python3.9/site-packages/packaging/specifiers.pyr s r c @ s� e Zd Zejdd� �Zejdd� �Zejdd� �Zejdd� �Zej d d � �Z e jdd � �Z ejdd d��Zejddd��Z dS )� BaseSpecifierc C s dS )z� Returns the str representation of this Specifier like object. This should be representative of the Specifier itself. Nr ��selfr r r �__str__ s zBaseSpecifier.__str__c C s dS )zF Returns a hash value for this Specifier like object. Nr r r r r �__hash__( s zBaseSpecifier.__hash__c C s dS )zq Returns a boolean representing whether or not the two Specifier like objects are equal. Nr �r �otherr r r �__eq__/ s zBaseSpecifier.__eq__c C s dS )zu Returns a boolean representing whether or not the two Specifier like objects are not equal. Nr r! r r r �__ne__7 s zBaseSpecifier.__ne__c C s dS )zg Returns whether or not pre-releases as a whole are allowed by this specifier. Nr r r r r �prereleases? s zBaseSpecifier.prereleasesc C s dS )zd Sets whether or not pre-releases as a whole are allowed by this specifier. Nr �r �valuer r r r% G s Nc C s dS )zR Determines if the given item is contained within this specifier. Nr �r �itemr% r r r �containsO s zBaseSpecifier.containsc C s dS )z� Takes an iterable of items and filters them so that only items which are contained within this specifier are allowed in it. Nr )r �iterabler% r r r �filterV s zBaseSpecifier.filter)N)N)r r r �abc�abstractmethodr r r# r$ �abstractpropertyr% �setterr* r, r r r r r s r c @ s� e Zd Zi Zd"dd�Zdd� Zdd� Zed d � �Zdd� Z d d� Z dd� Zdd� Zdd� Z edd� �Zedd� �Zedd� �Zejdd� �Zdd� Zd#dd�Zd$d d!�ZdS )%�_IndividualSpecifier� Nc C sF | j �|�}|std�|���|�d��� |�d��� f| _|| _d S )NzInvalid specifier: '{0}'�operator�version)�_regex�searchr �format�group�strip�_spec�_prereleases)r �specr% �matchr r r �__init__c s �z_IndividualSpecifier.__init__c C s0 | j d urd�| j�nd}d�| jjt| �|�S )N�, prereleases={0!r}r2 z<{0}({1!r}{2})>)r; r7 r% � __class__r �str�r Zprer r r �__repr__q s ��z_IndividualSpecifier.__repr__c C s dj | j� S )Nz{0}{1})r7 r: r r r r r { s z_IndividualSpecifier.__str__c C s | j d t| j d �fS )Nr r )r: r r r r r �_canonical_spec s z$_IndividualSpecifier._canonical_specc C s t | j�S �N)�hashrD r r r r r � s z_IndividualSpecifier.__hash__c C sR t |t�r6z| �t|��}W qF ty2 t Y S 0 nt || j�sFtS | j|jkS rE )� isinstancer r@ rA r �NotImplementedrD r! r r r r# � s z_IndividualSpecifier.__eq__c C sR t |t�r6z| �t|��}W qF ty2 t Y S 0 nt || j�sFtS | j|jkS rE )rG r r@ rA r rH r: r! r r r r$ � s z_IndividualSpecifier.__ne__c C s t | d�| j| ��}|S )Nz_compare_{0})�getattrr7 � _operators)r �op�operator_callabler r r � _get_operator� s �z"_IndividualSpecifier._get_operatorc C s t |ttf�st|�}|S rE )rG r r r �r r4 r r r �_coerce_version� s z$_IndividualSpecifier._coerce_versionc C s | j d S )Nr �r: r r r r r3 � s z_IndividualSpecifier.operatorc C s | j d S )Nr rP r r r r r4 � s z_IndividualSpecifier.versionc C s | j S rE �r; r r r r r% � s z _IndividualSpecifier.prereleasesc C s || _ d S rE rQ r&