Ë
    ×Bæj™2  ã                  ó®  — U d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlZddlm	Z	 ddl
mZ ddl
mZ dd	l
mZ dd
l
mZ ddl
mZ ddlZddlmZ ddlmZ  ededef   ¬«      Ze	ez  Zded<   e G d„ d«      «       Ze G d„ d«      «       Zej6                  j8                  dk(  ZerdndZ eddh«      Z ded<   dd œ	 	 	 	 	 d$d!„Z!e G d"„ d#«      «       Z"y)%z4
Hook markers, specifications, and related helpers.
é    )Úannotations)ÚCallable)ÚMappingN)Ú
ModuleType)ÚFinal)Úfinal)Úoverload)Ú	TypeAlias)ÚTypeVaré   )ÚHookimplOpts)ÚHookspecOptsÚ_F.)Úboundr
   Ú
_Namespacec                  ó¬   — e Zd ZdZdZdd„Ze	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 d
d„«       Ze	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„«       Z	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„Zy)ÚHookspecMarkera  Decorator for marking functions as hook specifications.

    Instantiate it with a project_name to get a decorator.
    Calling :meth:`PluginManager.add_hookspecs` later will discover all marked
    functions if the :class:`PluginManager` uses the same project name.
    ©Úproject_namec                ó   — || _         y ©Nr   ©Úselfr   s     úU/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/pluggy/_decorators.pyÚ__init__zHookspecMarker.__init__(   ó
   € Ø#/ˆÕó    Nc                 ó   — y r   © ©r   ÚfunctionÚfirstresultÚhistoricÚwarn_on_implÚwarn_on_impl_argss         r   Ú__call__zHookspecMarker.__call__+   s   € ð r   c                 ó   — y r   r   r    s         r   r&   zHookspecMarker.__call__5   s   € ð !r   c                ó8   ‡ ‡‡‡‡— dˆˆˆ ˆˆfd„}|� ||«      S |S )aw  If passed a function, directly sets attributes on the function
        which will make it discoverable to :meth:`PluginManager.add_hookspecs`.

        If passed no function, returns a decorator which can be applied to a
        function later using the attributes supplied.

        :param firstresult:
            If ``True``, the 1:N hook call (N being the number of registered
            hook implementation functions) will stop at I<=N when the I'th
            function returns a non-``None`` result. See :ref:`firstresult`.

        :param historic:
            If ``True``, every call to the hook will be memorized and replayed
            on plugins registered after the call was made. See :ref:`historic`.

        :param warn_on_impl:
            If given, every implementation of this hook will trigger the given
            warning. See :ref:`warn_on_impl`.

        :param warn_on_impl_args:
            If given, every implementation of this hook which requests one of
            the arguments in the dict will trigger the corresponding warning.
            See :ref:`warn_on_impl`.

            .. versionadded:: 1.5
        c                óh   •— ‰r‰rt        d«      ‚‰‰‰‰dœ}t        | ‰j                  dz   |«       | S )Nz'cannot have a historic firstresult hook)r"   r#   r$   r%   Ú_spec)Ú
ValueErrorÚsetattrr   )ÚfuncÚoptsr"   r#   r   r$   r%   s     €€€€€r   Úsetattr_hookspec_optsz6HookspecMarker.__call__.<locals>.setattr_hookspec_optsb   sE   ø€ Ù™KÜ Ð!JÓKÐKà*Ø$Ø ,Ø%6ñ	"ˆDô �D˜$×+Ñ+¨gÑ5°tÔ<ØˆKr   ©r-   r   Úreturnr   r   )r   r!   r"   r#   r$   r%   r/   s   ` ```` r   r&   zHookspecMarker.__call__?   s'   ü€ ÷F
	ñ 
	ð ÐÙ(¨Ó2Ð2à(Ð(r   ©r   Ústrr1   ÚNone)FFNN)r!   r   r"   Úboolr#   r5   r$   úWarning | Noner%   úMapping[str, Warning] | Noner1   r   ).....)r!   r4   r"   r5   r#   r5   r$   r6   r%   r7   r1   úCallable[[_F], _F])NFFNN)r!   ú	_F | Noner"   r5   r#   r5   r$   r6   r%   r7   r1   ú_F | Callable[[_F], _F]©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r	   r&   r   r   r   r   r      s  „ ñð "€Ió0ð ð "ØØ'+Ø:>ðàðð ðð ð	ð
 %ðð 8ðð 
òó ðð ð ØØØ'*Ø:=ð!àð!ð ð!ð ð	!ð
 %ð!ð 8ð!ð 
ò!ó ð!ð #Ø!ØØ'+Ø:>ð2)àð2)ð ð2)ð ð	2)ð
 %ð2)ð 8ð2)ð 
