fix: allow extra environment variables in pydantic-settings

Add extra='ignore' to Settings Config to prevent ValidationError when
.env files contain deprecated variables (e.g., PADDLEOCR_MODEL_DIR).
This ensures backwards compatibility with Docker deployments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-02 17:53:34 +08:00
parent c006905b6f
commit 7916c75768

View File

@@ -416,6 +416,9 @@ class Settings(BaseSettings):
)
env_file_encoding = "utf-8"
case_sensitive = False
# Ignore extra environment variables not defined in Settings
# This allows backwards compatibility with old .env files (e.g., Docker)
extra = "ignore"
def _resolve_path(self, path_value: str) -> Path:
"""