
    *,hu              	          d dl Z d dlZd dlZd dlZd dlZd dlmZmZmZm	Z	m
Z
mZmZmZmZmZmZ ddlmZ ddlmZmZmZ eeef   Zeeeef   Z ede      Zeeegef   Z G d d	e      Z G d
 de j>                        Z  G d de       Z! G d de!      Z"dedeegef   dedeegef   fdZ# G d de!      Z$ ejJ                  d      Z&dede
e   fdZ'dedefdZ(de
e   de
e   dee
e   e
e   f   fdZ) G d de       Z*y)     N)CallableDictIterableIteratorListOptionalPatternSetTupleTypeVarUnion   )canonicalize_version)LegacyVersionVersionparseVersionTypeVar)boundc                       e Zd ZdZy)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__     b/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pip/_vendor/packaging/specifiers.pyr   r   !   s    r   r   c            	       n   e Zd Zej                  defd       Zej                  defd       Zej                  de	de
fd       Zej                  dee
   fd       Zej                  de
ddfd	       Zej                  dd
edee
   de
fd       Zej                  	 ddee   dee
   dee   fd       Zy)BaseSpecifierreturnc                      y)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr   selfs    r   __str__zBaseSpecifier.__str__(       r   c                      y)zF
        Returns a hash value for this Specifier like object.
        Nr   r"   s    r   __hash__zBaseSpecifier.__hash__/   r%   r   otherc                      y)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr   r#   r(   s     r   __eq__zBaseSpecifier.__eq__5   r%   r   c                      y)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr   r"   s    r   prereleaseszBaseSpecifier.prereleases<   r%   r   valueNc                      y)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr   r#   r.   s     r   r-   zBaseSpecifier.prereleasesC   r%   r   itemr-   c                      y)zR
        Determines if the given item is contained within this specifier.
        Nr   r#   r1   r-   s      r   containszBaseSpecifier.containsJ   r%   r   iterablec                      y)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#   r5   r-   s      r   filterzBaseSpecifier.filterP   r%   r   N)r   r   r   abcabstractmethodstrr$   intr'   objectboolr+   abstractpropertyr   r-   setterr4   r   r   r7   r   r   r   r   r   '   s-      	#  
 	F t   	Xd^    $   	S x~   
 	PT 0?G~	.	! r   r   )	metaclassc                      e Zd ZU i Zeeef   ed<   ee   ed<   ddedee	   ddfdZ
defdZdefd	Zedeeef   fd
       ZdefdZdede	fdZdedefdZdedefdZedefd       Zedefd       Zedee	   fd       Zej8                  de	ddfd       Zdede	fdZ	 ddedee	   de	fdZ	 ddee    dee	   dee    fdZ!y)_IndividualSpecifier
