
    njG                     T   S r SSKrSSKrSSKJr  \R
                  " S\R                  5      r\R
                  " S5      r\R
                  " S5      r	S r
\R                  \R                  \R                  \R                  \R                  \R                   S	.r " S
 S5      rSqS rg)zAModule for parsing and testing package version predicate strings.    N   )versionz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$c                    [         R                  U 5      nU(       d  [        SU < 35      eUR                  5       u  p#[        R
                  " 5          [        R                  " U5      nSSS5        X$4$ ! , (       d  f       UW4$ = f)zNParse a single version comparison.

Return (comparison string, StrictVersion)
z bad package restriction syntax: N)re_splitComparisonmatch
ValueErrorgroupsr   suppress_known_deprecationStrictVersion)predrescompverStrothers        b/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/setuptools/_distutils/versionpredicate.pysplitUpr      ss    
 
"
"4
(C;D8DEE::<LD		+	+	-%%f- 
.= 
.	-%=s   A55
B)<z<=z==>z>=z!=c                   *    \ rS rSrSrS rS rS rSrg)VersionPredicate(   a   Parse and test package version predicates.

>>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

The `name` attribute provides the full dotted name that is given::

>>> v.name
'pyepat.abc'

The str() of a `VersionPredicate` provides a normalized
human-readable version of the expression::

>>> print(v)
pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

The `satisfied_by()` method can be used to determine with a given
version number is included in the set described by the version
restrictions::

>>> v.satisfied_by('1.1')
True
>>> v.satisfied_by('1.4')
True
>>> v.satisfied_by('1.0')
False
>>> v.satisfied_by('4444.4')
False
>>> v.satisfied_by('1555.1b3')
False

`VersionPredicate` is flexible in accepting extra whitespace::

>>> v = VersionPredicate(' pat( ==  0.1  )  ')
>>> v.name
'pat'
>>> v.satisfied_by('0.1')
True
>>> v.satisfied_by('0.2')
False

If any version numbers passed in do not conform to the
restrictions of `StrictVersion`, a `ValueError` is raised::

>>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
Traceback (most recent call last):
  ...
ValueError: invalid version number '1.2zb3'

It the module or package name given does not conform to what's
allowed as a legal module or package name, `ValueError` is
raised::

>>> v = VersionPredicate('foo-bar')
Traceback (most recent call last):
  ...
ValueError: expected parenthesized list: '-bar'

>>> v = VersionPredicate('foo bar (12.21)')
Traceback (most recent call last):
  ...
ValueError: expected parenthesized list: 'bar (12.21)'

c                 2   UR                  5       nU(       d  [        S5      e[        R                  U5      nU(       d  [        SU< 35      eUR	                  5       u  U l        nUR                  5       nU(       a  [        R                  U5      nU(       d  [        SU< 35      eUR	                  5       S   nUR                  S5       Vs/ s H  n[        U5      PM     snU l	        U R                  (       d  [        SU< 35      eg/ U l	        gs  snf )z!Parse a version predicate string.zempty package restrictionzbad package name in zexpected parenthesized list: r   ,zempty parenthesized list in N)
stripr   re_validPackager   r	   namere_parensplitr   r   )selfversionPredicateStrr   parenstraPreds         r   __init__VersionPredicate.__init__i   s     2779"899%%&9:34G3JKLL <<>	5NN5)E #@	!JKK,,.#C58YYs^D^E^DDI99 #?@S?V!WXX  DI	 Es   Dc                     U R                   (       a4  SR                  S U R                    5       5      nU R                   SU S3$ U R                  $ )Nz, c              3   4   #    U  H  u  pU S U 3v   M     g7f) N ).0condvers      r   	<genexpr>+VersionPredicate.__str__.<locals>.<genexpr>   s     GY	tfAcUOYs   z ())r   joinr   )r   seqs     r   __str__VersionPredicate.__str__   sB    99))GTYYGGCii[3%q))99    c                 Z    U R                    H  u  p#[        U   " X5      (       a  M    g   g)zTrue if version is compatible with all the predicates in self.
The parameter version must be acceptable to the StrictVersion
constructor.  It may be either a string or StrictVersion.
FT)r   compmap)r   r   r+   r,   s       r   satisfied_byVersionPredicate.satisfied_by   s+    
 ID4=.. # r4   )r   r   N)	__name__
__module____qualname____firstlineno____doc__r$   r2   r7   __static_attributes__r)   r4   r   r   r   (   s    >@2r4   r   c                    [         c%  [        R                  " S[        R                  5      q U R	                  5       n [         R                  U 5      nU(       d  [        SU < 35      eUR                  S5      =(       d    SnU(       a4  [        R                  " 5          [        R                  " U5      nSSS5        UR                  S5      U4$ ! , (       d  f       N!= f)a  Return the name and optional version number of a provision.

The version number, if given, will be returned as a `StrictVersion`
instance, otherwise it will be `None`.

>>> split_provision('mypkg')
('mypkg', None)
>>> split_provision(' mypkg( 1.2 ) ')
('mypkg', StrictVersion ('1.2'))
Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z illegal provides specification:    r   )_provision_rxrecompileASCIIr   r   r   groupr   r
   r   )valuemr,   s      r   split_provisionrH      s     

Lbhh
 KKMEE"A;E9EFF
''!*
C
//1'',C 2771:s? 21s   C
C)r=   operatorrB    r   rC   rD   r   r   r   r   ltleeqgtgener6   r   rA   rH   r)   r4   r   <module>rQ      s    G  	 **GR ::)*ZZ HI  

++
++	
++
++i iX r4   