!ô2)r   r   c                  óÐ   — e Zd ZdZdZdd„Ze	 	 	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
d„«       Ze	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)ÚHookimplMarkera  Decorator for marking functions as hook implementations.

    Instantiate it with a ``project_name`` to get a decorator.
    Calling :meth:`PluginManager.register` later will discover all marked
    functions if the :class:`PluginManager` uses the same project name.
    r   c                ó   — || _         y r   r   r   s     r   r   zHookimplMarker.__init__   r   r   c                 ó   — y r   r   ©r   r!   ÚhookwrapperÚoptionalhookÚtryfirstÚtrylastÚspecnameÚwrappers           r   r&   zHookimplMarker.__call__‚   s   € ð r   c                 ó   — y r   r   rE   s           r   r&   zHookimplMarker.__call__Ž   s   € ð !r   Nc                ó@   ‡ ‡‡‡‡‡‡— dˆˆˆ ˆˆˆˆfd„}|€|S  ||«      S )a
  If passed a function, directly sets attributes on the function
        which will make it discoverable to :meth:`PluginManager.register`.

        If passed no function, returns a decorator which can be applied to a
        function later using the attributes supplied.

        :param optionalhook:
            If ``True``, a missing matching hook specification will not result
            in an error (by default it is an error if no matching spec is
            found). See :ref:`optionalhook`.

        :param tryfirst:
            If ``True``, this hook implementation will run as early as possible
            in the chain of N hook implementations for a specification. See
            :ref:`callorder`.

        :param trylast:
            If ``True``, this hook implementation will run as late as possible
            in the chain of N hook implementations for a specification. See
            :ref:`callorder`.

        :param wrapper:
            If ``True`` ("new-style hook wrapper"), the hook implementation
            needs to execute exactly one ``yield``. The code before the
            ``yield`` is run early before any non-hook-wrapper function is run.
            The code after the ``yield`` is run after all non-hook-wrapper
            functions have run. The ``yield`` receives the result value of the
            inner calls, or raises the exception of inner calls (including
            earlier hook wrapper calls). The return value of the function
            becomes the return value of the hook, and a raised exception becomes
            the exception of the hook. See :ref:`hookwrapper`.

        :param hookwrapper:
            If ``True`` ("old-style hook wrapper"), the hook implementation
            needs to execute exactly one ``yield``. The code before the
            ``yield`` is run early before any non-hook-wrapper function is run.
            The code after the ``yield`` is run after all non-hook-wrapper
            function have run  The ``yield`` receives a :class:`Result` object
            representing the exception or result outcome of the inner calls
            (including earlier hook wrapper calls). This option is mutually
            exclusive with ``wrapper``. See :ref:`old_style_hookwrapper`.

        :param specname:
            If provided, the given name will be used instead of the function
            name when matching this hook implementation to a hook specification
            during registration. See :ref:`specname`.

        .. versionadded:: 1.2.0
            The ``wrapper`` parameter.
        c                óN   •— ‰‰‰‰‰‰dœ}t        | ‰j                  dz   |«       | S )N)rK   rF   rG   rH   rI   rJ   Ú_impl)r,   r   )	r-   r.   rF   rG   r   rJ   rH   rI   rK   s	     €€€€€€€r   Úsetattr_hookimpl_optsz6HookimplMarker.__call__.<locals>.setattr_hookimpl_opts×   s:   ø€ à"Ø*Ø ,Ø$Ø"Ø$ñ"ˆDô �D˜$×+Ñ+¨gÑ5°tÔ<ØˆKr   r0   r   )	r   r!   rF   rG   rH   rI   rJ   rK   rP   s	   ` `````` r   r&   zHookimplMarker.__call__š   s'   þ€ ÷z
	ó 
	ð ÐØ(Ð(á(¨Ó2Ð2r   r2   )......)r!   r   rF   r5   rG   r5   rH   r5   rI   r5   rJ   ú
str | NonerK   r5   r1   r   ).......)r!   r4   rF   r5   rG   r5   rH   r5   rI   r5   rJ   rQ   rK   r5   r1   r8   )NFFFFNF)r!   r9   rF   r5   rG   r5   rH   r5   rI   r5   rJ   rQ   rK   r5   r1   r:   r;   r   r   r   rB   rB   t   su  „ ñð "€Ió0ð ð  Ø ØØØ"Øð	àð	ð ð	ð ð		ð
 ð	ð ð	ð ð	ð ð	ð 
