Skip to content

blackbull.config

blackbull.config

Immutable startup configuration. Explicit run() arguments take precedence over BLACKBULL_* environment values, .env entries, AppConfig and defaults. See docs/guide/configuration.md for sentinel values and BB_* tuning.

AppConfig dataclass

Immutable, declarative startup configuration for a BlackBull app.

Every field corresponds one-to-one with a keyword argument of blackbull.serve / blackbull.BlackBull.run. Fields left at their sentinel default (None, or 0 for port, or False for reload) defer to serve's own built-in default unless an explicit run(...) argument overrides them.

log_config_sources(resolved, sources)

Log non-default deployment settings from env, .env or AppConfig; omit explicit call arguments.

resolve_run_config(explicit, config)

Resolve every run() setting and record where each value came from.

Precedence, highest to lowest:

  1. an explicit run(...) keyword argument (anything not None);
  2. a BLACKBULL_* environment variable (for the deploy-time settings in _ENV_VARS);
  3. a BLACKBULL_* entry in a .env file ([dotenv] extra);
  4. the bound AppConfig field, if declared (non-default);
  5. the built-in default.

Returns (resolved, sources) where resolved maps each run() parameter to its final value and sources maps it to a short provenance label (argument / $BLACKBULL_PORT / .env / AppConfig / default) for startup logging.