feat(config,utils)!: introduce Pydantic-based Settings and unified dotenv autoload
- Move dotenv autoloading into deepeval/config/settings.py with clear precedence:
.env -> .env.{APP_ENV} -> .env.local; process env always wins; opt out via DEEPEVAL_DISABLE_DOTENV; support ENV_DIR_PATH (expands ~ and $VARS).
- Add Settings (pydantic-settings) to centralize env variables; all optional by design.
* Validators:
- Booleans coerced via parse_bool (accepts 1/0, yes/no, on/off, enabled/disabled).
- Paths (DEEPEVAL_RESULTS_FOLDER, ENV_DIR_PATH) expand ~ and $VARS.
- Floats accept "", "none", "null" -> None (cost overrides, TEMPERATURE).
- TEMPERATURE constrained with confloat(ge=0, le=2).
- URL-like fields typed as AnyUrl.
- DEEPEVAL_DEFAULT_SAVE validated as "dotenv" or "dotenv:<path>" with path expansion.
- DEEPEVAL_FILE_SYSTEM normalized (READ_ONLY, RO -> READ_ONLY).
- Refactor utils:
* Add parse_bool, get_env_bool, bool_to_env_str, set_env_bool.
* Replace YES/NO checks with canonical helpers; reading remains backward compatible.
- Wire __init__.py to call autoload_dotenv() from config.settings.
- Remove legacy deepeval/env.py.
- Add dependencies: pydantic and pydantic-settings to pyproject.toml.
BREAKING CHANGE: env booleans written by helpers are now serialized as
"1"/"0" instead of "YES"/"NO". Reading still accepts previous values,
but if any external
tooling relied on our old output format, that tooling will need to be updated. B
BloggerBust committed
b1dec13531f752e96c82e2368fa194063d4341f5
Parent: 69bb75e