mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
730d84217d
* allow use of a `.env`-style files in BaseSettings (#607) * address various issues with initial implementation - allow specifying `_env_file` kwarg in instantiation * overrides any `env_file` specified in the `Config` class - cast `os.environ` as a dict for better consistenty of behavior - `env_path` should be a `Path` type - replace `with open()` with `read_text` - use regex for parsing the dotenv files and throw error on invalid line - factor out `read_env_file` into separate file for easier testing * move back into a single file; revert typing changes; use regex better * pass `_env_file` argument around instead of setting a class attribute * add dotenv docs * add dotenv tests * Add changes file * Flesh out the docs a bit * Apply suggestions from @samuelcolvin's code review Co-Authored-By: Samuel Colvin <samcolvin@gmail.com> * wrap docs * add not about priority * fix tests and imports * fix tests * switch to python-dotenv * cleanup, test example * more docs tweaks * typo * fix tests for dotenv Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Pending Changes
This directory contains files describing changes to pydantic since the last release.
If you're creating a pull request, please add a new file to this directory called
<pull request or issue id>-<github username>.md. It should be formatted as a single paragraph of markdown
The contents of this file will be used to update HISTORY.md before the next release.