o
    *i                      @   sR   d dl Z d dlmZ d dlmZmZ d dlmZmZ e 	e
ZG dd deZdS )    N)Path)AnyOptional)	BaseModel	StrictStrc                   @   sT   e Zd ZU dZee ed< edee	e
f fddZeddee	 dd fddZdS )	FastAPIConfigN
entrypointreturnc                 C   s   t  d }| si S zddl}W n" ty4   zddl}W n ty1   td i  Y  Y S w Y nw t|d}|	|}|
di 
di W  d   S 1 sTw   Y  dS )zDRead FastAPI configuration from pyproject.toml in current directory.zpyproject.tomlr   Nz,tomli not available, skipping pyproject.tomlrbtoolfastapi)r   cwdexiststomllibImportErrortomliloggerdebugopenloadget)clspyproject_pathr   fdata r   O/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/fastapi_cli/config.py_read_pyproject_toml   s$   

$z"FastAPIConfig._read_pyproject_tomlc                 C   s"   |   }|d ur||d< | |S )Nr   )r   model_validate)r   r   configr   r   r   resolve#   s   
zFastAPIConfig.resolve)N)__name__
__module____qualname__r   r   r   __annotations__classmethoddictstrr   r   r    r   r   r   r   r   
   s   
 r   )loggingpathlibr   typingr   r   pydanticr   r   	getLoggerr!   r   r   r   r   r   r   <module>   s    
