U .el @ s d dl mZmZmZ d dlZd dlZd dlZd dlZddlm Z m Z ddlmZm Z mZ G dd deZG dd d e ejeZG d d deZG dd d eZdd ZG dd deZedZdd Zdd ZG dd deZdS ) )absolute_importdivisionprint_functionN )string_typeswith_metaclass)Version LegacyVersionparsec @ s e Zd ZdZdS )InvalidSpecifierzH An invalid specifier was found, users should refer to PEP 440. N)__name__ __module____qualname____doc__ r r D/usr/lib/python3.8/site-packages/pip/_vendor/packaging/specifiers.pyr s r c @ s e Zd Zejdd Zejdd Zejdd Zejdd Zej d d Z e jdd Z ejdd dZejdddZ 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__* 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 prereleases1 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 8 s Nc C s dS )zR Determines if the given item is contained within this specifier. Nr r itemr r r r contains? 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 filterE s zBaseSpecifier.filter)N)N)r r r abcabstractmethodr r r r abstractpropertyr setterr r" r r r r r s r c @ s e Zd Zi Zd ddZdd Zdd Zd d Zdd Zd d Z dd Z dd Zedd Z edd Zedd Zejdd Zdd Zd!ddZd"ddZdS )#_IndividualSpecifier Nc C sF | j |}|std||d |d f| _|| _d S )NzInvalid specifier: '{0}'operatorversion)_regexsearchr formatgroupstrip_spec_prereleases)r specr matchr r r __init__Q s z_IndividualSpecifier.__init__c C s0 | j d k rd| jnd}d| jjt| |S )N, prereleases={0!r}r( z<{0}({1!r}{2})>)r1 r- r __class__r strr Zprer r r __repr__[ s z_IndividualSpecifier.__repr__c C s dj | j S )Nz{0}{1})r- r0 r r r r r d s z_IndividualSpecifier.__str__c C s t | jS N)hashr0 r r r r r g s z_IndividualSpecifier.__hash__c C sP t |tr4z| |}W qD tk r0 t Y S X nt || jsDtS | j|jkS r: isinstancer r6 r NotImplementedr0 r r r r r j s z_IndividualSpecifier.__eq__c C sP t |tr4z| |}W qD tk r0 t Y S X nt || jsDtS | j|jkS r: r<