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:
- an explicit
run(...)keyword argument (anything notNone); - a
BLACKBULL_*environment variable (for the deploy-time settings in_ENV_VARS); - a
BLACKBULL_*entry in a.envfile ([dotenv]extra); - the bound
AppConfigfield, if declared (non-default); - 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.