o
    NK&h                     @  sT   d dl mZ d dlmZ d dlmZ d dlmZ er d dlm	Z	 dddddZ
dS )    )annotations)suppress)import_module)TYPE_CHECKING)SanicF)failappr   r   boolc                K  s   | j jsdS d}tt td}W d   n1 sw   Y  |s*|r(tddS t| ddsAt|d}|| fi || _| jS dS )az  Setup Sanic Extensions.

    Requires Sanic Extensions to be installed.

    Args:
        app (Sanic): Sanic application.
        fail (bool, optional): Raise an error if Sanic Extensions is not
            installed. Defaults to `False`.
        **kwargs: Keyword arguments to pass to `sanic_ext.Extend`.

    Returns:
        sanic_ext.Extend: Sanic Extensions instance.
    N	sanic_extzSanic Extensions is not installed. You can add it to your environment using:
$ pip install sanic[ext]
or
$ pip install sanic-ext_extExtend)	configAUTO_EXTENDr   ModuleNotFoundErrorr   RuntimeErrorgetattrr   ext)r   r   kwargsr
   Ext r   H/var/www/html/venv/lib/python3.10/site-packages/sanic/application/ext.py	setup_ext   s"   


r   N)r   r   r   r	   )
__future__r   
contextlibr   	importlibr   typingr   sanicr   r   r   r   r   r   <module>   s    