Fix dependency issue by replacing pydantic_settings with standard Pydantic BaseModel

This commit is contained in:
Automated Action 2025-06-09 13:56:48 +00:00
parent e3a20d9c4b
commit 5886399eb2

View File

@ -1,11 +1,10 @@
from pathlib import Path from pathlib import Path
from pydantic import field_validator from pydantic import BaseModel, field_validator
from pydantic_settings import BaseSettings
# Build paths # Build paths
BASE_DIR = Path(__file__).resolve().parent.parent.parent BASE_DIR = Path(__file__).resolve().parent.parent.parent
class Settings(BaseSettings): class Settings(BaseModel):
PROJECT_NAME: str = "Barebones Todo API" PROJECT_NAME: str = "Barebones Todo API"
API_V1_STR: str = "/api/v1" API_V1_STR: str = "/api/v1"
@ -21,8 +20,11 @@ class Settings(BaseSettings):
db_dir.mkdir(parents=True, exist_ok=True) db_dir.mkdir(parents=True, exist_ok=True)
return v return v
class Config: # Load settings from environment variables
env_file = ".env" model_config = {
case_sensitive = True "env_file": ".env",
"case_sensitive": True,
}
# Create settings instance
settings = Settings() settings = Settings()