_operators_regexNspecr-   r    c                     | j                   j                  |      }|st        d| d      |j                  d      j	                         |j                  d      j	                         f| _        || _        y )NzInvalid specifier: ''operatorversion)rE   searchr   groupstrip_spec_prereleases)r#   rF   r-   matchs       r   __init__z_IndividualSpecifier.__init___   sm    ""4("%9$q#ABB KK
#))+KK	"((*'

 (r   c                     | j                   d| j                  nd}d| j                  j                   dt	        |       | dS )N, prereleases= <()>)rO   r-   	__class__r   r;   r#   pres     r   __repr__z_IndividualSpecifier.__repr__l   sU       , T--01 	 4>>**+1SYM#bAAr   c                 4     dj                   | j                   S )Nz{}{})formatrN   r"   s    r   r$   z_IndividualSpecifier.__str__u   s    v}}djj))r   c                 P    | j                   d   t        | j                   d         fS )Nr   r   )rN   r   r"   s    r   _canonical_specz$_IndividualSpecifier._canonical_specx   s#    zz!}24::a=AAAr   c                 ,    t        | j                        S r8   )hashr_   r"   s    r   r'   z_IndividualSpecifier.__hash__|   s    D(())r   r(   c                     t        |t              r	 | j                  t        |            }nt        || j                        st        S | j
                  |j
                  k(  S # t        $ r	 t        cY S w xY wr8   )
isinstancer;   rX   r   NotImplementedr_   r*   s     r   r+   z_IndividualSpecifier.__eq__   sg    eS!&s5z2 E4>>2!!##u'<'<<< $ &%%&s   A" "A43A4opc                 >    t        | d| j                  |          }|S )N	_compare_)getattrrD   )r#   re   operator_callables      r   _get_operatorz"_IndividualSpecifier._get_operator   s+    .5Idoob123/
 ! r   rJ   c                 H    t        |t        t        f      st        |      }|S r8   )rc   r   r   r   r#   rJ   s     r   _coerce_versionz$_IndividualSpecifier._coerce_version   s    'M7#;<GnGr   c                      | j                   d   S )Nr   rN   r"   s    r   rI   z_IndividualSpecifier.operator       zz!}r   c                      | j                   d   S )Nr   ro   r"   s    r   rJ   z_IndividualSpecifier.version   rp   r   c                     | j                   S r8   rO   r"   s    r   r-   z _IndividualSpecifier.prereleases   s       r   r.   c                     || _         y r8   rs   r0   s     r   r-   z _IndividualSpecifier.prereleases   
    !r   r1   c                 $    | j                  |      S r8   r4   r#   r1   s     r   __contains__z!_IndividualSpecifier.__contains__       }}T""r   c                     || j                   }| j                  |      }|j                  r|sy| j                  | j                        } ||| j
                        S NF)r-   rm   is_prereleaserj   rI   rJ   )r#   r1   r-   normalized_itemri   s        r   r4   z_IndividualSpecifier.contains   s_    
 **K ..t4
 (( /3.@.@.O $,,??r   r5   c              #     K   d}g }d||ndi}|D ]Y  }| j                  |      } | j                  |fi |s(|j                  r |s| j                  s|j	                  |       Td}| [ |s|r|D ]  }|  y y y w)NFr-   T)rm   r4   r}   r-   append)r#   r5   r-   yieldedfound_prereleaseskwrJ   parsed_versions           r   r7   z_IndividualSpecifier.filter   s      K,C[N   	"G!11':Nt}}^2r2 "//4#3#3%,,W5 #G!M	"( ,,  -ws   6A?AA?rT   Nr8   )"r   r   r   rD   r   r;   __annotations__r	   r   r>   rQ   r[   r$   propertyr   r_   r<   r'   r=   r+   CallableOperatorrj   UnparsedVersionParsedVersionrm   rI   rJ   r-   r@   ry   r4   r   r   r7   r   r   r   rC   rC   Z   s   !#JS#X#CL(S (HTN (d (B# B* * BsCx B B*# *	=F 	=t 	=! !(8 ! = 
 #      !Xd^ ! ! " "$ " "# # # DH@#@2:4.@	@0 QU! 0!?G~!	.	!!r   rC   c                   2    e Zd ZdZ ej
                  dez   dz   ej                  ej                  z        Zdddddd	d
Z	dde
dee   ddf fdZdedefdZdede
defdZdede
defdZdede
defdZdede
defdZdede
defdZdede
defdZ xZS )LegacySpecifiera  
        (?P<operator>(==|!=|<=|>=|<|>))
        \s*
        (?P<version>
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        ^\s*\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)==!=<=>=rU   >NrF   r-   r    c                 Z    t         |   ||       t        j                  dt               y )NzZCreating a LegacyVersion has been deprecated and will be removed in the next major release)superrQ   warningswarnDeprecationWarning)r#   rF   r-   rX   s      r   rQ   zLegacySpecifier.__init__   s&    {+0	
r   rJ   c                 N    t        |t              st        t        |            }|S r8   )rc   r   r;   rl   s     r   rm   zLegacySpecifier._coerce_version  s    '=1#CL1Gr   prospectivec                 *    || j                  |      k(  S r8   rm   r#   r   rF   s      r   _compare_equalzLegacySpecifier._compare_equal
      d224888r   c                 *    || j                  |      k7  S r8   r   r   s      r   _compare_not_equalz"LegacySpecifier._compare_not_equal  r   r   c                 *    || j                  |      k  S r8   r   r   s      r   _compare_less_than_equalz(LegacySpecifier._compare_less_than_equal  r   r   c                 *    || j                  |      k\  S r8   r   r   s      r   _compare_greater_than_equalz+LegacySpecifier._compare_greater_than_equal  s     d224888r   c                 *    || j                  |      k  S r8   r   r   s      r   _compare_less_thanz"LegacySpecifier._compare_less_than      T11$777r   c                 *    || j                  |      kD  S r8   r   r   s      r   _compare_greater_thanz%LegacySpecifier._compare_greater_than  r   r   r   )r   r   r   
