Ë
    ©Õ°jØ+  ã                  ó  — d dl mZ d dlZd dlmZmZ ddlmZ ddlm	Z	m
Z
 g d¢Zdd„Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ d«      Z G d„ d«      Z	 	 	 	 	 	 dd„Z ej(                  d«      Zdd„Z	 	 	 	 	 	 dd„Zy)é    )ÚannotationsN)ÚMappingÚSequenceé   )Ú_ErrorCollector)ÚInvalidRequirementÚRequirement)ÚCyclicDependencyGroupÚDependencyGroupIncludeÚDependencyGroupResolverÚDuplicateGroupNamesÚInvalidDependencyGroupObjectÚresolve_dependency_groupsc                 ó   — t         S ©N)Ú__all__© ó    úQ/var/www/mission/venv/lib/python3.12/site-packages/packaging/dependency_groups.pyÚ__dir__r      s   € Ü€Nr   c                  ó   — e Zd ZdZy)r   zy
    The same dependency groups were defined twice, with different non-normalized names.

    .. versionadded:: 26.1
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r      s   „ òr   r   c                  ó,   ‡ — e Zd ZdZdˆ fd„Zdd„Zˆ xZS )r
   zQ
    The dependency group includes form a cycle.

    .. versionadded:: 26.1
    c                óŠ   •— || _         || _        || _        ||k(  r|› d�}n|› d|› d|› d|› �}t        ‰| �  d|› d|› �«       y )Nz includes itselfz -> ú, z0Cyclic dependency group include while resolving z: )Úrequested_groupÚgroupÚinclude_groupÚsuperÚ__init__)Úselfr    r!   r"   ÚreasonÚ	__class__s        €r   r$   zCyclicDependencyGroup.__init__+   sl   ø€ Ø.ˆÔØˆŒ
Ø*ˆÔà˜EÒ!Ø�wÐ.Ð/‰Fà%� d¨5¨'°°E°7¸$¸}¸oÐNˆFÜ‰ÑØ>ØÐ˜r & ð+õ	
r   c                ó`   — | j                   | j                  | j                  | j                  ffS r   )r'   r    r!   r"   ©r%   s    r   Ú
__reduce__z CyclicDependencyGroup.__reduce__:   s(   € Ø—‘ ×!5Ñ!5°t·z±zÀ4×CUÑCUÐ VÐWÐWr   )r    Ústrr!   r+   r"   r+   ÚreturnÚNone)r,   z8tuple[type[CyclicDependencyGroup], tuple[str, str, str]])r   r   r   r   r$   r*   Ú__classcell__)r'   s   @r   r
   r
   $   s   ø„ ñõ
÷Xr   r
   c                  ó   — e Zd ZdZy)r   z�
    A member of a dependency group was identified as a dict, but was not in a valid
    format.

    .. versionadded:: 26.1
    Nr   r   r   r   r   r   A   s   „ òr   r   c                  ó$   — e Zd ZdZdZdd„Zdd„Zy)r   zV
    A reference to another dependency group by name.

    .. versionadded:: 26.1
    ©r"   c                ó   — || _         y)zˆ
        Initialize a DependencyGroupInclude.

        :param include_group: The name of the group referred to by this include.
        Nr1   )r%   r"   s     r   r$   zDependencyGroupInclude.__init__X   s   € ð +ˆÕr   c                óN   — | j                   j                  › d| j                  ›d�S )Nú(ú))r'   r   r"   r)   s    r   Ú__repr__zDependencyGroupInclude.__repr__`   s'   € Ø—.‘.×)Ñ)Ð*¨!¨D×,>Ñ,>Ð+AÀÐCÐCr   N)r"   r+   r,   r-   )r,   r+   )r   r   r   r   Ú	__slots__r$   r6   r   r   r   r   r   O   s   „ ñð #€Ió+ôDr   r   c                  ó\   — e Zd ZdZ	 	 	 	 dd„Zd	d„Zd
d„Z	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 dd„Zy)r   ax  
    A resolver for Dependency Group data.

    This class handles caching, name normalization, cycle detection, and other
    parsing requirements. There are only two public methods for exploring the data:
    ``lookup()`` and ``resolve()``.

    :param dependency_groups: A mapping, as provided via pyproject
        ``[dependency-groups]``.

    .. versionadded:: 26.1
    c                ó†   — t        «       }t        ||«      | _        i | _        i | _        i | _        |j                  d«       y )Nz$[dependency-groups] data was invalid)r   Ú_normalize_group_namesÚdependency_groupsÚ_parsed_groupsÚ_include_graph_ancestorsÚ_resolve_cacheÚfinalize)r%   r;   Úerrorss      r   r$   z DependencyGroupResolver.__init__r   sJ   € ô !Ó"ˆä!7Ð8IÈ6Ó!RˆÔð
 ð 	Ôð EGˆÔ%àBDˆÔà�‰Ð>Õ?r   c                ó¢   — t        |«      }t        «       j                  d|›d�«      5 }| j                  ||«      cddd«       S # 1 sw Y   yxY w)zº
        Lookup a group name, returning the parsed dependency data for that group.
        This will not resolve includes.

        :param group: the name of the group to lookup
        ú[dependency-groups] data for ú was malformedN)Ú_normalize_namer   Úon_exitÚ_parse_group©r%   r!   r@   s      r   ÚlookupzDependencyGroupResolver.lookup…   sS   € ô   Ó&ˆäÓ×&Ñ&Ø+¨E¨9°NÐCó
