
    ~(ph                         S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJ	r	  SSK
Jr  S/r\R                  " S5      rS	S
1rS rS rS r " S S\5      r\R                  " S5      rS r\" 5       rC\" 5       rSS jrg)zG
Parser for the environment markers micro-language defined in PEP 508.
    N   )string_types)in_venvparse_marker)LegacyVersion	interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")python_versionpython_full_versionc                 B    [        U [        5      =(       a	    U [        ;   $ N)
isinstancer   _VERSION_MARKERS)ss    B/var/www/html/venv/lib/python3.13/site-packages/distlib/markers.py_is_version_markerr      s    a&@10@+@@    c                 L    [        U [        5      (       a  U (       d  gU S   S;   $ )NFr   '")r   r   )os    r   _is_literalr   #   s"    a&&aQ45=r   c                     [         R                  U 5       Vs1 s H  n[        UR                  5       S   5      iM!     sn$ s  snf )Nr   )_VERSION_PATTERNfinditerLVgroups)r   ms     r   _get_versionsr   )   s6    '7'@'@'CD'C!Bqxxz!}'CDDDs   &Ac                   T    \ rS rSrSrS S S S S S S	 S
 S S S S S.rS rSrg)	Evaluator-   z4
This class is used to evaluate marker expressions.
c                 
    X:H  $ r    xys     r   <lambda>Evaluator.<lambda>3       16r   c                 
    X:H  $ r   r"   r#   s     r   r&   r'   4   s    AFr   c                      X:H  =(       d    X:  $ r   r"   r#   s     r   r&   r'   5       16?QU?r   c                 
    X:g  $ r   r"   r#   s     r   r&   r'   6   r(   r   c                 
    X:  $ r   r"   r#   s     r   r&   r'   7       !%r   c                      X:H  =(       d    X:  $ r   r"   r#   s     r   r&   r'   8   r+   r   c                 
    X:  $ r   r"   r#   s     r   r&   r'   9   r.   r   c                      X:H  =(       d    X:  $ r   r"   r#   s     r   r&   r'   :   r+   r   c                     U =(       a    U$ r   r"   r#   s     r   r&   r'   ;   s
    AG!Gr   c                     U =(       d    U$ r   r"   r#   s     r   r&   r'   <   s
    166r   c                 
    X;   $ r   r"   r#   s     r   r&   r'   =   r(   r   c                 
    X;  $ r   r"   r#   s     r   r&   r'   >   s    qzr   )=====~=!=<<=>>=andorinnot inc                    [        U[        5      (       a*  US   S;   a  USS nU$ X;  a  [        SU-  5      eX!   n U$ [        U[        5      (       d   eUS   nX@R                  ;  a  [        SU-  5      eUS   nUS	   n[        US   5      (       a*  [        US	   5      (       a  [        S
U< SU< SU< 35      eU R                  XR5      nU R                  Xb5      n[        U5      (       d  [        U5      (       a  US;   a  [        U5      n[        U5      nO,[        U5      (       a  US;   a  [        U5      n[        U5      nU R                  U   " Xx5      nU$ )zk
Evaluate a marker expression returned by the :func:`parse_requirement`
function in the specified context.
r   r   r   zunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison:  )r:   r;   r<   r=   r7   r6   r9   r8   )r@   rA   )r   r   SyntaxErrordict
operationsNotImplementedErrorr   evaluater   r   r   )	selfexprcontextresultrD   elhserhsrE   rF   s	            r   rL   Evaluator.evaluateA   sd   
 dL))Aw%a4 1 &%&<t&CDD , ) dD))))dB()*BR*GHH;D;D4;''KU,D,D!#'T#3 4 4 --.C--.C#D))-?-E-EMMgg#D))b4D.Dg#C(__R(2Fr   r"   N)__name__
__module____qualname____firstlineno____doc__rJ   rL   __static_attributes__r"   r   r   r   r   -   s9    
 ""*!**#!!)J!r   r   z\d+\.\d+c                  `   S n [        [        S5      (       a;  U " [        R                  R                  5      n[        R                  R                  nOSnSn[
        R                  " 5       n[        R                  U5      nUR                  S5      nUU[        R                  [
        R                  " 5       [
        R                  " 5       [
        R                  " 5       [
        R                  " 5       [
        R                  " 5       [        [!        5       5      UU[        R
                  S.nU$ )Nc                     U R                   < SU R                  < SU R                  < 3nU R                  nUS:w  a  XS   [	        U R
                  5      -   -  nU$ )N.finalr   )majorminormicroreleaselevelstrserial)infoversionkinds      r   format_full_version,default_context.<locals>.format_full_versionj   sK     $

DJJ

C  7?AwT[[!111Gr   implementation0 r   )implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionplatform_in_venvr
   r	   sys_platform)hasattrsysri   re   nameplatformr	   _DIGITSmatchgrouposmachinepython_implementationreleasesystemrb   r   )rg   rm   rl   ppvr   pvrP   s          r   default_contextr   h   s     s$%%!4&&"(!0055!$ 

!
!
#CcA	
B2"877$,,.*2*H*H*J$,,.#??,$,,.	N"F Mr   c                 &    [        U 5      u  p#U(       a  US   S:w  a  [        SU < SU< 35      e[        [        5      nU(       a  UR                  U5        [        R                  X%5      $ ! [         a  n[        SU < SU< 35      eSnAff = f)z
Interpret a marker and return a result depending on environment.

:param marker: The marker to interpret.
:type marker: str
:param execution_context: The context used for name lookup.
:type execution_context: mapping
z#Unable to interpret marker syntax: z: Nr   #z$unexpected trailing data in marker: )r   	ExceptionrH   rI   DEFAULT_CONTEXTupdate	evaluatorrL   )markerexecution_contextrN   resterO   s         r   r   r      s    '!&)
 Q3!4) * 	*?#G()d,,  '!1& ' 	''s   A. .
B8BBr   )rX   r}   rerw   ry   compatr   utilr   r   re   r   r   __all__compiler   r   r   r   r   objectr   rz   r   r   r   r   r"   r   r   <module>r      s    
 	 
    ' (-::CE $&;< AE5 5p **[
!"J "#K	-r   