From fa080b351e237b3845c45b31796328de0cc98553 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Tue, 3 Jun 2025 12:22:24 +0000 Subject: [PATCH] Fix pydantic settings issue in config.py --- app/core/config.py | 12 ++++++------ requirements.txt | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 3fd3058..6e8151b 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1,13 +1,12 @@ import os from pathlib import Path -from pydantic import field_validator -from pydantic_settings import BaseSettings +from pydantic import field_validator, BaseModel # Project directories ROOT_DIR = Path(__file__).parent.parent.parent.resolve() -class Settings(BaseSettings): +class Settings(BaseModel): # Project info PROJECT_NAME: str = "One-Time Secret Sharing Service" API_V1_STR: str = "/api/v1" @@ -28,9 +27,10 @@ class Settings(BaseSettings): db_dir.mkdir(parents=True, exist_ok=True) return db_dir - class Config: - env_file = ".env" - case_sensitive = True + model_config = { + "env_file": ".env", + "case_sensitive": True, + } # Create global settings instance diff --git a/requirements.txt b/requirements.txt index 5f02353..0264456 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ SQLAlchemy>=2.0.9 alembic>=1.10.4 python-dotenv>=1.0.0 pydantic>=2.0.0 +pydantic-settings>=2.0.0 ruff>=0.0.262 cryptography>=40.0.2 asyncio>=3.4.3