feat: wire circuitforge-core config.load_env at entry points (closes #68 partial)
Some checks failed
CI / test (push) Failing after 19s
Some checks failed
CI / test (push) Failing after 19s
- app/app.py: load_env at module level (safe in Docker, fills gaps on bare-metal) - dev_api.py: load_env in startup handler (avoids test-env pollution) - requirements.txt: note >= 0.7.0 requirement; TODO tag once cf-core cuts release db.migration runner deferral: tracked in #43 (Rails-style numbered migrations) CFOrchClient VRAM wiring: already present in task_scheduler via CF_ORCH_URL env var
This commit is contained in:
parent
1ab1dffc47
commit
173da49087
2 changed files with 7 additions and 0 deletions
|
|
@ -17,6 +17,11 @@ sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||||
|
|
||||||
logging.basicConfig(level=logging.WARNING, format="%(name)s %(levelname)s: %(message)s")
|
logging.basicConfig(level=logging.WARNING, format="%(name)s %(levelname)s: %(message)s")
|
||||||
|
|
||||||
|
# Load .env before any os.environ reads — safe to call inside Docker too
|
||||||
|
# (uses setdefault, so Docker-injected vars take precedence over .env values)
|
||||||
|
from circuitforge_core.config.settings import load_env as _load_env
|
||||||
|
_load_env(Path(__file__).parent.parent / ".env")
|
||||||
|
|
||||||
IS_DEMO = os.environ.get("DEMO_MODE", "").lower() in ("1", "true", "yes")
|
IS_DEMO = os.environ.get("DEMO_MODE", "").lower() in ("1", "true", "yes")
|
||||||
|
|
||||||
import streamlit as st
|
import streamlit as st
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,12 @@
|
||||||
# Keep in sync with environment.yml
|
# Keep in sync with environment.yml
|
||||||
|
|
||||||
# ── CircuitForge shared core ───────────────────────────────────────────────
|
# ── CircuitForge shared core ───────────────────────────────────────────────
|
||||||
|
# Requires circuitforge-core >= 0.7.0 (config.load_env, db, tasks, resources).
|
||||||
# Local dev / Docker (parent-context build): path install works because
|
# Local dev / Docker (parent-context build): path install works because
|
||||||
# circuitforge-core/ is a sibling directory.
|
# circuitforge-core/ is a sibling directory.
|
||||||
# CI / fresh checkouts: falls back to the Forgejo VCS URL below.
|
# CI / fresh checkouts: falls back to the Forgejo VCS URL below.
|
||||||
# To use local editable install run: pip install -e ../circuitforge-core
|
# To use local editable install run: pip install -e ../circuitforge-core
|
||||||
|
# TODO: pin to @v0.7.0 tag once cf-core cuts a release tag.
|
||||||
git+https://git.opensourcesolarpunk.com/Circuit-Forge/circuitforge-core.git@main
|
git+https://git.opensourcesolarpunk.com/Circuit-Forge/circuitforge-core.git@main
|
||||||
|
|
||||||
# ── Web UI ────────────────────────────────────────────────────────────────
|
# ── Web UI ────────────────────────────────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue