From 163b82dab7835123ac8904d650a01087ad248d55 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Sat, 17 May 2025 13:38:59 +0000 Subject: [PATCH] Fix deployment error with pydantic_settings - Add pydantic-settings to requirements.txt - Update config.py to handle missing pydantic_settings module - Use fallback to regular pydantic BaseSettings if pydantic_settings is not available --- app/core/config.py | 6 +++++- requirements.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/core/config.py b/app/core/config.py index 7282344..a661a47 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1,6 +1,10 @@ from pathlib import Path -from pydantic_settings import BaseSettings +# Try to import from pydantic_settings, fall back to pydantic if not available +try: + from pydantic_settings import BaseSettings +except ImportError: + from pydantic import BaseSettings class Settings(BaseSettings): diff --git a/requirements.txt b/requirements.txt index 26180c2..026d760 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,6 @@ uvicorn>=0.15.0 sqlalchemy>=1.4.0 alembic>=1.7.0 pydantic>=2.0.0 +pydantic-settings>=2.0.0 python-dotenv>=0.19.0 ruff>=0.0.270 \ No newline at end of file