ð 	4àØ×$Ñ$ U¨FÓ3÷	4÷ 	4ò 	4ús   ©AÁAc                ó¤   — t        |«      }t        «       j                  d|›d�«      5 }| j                  |||«      cddd«       S # 1 sw Y   yxY w)z
        Resolve a dependency group to a list of requirements.

        :param group: the name of the group to resolve
        rB   rC   N)rD   r   rE   Ú_resolverG   s      r   ÚresolvezDependencyGroupResolver.resolve“   sS   € ô   Ó&ˆäÓ×&Ñ&Ø+¨E¨9°NÐCó
ð 	7àØ—=‘= ¨¨vÓ6÷	7÷ 	7ò 	7ús   ©AÁAc                ó®  — || j                   v r| j                   |   S | j                  ||«      }g }|D ]ì  }t        |t        «      r|j	                  |«       Œ%t        |t
        «      r«t        |j                  «      }|| j                  j                  |d«      v r'|j                  t        |||j                  «      «       Œ�g | j                  j                  |d«      ¢|‘­| j                  |<   |j                  | j                  |||«      «       Œàt        d|› �«      ‚ |j                  ryt!        |«      | j                   |<   | j                   |   S )a”  
        This is a helper for cached resolution to strings. It preserves the name of the
        group which the user initially requested in order to present a clearer error in
        the event that a cycle is detected.

        :param group: The normalized name of the group to resolve.
        :param requested_group: The group which was used in the original, user-facing
            request.
        r   z+Invalid dependency group item after parse: )r>   rF   Ú
isinstancer	   Úappendr   rD   r"   r=   ÚgetÚerrorr
   ÚextendrJ   ÚNotImplementedErrorr@   Útuple)r%   r!   r    r@   ÚparsedÚresolved_groupÚitemr"   s           r   rJ   z DependencyGroupResolver._resolve    s^  € ð �D×'Ñ'Ñ'Ø×&Ñ& uÑ-Ð-à×"Ñ" 5¨&Ó1ˆàˆàò 	ˆDÜ˜$¤Ô,Ø×%Ñ% dÕ+Ü˜DÔ"8Ô9Ü /°×0BÑ0BÓ C�ð ! D×$AÑ$A×$EÑ$EÀeÈRÓ$PÑPØ—L‘LÜ-Ø+¨U°D×4FÑ4FóõðDØ×6Ñ6×:Ñ:¸5À"ÓEðDàñD�D×1Ñ1°-Ñ@ð #×)Ñ)ØŸ™ m°_ÀfÓMõô *ØAÀ$ÀÐHóð ð5	ðB �=Š=Øä%*¨>Ó%:ˆ×Ñ˜EÑ"Ø×"Ñ" 5Ñ)Ð)r   c                ó
  — || j                   v r| j                   |   S || j                  vr|j                  t        d|› d�«      «       y| j                  |   }t	        |t
        «      r|j                  t        d|›d�«      «       yt	        |t        «      s|j                  t        d|›d�«      «       yg }|D �]  }t	        |t
        «      r9|j                  t        «      5  |j                  t        |«      «       d d d «       ŒMt	        |t        «      r‹t        |j                  «       «      dk7  r|j                  t        d|›�«      «       Œ—|d	   }t	        |t
        «      s d
