Problem
We currently access environment variables directly in multiple places across the codebase. This makes it hard to track which env vars exist, leads to duplicated logic, and causes unintended side effects in tests.
Proposal
Introduce a centralized configuration object using pydantic.BaseSettings, which automatically loads from os.environ - https://docs.pydantic.dev/latest/concepts/pydantic_settings/
Example:
from pydantic import BaseSettings, Field
class KilnSettings(BaseSettings):
XYZ: str | None = Field(default=None, description="Controls XYZ. Leave blank for bla bla")
KILN_SETTINGS = KilnSettings()
Problem
We currently access environment variables directly in multiple places across the codebase. This makes it hard to track which env vars exist, leads to duplicated logic, and causes unintended side effects in tests.
Proposal
Introduce a centralized configuration object using
pydantic.BaseSettings, which automatically loads fromos.environ- https://docs.pydantic.dev/latest/concepts/pydantic_settings/Example: