
    KxhO                         d dl mZ d dlmZmZ d dlmZ ddlmZm	Z	m
Z
mZ  G d de
          Z G d d	e
          Z G d
 de
          Z G d de
          ZdS )    )SpecifierSet)NormalizedNamecanonicalize_name)InstallRequirement   )	CandidateCandidateLookupRequirementformat_namec                       e Zd ZdeddfdZdefdZdefdZede	fd            Z
edefd            Zdefd	Zdefd
ZdedefdZdS )ExplicitRequirement	candidatereturnNc                     || _         d S Nr   selfr   s     c/var/www/html/what/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/requirements.py__init__zExplicitRequirement.__init__
   s    "    c                 *    t          | j                  S r   )strr   r   s    r   __str__zExplicitRequirement.__str__   s    4>"""r   c                 N    d                     | j        j        | j                  S )Nz{class_name}({candidate!r}))
class_namer   )format	__class____name__r   r   s    r   __repr__zExplicitRequirement.__repr__   s,    ,33~.n 4 
 
 	
r   c                     | j         j        S r   )r   project_namer   s    r   r#   z ExplicitRequirement.project_name   s     ~**r   c                     | j         j        S r   )r   namer   s    r   r%   zExplicitRequirement.name   s     ~""r   c                 4    | j                                         S r   )r   format_for_errorr   s    r   r'   z$ExplicitRequirement.format_for_error    s    ~..000r   c                     | j         d fS r   r   r   s    r   get_candidate_lookupz(ExplicitRequirement.get_candidate_lookup#   s    ~t##r   c                     || j         k    S r   r   r   s     r   is_satisfied_byz#ExplicitRequirement.is_satisfied_by&   s    DN**r   )r    
__module____qualname__r   r   r   r   r!   propertyr   r#   r%   r'   r	   r)   boolr+    r   r   r   r   	   s       #) # # # # ## # # # #
# 
 
 
 
 +n + + + X+ #c # # # X#1# 1 1 1 1$o $ $ $ $+ +t + + + + + +r   r   c                       e Zd ZdeddfdZdefdZdefdZede	fd            Z