|›�}|j                  t        |«      «       ŒÌ|j                  t!        |¬«      «       Œè|j                  t        d|›�«      «       �Œ |j"                  ryt        |«      | j                   |<   | j                   |   S # 1 sw Y   �ŒFxY w)NzDependency group 'z' not foundr   zDependency group z' contained a string rather than a list.z is not a sequence type.)úinclude-groupzInvalid dependency group item: rX   z6Dependency group include-group value is not a string: r1   )r<   r;   rP   ÚLookupErrorrM   r+   Ú	TypeErrorr   Úcollectr   rN   r	   r   rS   Úkeysr   r   r@   )r%   r!   r@   Ú	raw_groupÚelementsrV   r"   Úmsgs           r   rF   z$DependencyGroupResolver._parse_groupÚ   sí  € ð �D×'Ñ'Ñ'Ø×&Ñ& uÑ-Ð-à˜×.Ñ.Ñ.Ø�L‰LœÐ'9¸%¸ÀÐ%LÓMÔNØà×*Ñ*¨5Ñ1ˆ	Ü�i¤Ô%Ø�L‰LÜØ'¨ yÐ0WÐXóôð
 ä˜)¤XÔ.Ø�L‰LÜÐ-¨e¨YÐ6NÐOÓPôð à?AˆØó 	TˆDÜ˜$¤Ô$ð —^‘^Ô$6Ó7ñ 7Ø—O‘O¤K°Ó$5Ô6÷7ð 7ä˜D¤'Ô*Ü˜Ÿ™›Ó%Ð);Ò;Ø—L‘LÜ4Ø=¸d¸XÐFóõð %)¨Ñ$9�MÜ% m´SÔ9àTØ#˜hð(ð ð Ÿ™¤Y¨s£^Õ4à Ÿ™Ü2ÀÔOõð —‘œYÐ)HÈÈÐ'QÓRÖSð7	Tð: �=Š=Øä%*¨8£_ˆ×Ñ˜EÑ"Ø×"Ñ" 5Ñ)Ð)÷97ñ 7ús   Ã%G8Ç8H	N)r;   ú/Mapping[str, Sequence[str | Mapping[str, str]]]r,   r-   )r!   r+   r,   ú0tuple[Requirement | DependencyGroupInclude, ...])r!   r+   r,   útuple[Requirement, ...])r!   r+   r    r+   r@   r   r,   rb   )r!   r+   r@   r   r,   ra   )	r   r   r   r   r$   rH   rK   rJ   rF   r   r   r   r   r   d   sn   „ ñð@àJð@ð 
ó@ó&4ó7ð8*Øð8*Ø+.ð8*Ø8Gð8*à	 ó8*ðt<*Øð<*Ø"1ð<*à	9ô<*r   r   c               óB   ‡— t        | «      Št        ˆfd„|D «       «      S )a  
    Resolve a dependency group to a tuple of requirements, as strings.

    :param dependency_groups: the parsed contents of the ``[dependency-groups]`` table
        from ``pyproject.toml``
    :param groups: the name of the group(s) to resolve

    .. versionadded:: 26.1
    c              3  ó`   •K  — | ]%  }‰j                  |«      D ]  }t        |«      –— Œ Œ' y ­wr   )rK   r+   )Ú.0r!   ÚrÚresolvers      €r   ú	<genexpr>z,resolve_dependency_groups.<locals>.<genexpr>+  s,   øè ø€ ÒM˜E°X×5EÑ5EÀeÓ5LÒM°”�Q—ÐM�ÑMùs   ƒ+.)r   rS   )r;   Úgroupsrg   s     @r   r   r     s!   ø€ ô 'Ð'8Ó9€HÜÓM VÔMÓMÐMr   z[-_.]+c                óJ   — t         j                  d| «      j                  «       S )Nú-)Ú_NORMALIZE_PATTERNÚsubÚlower)Únames    r   rD   rD   6  s   € Ü×!Ñ! # tÓ,×2Ñ2Ó4Ð4r   c                óN  — i }i }| j                  «       D ]6  \  }}t        |«      }|j                  |g «      j                  |«       |||<   Œ8 |j                  «       D ]D  \  }}t	        |«      dkD  sŒ|j                  t        d|› ddj                  |«      › d�«      «       ŒF |S )Nr   z"Duplicate dependency group names: z (r   r5   )ÚitemsrD   Ú
setdefaultrN   ÚlenrP   r   Újoin)	r;   r@   Úoriginal_namesÚnormalized_groupsÚ
group_nameÚvalueÚnormed_group_nameÚnormed_nameÚnamess	            r   r:   r:   :  sÄ   € ð ,.€NØFHÐà.×4Ñ4Ó6ò 5Ñˆ
�EÜ+¨JÓ7ÐØ×!Ñ!Ð"3°RÓ8×?Ñ?À
ÔKØ/4ÐÐ+Ò,ð5ð
 -×2Ñ2Ó4ò Ñˆ�UÜˆu‹:˜‹>Ø�L‰LÜ#Ø8Ø"�m 2 d§i¡i°Ó&6Ð%7°qð:óõðð Ðr   )r,   z	list[str])r;   r`   ri   r+   r,   ztuple[str, ...])ro   r+   r,   r+   )r;   r`   r@   r   r,   z,dict[str, Sequence[str | Mapping[str, str]]])Ú
__future__r   ÚreÚcollections.abcr   r   r@   r   Úrequirementsr   r	   r   r   Ú
ValueErrorr   r
   r   r   r   r   Úcompilerl   rD   r:   r   r   r   ú<module>r‚      s·   ðÝ "ã 	ß -å #ß 9ò€óô˜*ô ôX˜Jô Xô: :ô ÷Dñ D÷*r*ñ r*ðtNØFðNØTWðNàóNð*  �R—Z‘Z 	Ó*Ð ó5ðØFðàðð 2ôr   