_regex_strrecompileVERBOSE
IGNORECASErE   rD   r;   r   r>   rQ   r   r   rm   r   r   r   r   r   r   __classcell__)rX   s   @r   r   r      s!   
J RZZ*,w6

R]]8RSF "J
S 
HTN 
d 
 = 
9- 9s 9t 99m 93 94 99M 9 9QU 99(9039	9
8m 83 84 88 8c 8d 8r   r   fn	Specifierr    c           	      l     t        j                         dddt        dt        dt        f fd       }|S )Nr#   r   r   rF   r    c                 :    t        |t              sy | ||      S r|   )rc   r   )r#   r   rF   r   s      r   wrappedz)_require_version_compare.<locals>.wrapped"  s    +w/$T**r   )	functoolswrapsr   r;   r>   )r   r   s   ` r   _require_version_comparer     sC     __R+k + +S +T + +
 Nr   c            	          e Zd ZdZ ej
                  dez   dz   ej                  ej                  z        Zdddddd	d
ddZ	e
dededefd       Ze
dededefd       Ze
dededefd       Ze
dededefd       Ze
dededefd       Ze
dededefd       Ze
dededefd       ZdededefdZedefd       Zej2                  deddfd       Zy)r   a  
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        (?P<version>
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        r   r   
compatibler   r   r   r   r   r   	arbitrary)~=r   r   r   r   rU   r   ===r   rF   r    c           
          dj                  t        t        j                  t        t        |                  d d       }|dz  } | j                  d      ||      xr  | j                  d      ||      S )N..*r   r   )joinlist	itertools	takewhile_is_not_suffix_version_splitrj   )r#   r   rF   prefixs       r   _compare_compatiblezSpecifier._compare_compatible  s{     $$^^D5IJKCRP

 	$'t!!$'T: 
?Wt?Q?QRV?W@
 	
