kghiddlmZddlZddlZddlmZddlmZddZdd Z ej Gd d Z Gdde Z GddZddZdS)) annotationsN)Mapping) RequirementnamestrreturncRtjdd|S)Nz[-_.]+-)resublower)rs /builddir/build/BUILD/imunify360-venv-2.6.0/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/dependency_groups/_implementation.py_normalize_namer s" 6)S$ ' ' - - / //dependency_groups%Mapping[str, str | Mapping[str, str]]ci}i}|D]B\}}t|}||g||||<Cg}|D]F\}}t |dkr.||dd|dG|r%t dd||S)Nz (, )z"Duplicate dependency group names: )itemsr setdefaultappendlenjoin ValueError) roriginal_namesnormalized_groups group_namevaluenormed_group_nameerrors normed_namenamess r_normalize_group_namesr%s ,.N.446655 E+J77!!"3R88?? KKK/4+,, F,2244AA U u::>> MM[??DIIe,<,<??? @ @ @ SQdii>O>OQQRRR rceZdZUded<dS)DependencyGroupIncluder include_groupN)__name__ __module__ __qualname____annotations__rrr'r'#srr'c$eZdZdZd fd ZxZS) CyclicDependencyErrorz9 An error representing the detection of a cycle. requested_grouprgroupr(rNonec||_||_||_||kr|d}n |d|d|d|}td|d|dS)Nz includes itselfz -> rz0Cyclic dependency group include while resolving z: )r0r1r(super__init__)selfr0r1r(reason __class__s rr5zCyclicDependencyError.__init__-s. * E ! !///FF%NN5NNENN}NNF  + + +"( + +     r)r0rr1rr(rrr2)r)r*r+__doc__r5 __classcell__)r8s@rr/r/(sG           rr/c:eZdZdZddZdd Zdd Zdd ZddZdS)DependencyGroupResolvera\ 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]``. rrrr2ct|tstdt||_i|_i|_i|_dS)Nz(Dependency Groups table is not a mapping) isinstancer TypeErrorr%r_parsed_groups_include_graph_ancestors_resolve_cache)r6rs rr5z DependencyGroupResolver.__init__Hs_+W55 HFGG G!78I!J!J  EG%BDrr1r0tuple[Requirement | DependencyGroupInclude, ...]ct|tstdt|}||S)a 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 :raises ValueError: if the data does not appear to be valid dependency group data :raises TypeError: if the data is not a string :raises LookupError: if group name is absent :raises packaging.requirements.InvalidRequirement: if a specifier is not valid "Dependency group name is not a str)r>rr?r _parse_groupr6r1s rlookupzDependencyGroupResolver.lookupXsG%%% B@AA A&&  '''rtuple[Requirement, ...]ct|tstdt|}|||S)a Resolve a dependency group to a list of requirements. :param group: the name of the group to resolve :raises TypeError: if the inputs appear to be the wrong types :raises ValueError: if the data does not appear to be valid dependency group data :raises LookupError: if group name is absent :raises packaging.requirements.InvalidRequirement: if a specifier is not valid rE)r>rr?r_resolverGs rresolvezDependencyGroupResolver.resolvejsG%%% B@AA A&&}}UE***rc||jvr |j|S||jvrtd|d|j|}t|tst d|dg}|D]}t|t r#|t|:t|trt| dkrtd|tt|}|t!|td|t||j|<|j|S)NzDependency group 'z ' not foundz' is not a list)z include-groupzInvalid dependency group item: )r()r@r LookupErrorr>listr?rrrdicttuplekeysrnextitervaluesr')r6r1 raw_groupelementsitemr(s rrFz$DependencyGroupResolver._parse_group{s D' ' '&u- - . . .E5EEEFF F*51 )T** IGGGGHH H?A K KD$$$ K D 1 12222D$'' K%%);;;$%Mt%M%MNNN $T$++--%8%8 9 9  6] S S STTTT !I4!I!IJJJ%*8__E""5))rr0c||jvr |j|S||}g}|D]}t|tr||-t|t rt |j}||j |dvrt|||jg|j |d|R|j|<| | ||td|t||j|<|j|S)z This is a helper for cached resolution to strings. :param group: The 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: )rBrFr>rrr'rr(rAgetr/extendrKNotImplementedErrorrQ)r6r1r0parsedresolved_grouprXr(s rrKz DependencyGroupResolver._resolvesq D' ' '&u- -""5))  D$ ,, %%d++++D"899  /0B C C  D$A$E$EeR$P$PPP/'0B@266ubAA@@@-m<%%dmmM?&S&STTTT)H$HH&+>%:%:E""5))rN)rrrr2)r1rrrC)r1rrrI)r1rr0rrrI) r)r*r+r9r5rHrLrFrKr-rrr<r<<s  EEEE (((($++++"****B"*"*"*"*"*"*rr<groupstuple[str, ...]cXt|tfd|DS)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 :raises TypeError: if the inputs appear to be the wrong types :raises ValueError: if the data does not appear to be valid dependency group data :raises LookupError: if group name is absent :raises packaging.requirements.InvalidRequirement: if a specifier is not valid c3fK|]+}|D]}t|V,dS)N)rLr).0r1rresolvers r zresolve..sDMMEX5E5Ee5L5LMMQMMMMMMMr)r<rQ)rr_res @rrLrLs6''899H MMMMVMMM M MMr)rrrr)rrrr)rrr_rrr`) __future__r dataclassesr collections.abcr"pip._vendor.packaging.requirementsrrr% dataclassr'rr/r<rLr-rrrls/"""""" ######::::::0000*      J   (B*B*B*B*B*B*B*B*JNNNNNNr