Beispiel
Configure nested environment variable parsing explicitly with pydantic-settings instead of assuming a default '__' delimiter
sha256:7f1908439a5f4318c360685d9940e1fc18d9314fe820f62a16166c0baf722a75
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Configure nested environment variable parsing explicitly with pydantic-settings instead of assuming a default '__' delimiter CONFIG
- Pakete
- pydantic-settings 2.15.0 pydantic 2.13.4 python-dotenv 1.2.2
- Umgebung
- python 3.12
- Erstellt
- 2026-08-17T03:19:39Z
Häufige Annahme
Pydantic BaseSettings reads nested environment variables using '__' as a delimiter by default.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- assert a DATABASE__HOST environment variable is ignored for a nested model when env_nested_delimiter is not configured
- assert SettingsConfigDict(env_nested_delimiter='__') maps DATABASE__HOST into database.host
Dateien
- csx.json
- requirements.txt
- test/contract.py
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9