ò	ó ð	ð ð ØØ ØØØ"Øð	!àð	!ð ð	!ð ð		!ð
 ð	!ð ð	!ð ð	!ð ð	!ð 
ò	!ó ð	!ð #Ø!Ø"ØØØ#ØðL3àðL3ð ðL3ð ð	L3ð
 ðL3ð ðL3ð ðL3ð ðL3ð 
!ôL3r   rB   Úpypy)r   ÚclsÚobj)r   rS   z%TimeoutHooks.pytest_timeout_set_timerz(TimeoutHooks.pytest_timeout_cancel_timerzfrozenset[str]Ú_NOSELF_WARN_SUPPRESSF©Úlegacy_noselfc               ó  — d}t        j                  | «      r	 | j                  } d}n#t        j                  | «      s	 t        | d| «      } t        j                  | «      rd}t        j                  | «      } t        j                  | «      rd}| j                  } 	 | j                  }| j                  }| j                  }|j                  d|j                   }|rt        |«       }|d| ||d }}nd}|j!                  dd¬	«      d
   }	d|	v }
|rI|s|
r|d   t"        v r	|dd }||fS |
r/|r-|	t$        vr%t'        j(                  |› d|d   ›d�t*        d¬«       ||fS # t        $ r Y yw xY w# t        $ r Y yw xY w# t        $ r Y yw xY w)a�  Return tuple of positional and keyword parameter names for a callable.

    In case of a class, its ``__init__`` method is considered.
    For bound methods, the already-bound first parameter is not included.
    For unbound methods with a dotted ``__qualname__``, the first parameter is
    stripped only if its name is a known implicit name (``self``, ``cls``).
    Keyword-only parameters are not included.

    :param legacy_noself:
        If ``True``, support hookspec classes whose methods omit ``self``.
        When the function looks like a class method but has no implicit first
        parameter, a :class:`DeprecationWarning` is emitted.
    F)r   r   Tr&   Nr   z	<locals>.r   )Úmaxsplitéÿÿÿÿú.r   z% is a method but its first parameter z€ is not 'self'. Add 'self' as the first parameter or use @staticmethod. This will become an error in a future version of pluggy.é   )Ú
