Commit Graph

20 Commits

Author SHA1 Message Date
Amin Alaee 228e46de35 Update docs for dotenv env_file not checking parent directories (#4150) 2022-07-14 18:39:28 +02:00
Amin Alaee 962ea8bf21 Add docs for defining upper-case variables on nested setting models (#4153) 2022-07-05 20:04:46 +02:00
Jochen Kupperschmidt 058d4a52ee Tweak documentation (#4143) 2022-07-04 22:53:11 +02:00
Gary Donovan 7f90b2f342 Remove incorrect comment about lazy evaluation of setting sources (#3806)
* Remove incorrect comment about lazy evaluation of setting sources

It looks like the current implementation always evaluates every source (https://github.com/samuelcolvin/pydantic/blob/9d631a3429a66f30742c1a52c94ac18ec6ba848d/pydantic/env_settings.py#L73) before coalescing them into a single dictionary to pass to `BaseModel`. So the comment about lazy evaluation is incorrect and should be removed.

* Add changelog
2022-04-02 15:25:43 +01:00
Guilhem C 90628e1c2b docs: fix typo in settings management page (#3781) 2022-04-01 19:47:05 +01:00
Mark Trifonov be246701c5 Nested env (#3159)
* Environment names for complex types #2304

* nested env disabled by default

* cleanup

* nested env settings: simplified and mypy fixes

* nested env settings: config, test, doc

* nested env settings: changes file

* nested env settings: cleanup

* Apply suggestions from code review

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* Apply suggested changes from code review

* lint fix

* changes from code review

* simplify explosing env vars

* linting

Co-authored-by: Mark Trifonov <>
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-12-18 20:56:14 +00:00
Christian Clauss 90080ba0de Fix typos discovered by codespell (#3096) 2021-09-04 00:05:36 +02:00
nikhilraojl 9bd2da7805 fix: docs indentation (#2448)
* fix: docs indentation

* docs: last fixes indentation

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2021-03-02 10:33:50 +00:00
David Jack Wange Olrik 12ebf0cfab fix: Change non-existent secrets dir into a warning (#2265)
* fix: Change non-existant secrets dir into a warning

* Simplify if condition

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>

* Reword changelog entry

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-02-13 11:06:39 +00:00
Thomas Berdy 1155de82b9 feat: Add the ability to add extra settings sources (#2107)
* feat: Add the ability to add extra settings sources

* doc: Document "customise settings sources" feature

* tests: Add missing test and add change file

* Update changes/2107-kozlek.md

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>

* improve docs for settings customise_sources

* fix docs building

* fix test :-(

Co-authored-by: Thomas Berdy <thomas.berdy@outlook.com>
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-02-11 16:55:40 +00:00
Jeff Astor bd9c5723c6 [Docs] Friendly spell/case check in settings management (#2302) 2021-01-29 18:45:57 +01:00
milo-minderbinder 9af8f11086 fix typo in example secret filename (#2074) 2020-10-31 18:41:18 +00:00
mdgilene 30cd121cfe Add ability to read secrets from files (#1820)
* Add ability to read secrets from files

* Added docs and updated tests to handle new _build_values argument

* Updated docs to note which types are loaded

* Updated deep_update to take a list of update mappings

* Added warning when fields are not defined as a secret type

* Address additional PR feedback

* improve documentation

* remove redundant UserWarning lines

* allow any field type, not just SecretStr

* regex escape paths in windows 😴

* skip tests on windows 😧 🔫

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-10-26 10:06:25 +00:00
PrettyWood 0cee311be5 feat(settings): allow custom encoding for dotenv files (#1620)
closes #1615
2020-06-11 11:04:08 +01:00
Connor 730d84217d allow use of a .env-style files in BaseSettings (#607) (#1011)
* 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>
2020-01-19 16:45:36 +00:00
Anthony 1a273f2e64 docs: Fix explanation of case sensitivity for Settings (#1110)
* docs: Fix explanation of case sensitivity for `Settings`

* Add changes

* Update docs/usage/settings.md

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update docs/usage/settings.md

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update docs/usage/settings.md

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
2019-12-18 14:16:38 +00:00
Samuel Colvin 17b5ff42c1 renaming docs examples (#972)
* renaming docs examples

* tweaks
2019-11-07 14:40:44 +00:00
Samuel Colvin e7227db41a Insert prints in docs. (#895)
* starting insert prints

* working exec_script

* remove prints, fix exec_examples.py

* more cleanup of examples, better model printing

* upgrade netlify runtime

* extra docs deps

* few more small tweaks
2019-10-14 16:40:25 +01:00
dmontagu beb57364d2 Lots of minor docs tweaks (#877)
* Lots of minor changes

* More tweaks

* Remove git conflicts

* suggested tweaks
2019-10-10 12:00:22 +01:00
Samuel Colvin 33b7d52d31 moving docs to mkdocs (#856)
* moving docs to mkdocs

* transfering readme to md and more

* fixing build

* splitting usage.md

* improving schema.md and index.md

* fix make_history.rst

* models intro

* working on data conversation and required fields

* more fixes to models.md

* list all standard types supported

* list of pydantic types

* tweaks

* update links in code

* Apply suggestions from code review

incorporate @dmontagu's suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more missed suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more corrects.

* cleanup

* Field order warning

* fix and regenerate benchmarks

* format examples better, cleanup

* improve schema mapping table

* correct highlighting file types in schema.md

* add redirects in javascript

* add logo
2019-10-07 17:19:01 +01:00