r   c                 8   |j                  d      rYt        |j                        }t        |d d       }t        t	        |            }|d t        |       }t        ||      \  }}||k(  S t        |      }|j                  st        |j                        }||k(  S )Nr   )endswithr   publicr   r;   len_pad_versionlocal)	r#   r   rF   
split_specsplit_prospectiveshortened_prospectivepadded_specpadded_prospectivespec_versions	            r   r   zSpecifier._compare_equal  s     ==!+"4"45K (Sb	2J
 !/s;/? @
 %66GJ$H! /;1/+K+ &44 #4=L
  %%%k&8&89,..r   c                 (    | j                  ||       S r8   )r   r   s      r   r   zSpecifier._compare_not_equal  s    &&{D999r   c                 D    t        |j                        t        |      k  S r8   r   r   r   s      r   r   z"Specifier._compare_less_than_equal  s     {))*gdm;;r   c                 D    t        |j                        t        |      k\  S r8   r   r   s      r   r   z%Specifier._compare_greater_than_equal  s     {))*gdm;;r   spec_strc                     t        |      }||k  sy|j                  s8|j                  r,t        |j                        t        |j                        k(  ryyNFT)r   r}   base_versionr#   r   r   rF   s       r   r   zSpecifier._compare_less_than  sT    
 x 
 T! !!k&?&?{//0GD<M<M4NN
 r   c                    t        |      }||kD  sy|j                  s8|j                  r,t        |j                        t        |j                        k(  ry|j                  ,t        |j                        t        |j                        k(  ryyr   )r   is_postreleaser   r   r   s       r   r   zSpecifier._compare_greater_than  s    
 x 
 T! ""{'A'A{//0GD<M<M4NN ({//0GD<M<M4NN
 r   c                 h    t        |      j                         t        |      j                         k(  S r8   )r;   lowerr   s      r   _compare_arbitraryzSpecifier._compare_arbitrary%  s&    ;%%'3t9??+<<<r   c                     | j                   | j                   S | j                  \  }}|dv r1|dk(  r|j                  d      r|d d }t        |      j                  ryy)N)r   r   r   r   r   r   r   r   TF)rO   rN   r   r   r}   )r#   rI   rJ   s      r   r-   zSpecifier.prereleases(  sl    
 ($$$
 !JJ'66 4G$4$4T$:!#2, W~++r   r.   Nc                     || _         y r8   rs   r0   s     r   r-   zSpecifier.prereleasesA  ru   r   )r   r   r   r   r   r   r   r   rE   rD   r   r   r;   r>   r   r   r   r   r   r   r   r   r   r   r-   r@   r   r   r   r   r   +  s   [Jz RZZ*,w6

R]]8RSF "	J 
} 
C 
D 
 
* %/- %/s %/t %/ %/N :m :3 :4 : : <M < <QU < < <(<03<	< < m s t  2  # RV  >=g =S =T = T  0 " "$ " "r   z^([0-9]+)((?:a|b|c|rc)[0-9]+)$rJ   c                     g }| j                  d      D ]J  }t        j                  |      }|r |j                  |j	                                :|j                  |       L |S )Nr   )split_prefix_regexrK   extendgroupsr   )rJ   resultr1   rP   s       r   r   r   I  sW    Fc"  $$T*MM%,,.)MM$  Mr   segmentc                 .     t         fddD               S )Nc              3   @   K   | ]  }j                  |        y wr8   )
startswith).0r   r   s     r   	<genexpr>z!_is_not_suffix.<locals>.<genexpr>U  s!      '-6"s   )devabrcpost)any)r   s   `r   r   r   T  s"     1P   r   leftrightc                    g g }}|j                  t        t        j                  d |                    |j                  t        t        j                  d |                   |j                  | t	        |d         d         |j                  |t	        |d         d         |j                  ddgt        dt	        |d         t	        |d         z
        z         |j                  ddgt        dt	        |d         t	        |d         z
        z         t        t        j                  |       t        t        j                  |       fS )Nc                 "    | j                         S r8   isdigitxs    r   <lambda>z_pad_version.<locals>.<lambda>^  s     r   c                 "    | j                         S r8   r  r  s    r   r  z_pad_version.<locals>.<lambda>_  s    !))+ r   r   r   0)r   r   r   r   r   insertmaxchain)r   r   