edefd            Zdefd	Zdefd
ZdedefdZdS )SpecifierRequirementireqr   Nc                 h    |j         
J d            || _        t          |j                  | _        d S )NzThis is a link, not a specifier)link_ireq	frozensetextras_extras)r   r3   s     r   r   zSpecifierRequirement.__init__+   s5    y  "C   
 --r   c                 4    t          | j        j                  S r   )r   r6   reqr   s    r   r   zSpecifierRequirement.__str__0   s    4:>"""r   c                 r    d                     | j        j        t          | j        j                            S )Nz{class_name}({requirement!r}))r   requirement)r   r   r    r   r6   r;   r   s    r   r!   zSpecifierRequirement.__repr__3   s6    .55~.DJN++ 6 
 
 	
r   c                 j    | j         j        s
J d            t          | j         j        j                  S )N'Specifier-backed ireq is always PEP 508)r6   r;   r   r%   r   s    r   r#   z!SpecifierRequirement.project_name9   s0    z~HHHHHH !4555r   c                 6    t          | j        | j                  S r   )r   r#   r9   r   s    r   r%   zSpecifierRequirement.name>   s    4,dl;;;r   c                    d t          |                               d          D             }t          |          dk    rdS t          |          dk    r|d         S d                    |d d                   dz   |d         z   S )	Nc                 6    g | ]}|                                 S r0   )strip).0ss     r   
<listcomp>z9SpecifierRequirement.format_for_error.<locals>.<listcomp>H   s     999q999r   ,r    r   z, z and )r   splitlenjoin)r   partss     r   r'   z%SpecifierRequirement.format_for_errorB   s}     :9CIIOOC$8$8999u::??2ZZ1__8Oyyss$$w.r::r   c                     d | j         fS r   )r6   r   s    r   r)   z)SpecifierRequirement.get_candidate_lookupP   s    TZr   r   c                     |j         | j         k    sJ d|j          d| j                      | j        j        s
J d            | j        j        j        }|                    |j        d          S )Nz6Internal issue: Candidate is not for this requirement z vs r?   Tprereleases)r%   r6   r;   	specifiercontainsversion)r   r   specs      r   r+   z$SpecifierRequirement.is_satisfied_byS   s    ~***/~/ /#'9/ / +** z~HHHHHHz~'}}Y.D}AAAr   )r    r,   r-   r   r   r   r   r!   r.   r   r#   r%   r'   r	   r)   r   r/   r+   r0   r   r   r2   r2   *   s       ./ .D . . . .
# # # # #
# 
 
 
 
 6n 6 6 6 X6 <c < < < X<;# ; ; ; ; o        
B 
Bt 
B 
B 
B 
B 
B 
Br   r2   c                       e Zd ZdZdededdfdZdefdZdefdZ	e
defd	            Ze
defd
            ZdefdZdefdZdedefdZdS )RequiresPythonRequirementz4A requirement representing Requires-Python metadata.rR   matchr   Nc                 "    || _         || _        d S r   )rR   
_candidate)r   rR   rX   s      r   r   z"RequiresPythonRequirement.__init__c   s    "r   c                     d| j          S )NzPython )rR   r   s    r   r   z!RequiresPythonRequirement.__str__g   s    ))))r   c                 h    d                     | j        j        t          | j                            S )Nz{class_name}({specifier!r}))r   rR   )r   r   r    r   rR   r   s    r   r!   z"RequiresPythonRequirement.__repr__j   s4    ,33~.$.)) 4 
 
 	
r   c                     | j         j        S r   )rZ   r#   r   s    r   r#   z&RequiresPythonRequirement.project_namep   s    ++r   c                     | j         j        S r   )rZ   r%   r   s    r   r%   zRequiresPythonRequirement.namet   s    ##r   c                      t          |           S r   r   r   s    r   r'   z*RequiresPythonRequirement.format_for_errorx       4yyr   c                 d    | j                             | j        j        d          r	| j        d fS dS )NTrP   NN)rR   rS   rZ   rT   r   s    r   r)   z.RequiresPythonRequirement.get_candidate_lookup{   s6    >""4?#:"MM 	)?D((zr   r   c                     |j         | j        j         k    s
J d            | j                            |j        d          S )NzNot Python candidateTrP   )r%   rZ   rR   rS   rT   r   s     r   r+   z)RequiresPythonRequirement.is_satisfied_by   sC    ~!55557M555 ~&&y'8d&KKKr   )r    r,   r-   __doc__r   r   r   r   r   r!   r.   r   r#   r%   r'   r	   r)   r/   r+   r0   r   r   rW   rW   `   s'       >> ,  y  T        * * * * *
# 
 
 
 
 ,n , , , X, $c $ $ $ X$#    o    
L Lt L L L L L Lr   rW   c                       e Zd ZdZdeddfdZdefdZdefdZe	defd            Z
e	defd	            Zdefd
ZdefdZdedefdZdS )UnsatisfiableRequirementz'A requirement that cannot be satisfied.r%   r   Nc                     || _         d S r   _name)r   r%   s     r   r   z!UnsatisfiableRequirement.__init__   s    


r   c                     | j          dS )Nz (unavailable)ri   r   s    r   r   z UnsatisfiableRequirement.__str__   s    *,,,,r   c                 h    d                     | j        j        t          | j                            S )Nz{class_name}({name!r}))r   r%   )r   r   r    r   rj   r   s    r   r!   z!UnsatisfiableRequirement.__repr__   s2    '..~.TZ / 
 
 	
r   c                     | j         S r   ri   r   s    r   r#   z%UnsatisfiableRequirement.project_name   
    zr   c                     | j         S r   ri   r   s    r   r%   zUnsatisfiableRequirement.name   rn   r   c                      t          |           S r   r`   r   s    r   r'   z)UnsatisfiableRequirement.format_for_error   ra   r   c                     dS )Nrc   r0   r   s    r   r)   z-UnsatisfiableRequirement.get_candidate_lookup   s    zr   r   c                     dS )NFr0   r   s     r   r+   z(UnsatisfiableRequirement.is_satisfied_by   s    ur   )r    r,   r-   re   r   r   r   r   r!   r.   r#   r%   r'   r	   r)   r   r/   r+   r0   r   r   rg   rg      s       11^     - - - - -
# 
 
 
 
 n    X c    X#    o     t      r   rg   N) pip._vendor.packaging.specifiersr   pip._vendor.packaging.utilsr   r   pip._internal.req.req_installr   baser   r	   r
   r   r   r2   rW   rg   r0   r   r   <module>rw      s*   9 9 9 9 9 9 I I I I I I I I < < < < < < F F F F F F F F F F F F+ + + + ++ + + +B3B 3B 3B 3B 3B; 3B 3B 3Bl%L %L %L %L %L %L %L %LP    {     r   