stacklevel)ÚinspectÚisclassr   ÚAttributeErrorÚ	isroutineÚgetattrÚ	ExceptionÚismethodÚunwrapÚ__func__Ú__code__Ú__defaults__r>   Úco_varnamesÚco_argcountÚlenÚrsplitÚ_IMPLICIT_NAMESrU   ÚwarningsÚwarnÚDeprecationWarning)r-   rW   Úis_boundÚcodeÚdefaultsÚqualnameÚargsÚindexÚkwargsÚ_tailÚ_is_class_methods              r   Úvarnamesrz   ø   sÌ  € ð  €HÜ‡��tÔð	Ø—=‘=ˆDð ‰Ü×Ñ˜tÔ$ð	ô ˜4 ¨TÓ2ˆDô
 ×Ñ˜ÔØˆÜ�>‰>˜$Ó€DÜ×Ñ˜ÔØˆØ�}‰}ˆðØ#Ÿ}™}ˆØ.2×.?Ñ.?ˆØ×)Ñ)ˆð
 !×,Ñ,Ð-?¨t×/?Ñ/?Ð@€Dñ Ü�X“�ˆØ˜F˜U�| T¨%¨& \ˆf‰àˆð �O‰O˜K°!ˆOÓ4°RÑ8€EØ˜e�|ÐÙÙÑ(¨T°!©W¼Ñ-GØ˜˜�8ˆDð �ˆ<Ðñ ¡-°EÔAVÑ4VÜ�M‰MØ�*ð Ø˜‘G�;ð LðMô #Øõð �ˆ<Ðøôs ò 	Ùð	ûô ò 	Ùð	ûô ò Ùðús4   ™E ¾E+ Â$E: Å	E(Å'E(Å+	E7Å6E7Å:	FÆFc                  ó   — e Zd ZdZdd„Zy)ÚHookSpec)	Úargnamesr!   ÚkwargdefaultsÚ
kwargnamesÚnameÚ	namespacer.   r$   r%   c                ó
  — || _         || _        t        ||«      | _        t	        j
                  |«      xr% t        t	        j                  ||«      t        «       }t        | j                  |¬«      \  | _
        | _        t	        j                  | j                  «      j                  }t        t        | j                  |xs d«      «      | _        || _        |j%                  d«      | _        |j%                  d«      | _        y )NrV   r   r$   r%   )r�   r€   rb   r!   r^   r_   Ú
isinstanceÚgetattr_staticÚstaticmethodrz   r}   r   re   rh   ÚdictÚzipr~   r.   Úgetr$   r%   )r   r�   r€   r.   rW   rs   s         r   r   zHookSpec.__init__V  sÍ   € Ø"ˆŒØˆŒ	Ü/6°yÀ$Ó/GˆŒÜŸ™¨	Ó2ò 
¼:Ü×"Ñ" 9¨dÓ3´\ó<
ð 8
ˆô *2Ø�M‰M¨ô*
Ñ&ˆŒ�t”ô —>‘> $§-¡-Ó0×=Ñ=ˆÜ!¤# d§o¡o°x²~À2Ó"FÓGˆÔØˆŒ	Ø ŸH™H ^Ó4ˆÔØ!%§¡Ð*=Ó!>ˆÕr   N)r�   r   r€   r3   r.   r   r1   r4   )r<   r=   r>   r@   r   r   r   r   r|   r|   H  s   „ ð
€Iô?r   r|   )r-   ÚobjectrW   r5   r1   z'tuple[tuple[str, ...], tuple[str, ...]])#r?   Ú
__future__r   Úcollections.abcr   r   r^   ÚsysÚtypesr   Útypingr   r   r	   r
   r   rn   Ú_configr   r   r‰   r   Útyper   Ú__annotations__r   rB   Úimplementationr€   Ú_PYPYrm   Ú	frozensetrU   rz   r|   r   r   r   ú<module>r•      s  ðòõ #å $Ý #Û Û 
Û Ý Ý Ý Ý Ý Ý Û å !Ý !ñ ˆT˜ # v +Ñ.Ô/€à" TÑ)€
ˆIÓ )ð ÷S)ð S)ó ðS)ðl ÷q3ð q3ó ðq3ðh 	×Ñ×Ñ 6Ñ)€Ù,1Ñ(°€ñ
 )2ð 	0Ø2ðó)Ð �~ó ð ,1ñMØ
ðMØ$(ðMà,óMð` ÷?ð ?ó ñ?r   