left_splitright_splits       r   r   r   Z  s"    "J d9../DdKLMtI//0EuMNO d3z!}-/01uSQ0234 a#QKN(;c*Q->P(P!QQRq3%#aZ]);c+a.>Q)Q"RRS*-.Y__k5R0STTr   c                   8   e Zd Z	 ddedee   ddfdZdefdZdefdZde	fdZ
d	ed ef   dd fd
Zd	edefdZde	fdZdee   fdZedee   fd       Zej*                  deddfd       ZdedefdZ	 ddedee   defdZ	 ddee   dee   dee   fdZy)SpecifierSetN
specifiersr-   r    c                 `   |j                  d      D cg c]#  }|j                         s|j                         % }}t               }|D ]  }	 |j                  t	        |              t        |      | _        || _	        y c c}w # t
        $ r |j                  t        |             Y bw xY w)N,)
r   rM   setaddr   r   r   	frozenset_specsrO   )r#   r  r-   ssplit_specifiersparsed	specifiers          r   rQ   zSpecifierSet.__init__m  s     0:/?/?/DR!	AGGIRR -0E) 	7I7

9Y/0	7  ' (! S $ 7

?9567s   BBB#B-,B-c                 ^    | j                   d| j                  nd}dt        |       | dS )NrS   rT   z<SpecifierSet(rW   )rO   r-   r;   rY   s     r   r[   zSpecifierSet.__repr__  sD       , T--01 	  D	}SE44r   c                 X    dj                  t        d | j                  D                    S )Nr  c              3   2   K   | ]  }t        |        y wr8   )r;   r   r  s     r   r   z'SpecifierSet.__str__.<locals>.<genexpr>  s     ;!s1v;s   )r   sortedr  r"   s    r   r$   zSpecifierSet.__str__  s     xx;t{{;;<<r   c                 ,    t        | j                        S r8   )ra   r  r"   s    r   r'   zSpecifierSet.__hash__      DKK  r   r(   c                    t        |t              rt        |      }nt        |t              st        S t               }t	        | j
                  |j
                  z        |_        | j                  |j                  |j                  |_        |S | j                  |j                  | j                  |_        |S | j                  |j                  k(  r| j                  |_        |S t        d      )NzFCannot combine SpecifierSets with True and False prerelease overrides.)rc   r;   r  rd   r  r  rO   
ValueError)r#   r(   r  s      r   __and__zSpecifierSet.__and__  s    eS! 'EE<0!! N	$T[[5<<%?@	$););)G%*%7%7I"  *u/A/A/I%)%6%6I"  %"4"44%)%6%6I"   r   c                     t        |t        t        f      rt        t        |            }nt        |t              st        S | j
                  |j
                  k(  S r8   )rc   r;   rC   r  rd   r  r*   s     r   r+   zSpecifierSet.__eq__  sC    ec#789 U,EE<0!!{{ell**r   c                 ,    t        | j                        S r8   )r   r  r"   s    r   __len__zSpecifierSet.__len__  s    4;;r   c                 ,    t        | j                        S r8   )iterr  r"   s    r   __iter__zSpecifierSet.__iter__  r"  r   c                     | j                   | j                   S | j                  sy t        d | j                  D              S )Nc              3   4   K   | ]  }|j                     y wr8   r-   r  s     r   r   z+SpecifierSet.prereleases.<locals>.<genexpr>  s     6Q1==6s   )rO   r  r   r"   s    r   r-   zSpecifierSet.prereleases  s?    
 ($$$
 {{ 6$++666r   r.   c                     || _         y r8   rs   r0   s     r   r-   zSpecifierSet.prereleases  ru   r   r1   c                 $    | j                  |      S r8   rw   rx   s     r   ry   zSpecifierSet.__contains__  rz   r   c                     t        t        t        f      st              | j                  sj
                  ryt        fd| j                  D              S )NFc              3   D   K   | ]  }|j                           yw)r.  Nrw   )r   r  r1   r-   s     r   r   z(SpecifierSet.contains.<locals>.<genexpr>  s     R1::d:<Rs    )rc   r   r   r   r-   r}   allr  r3   s    ``r   r4   zSpecifierSet.contains  sW    
 $ 89;D
 **K t11 RdkkRRRr   r5   c                    || j                   }| j                  r/| j                  D ]  }|j                  |t        |            }  |S g }g }|D ]k  }t	        |t
        t        f      st        |      }n|}t	        |t
              r8|j                  r|s|rI|j                  |       [|j                  |       m |s|r||S |S )Nr.  )
r-   r  r7   r>   rc   r   r   r   r}   r   )r#   r5   r-   rF   filteredr   r1   r   s           r   r7   zSpecifierSet.filter  s     **K
 ;; P;;xT+=N;OPO
 .0H68
 ! *!$(@A%*4[N%)N nm< "//#)006OOD)#**  1k6I((Or   r   r8   )r   r   r   r;   r   r>   rQ   r[   r$   r<   r'   r   r%  r=   r+   r(  r   rC   r+  r   r-   r@   r   ry   r4   r   r   r7   r   r   r   r  r  l  sP   BF((19$(	(05# 5= =!# !U>3#67 N .+F +t +   !(#78 ! 7Xd^ 7 7" " "$ " "# #T # DHS#S2:4.S	S< QU3 03?G~3	.	!3r   r  )+r9   r   r   r   r   typingr   r   r   r   r   r   r	   r
   r   r   r   utilsr   rJ   r   r   r   r   r;   r   r   r>   r   r$  r   ABCMetar   rC   r   r   r   r   r   r   r   r   r  r   r   r   <module>r9     s{  
    	     ( 2 2g},-34)A]C0$67 z 0ckk 0fF= FR98* 98x	+}c2D89	{M3/56	X"$ X"v 

<=C DI C D UtCy Uc UuT#YS	=Q7R U$v= vr   