관리-도구
편집 파일: specifiers.cpython-38.pyc
U &?�f:� � @ s( d Z ddlmZ ddlZddlZddlZddlmZmZm Z m Z mZ ddlm Z ddlmZ eeef Ze ded �Zeeegef Zd dd�d d�ZG dd� de�ZG dd� dejd�ZG dd� de�Ze�d�Zddd�dd�Zddd�dd�Zddd�d d!�Zddd"d#�d$d%�Z G d&d'� d'e�Z!dS )(z� .. testsetup:: from pip._vendor.packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier from pip._vendor.packaging.version import Version � )�annotationsN)�Callable�Iterable�Iterator�TypeVar�Union� )�canonicalize_version)�Version�UnparsedVersionVar)�bound�UnparsedVersionr )�version�returnc C s t | t�st| �} | S �N)� isinstancer )r � r �N/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/packaging/specifiers.py�_coerce_version s r c @ s e Zd ZdZdS )�InvalidSpecifiera Raised when attempting to create a :class:`Specifier` with a specifier string that is invalid. >>> Specifier("lolwat") Traceback (most recent call last): ... packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat' N)�__name__� __module__�__qualname__�__doc__r r r r r s r c @ s� e Zd Zejdd�dd��Zejdd�dd��Zejdd d �dd��Zeejd d�dd���Z e j d dd�dd��Z ejddd d d�dd��Zejddd dd�dd��ZdS )� BaseSpecifier�str�r c 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__�intc C s dS )zF Returns a hash value for this Specifier-like object. Nr r r r r �__hash__4 s zBaseSpecifier.__hash__�object�bool��otherr c C s dS )z� Returns a boolean representing whether or not the two Specifier-like objects are equal. :param other: The other object to check against. Nr �r r% r r r �__eq__: s zBaseSpecifier.__eq__�bool | Nonec C s dS )z�Whether or not pre-releases as a whole are allowed. This can be set to either ``True`` or ``False`` to explicitly enable or disable prereleases or it can be set to ``None`` (the default) to use default semantics. Nr r r r r �prereleasesC s zBaseSpecifier.prereleases�None��valuer c C s dS )zQSetter for :attr:`prereleases`. :param value: The value to set. Nr �r r, r r r r) L s N��itemr) r c C s dS )zR Determines if the given item is contained within this specifier. Nr )r r/ r) r r r �containsS s zBaseSpecifier.contains�Iterable[UnparsedVersionVar]�Iterator[UnparsedVersionVar]��iterabler) r c 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 r4 r) r r r �filterY s zBaseSpecifier.filter)N)N) r r r �abc�abstractmethodr r! r'