Module

config.environment

Environment detection for config system.

Automatically detects deployment environment from platform-specific environment variables (Netlify, Vercel, GitHub Actions, etc).

Functions

detect_environment
Detect deployment environment from platform signals. Checks in order: 1. BENGAL_ENV (explicit over…
0 str
def detect_environment() -> str

Detect deployment environment from platform signals.

Checks in order:

  1. BENGAL_ENV (explicit override)
  2. Netlify (NETLIFY=true + CONTEXT)
  3. Vercel (VERCEL=1 + VERCEL_ENV)
  4. GitHub Actions (GITHUB_ACTIONS=true)
  5. Default: "local"

Returns

str

Environment name: "local", "preview", or "production"

get_environment_file_candidates
Get candidate filenames for environment config. Returns list in priority order (first match wins).
1 list[str]
def get_environment_file_candidates(environment: str) -> list[str]

Get candidate filenames for environment config.

Returns list in priority order (first match wins).

Parameters 1

Name Type Default Description
environment str

Environment name (e.g., "production")

Returns

list[str]

List of candidate filenames