------------------
- Released 1.1.0. [Bruno Rocha]
- Added `MERGE_ENABLED_FOR_DYNACONF` with ability to merge nested dictionaries instead of replacing PR 88
- Support for dot notation to access nested dictionaries like `settings['KEY.OTHER.NESTED.DEEPER']` PR 93
- Support dotted notation for validators PR 98
- Fixed a bug in SETTINGS_MODULE cleanup when `.setenv` method was called PR 97
- Added Python 3.7 to test matrix PR 99
- Fixing new flake8 warnings. [Bruno Rocha]
- Update py.test command in tox to allow passing positional arguments.
[Joel Perras]
The basic, default functionality of running `tox` remains unchanged. You
are now, however, able to pass positional arguments to `py.test` at
invocation time. For example:
bash
tox -- -x --pdb tests/test_basic.py
Which will pass all input after the `--` separator (which is used to
signify the end of possible options to `tox`) down to the `py.test`
command in the `{posargs}` location, as defined in `tox.ini`.
- Enable Python 3.7 env for tox testing. [Joel Perras]
- Enable python 3.7 in TravisCI config. [Joel Perras]
- Updates Missing singleton with __eq__ dunder. (98) [Joël Perras]
Adds some additional tests for the `Missing` class and singleton
instance usage to ensure it returns equality only for comparisons to
itself and not `None`, or `False`, or `True`.
- Merge branch 'jperras-dotted-validators' [Bruno Rocha]
- Updates Missing singleton with __eq__ dunder. [Joel Perras]
Adds some additional tests for the `Missing` class and singleton
instance usage to ensure it returns equality only for comparisons to
itself and not `None`, or `False`, or `True`.
- Implements dotted-path validator name declarations. [Joel Perras]
One is now able to write:
python
settings.validators.register(
Validator('REDIS', must_exist=True, is_type_of=dict),
Validator('REDIS.HOST', must_exist=True, is_type_of=str),
Validator('REDIS.PORT', must_exist=True, is_type_of=int),
)
Which will validate the dotted attributes as nested structures. For
example, in yaml:
yaml
DEFAULT:
REDIS:
HOST: localhost
PORT: 1234
This necessitated a slight but non-negligible change in the
implementation of `Settings.exists()`, which previously did a shallow
check of loaded data. It has now been updated to perform a
`Settings.get()` of the key in question, and compares that to a newly
defined sentinel value to ensure `None` values do not cause a false
negative result.
New tests and assertions have been added to cover the new functionality.
Docs have been updated to show an example of the nested validator name
definition in action.
Closes rochacbruno/dynaconf85.
- Fix 94 setenv cleans SETTINGS_MODULE attribute. [Bruno Rocha]
- Merge branch 'jperras-dot-traversal-access' [Bruno Rocha]
- Merge branch 'dot-traversal-access' of
https://github.com/jperras/dynaconf into jperras-dot-traversal-access.
[Bruno Rocha]
- Allow dot-traversal access to nested dictionaries. [Joel Perras]
A simple memoized recursion has been added to `get()` if the key
contains at least one dot.
The caller can choose to opt-out of this behaviour by specifying the
`dotted_lookup` argument:
python
settings('AUTH.USERNAME', dotted_lookup=False)
While the performance impact of this has not been quantified, the net
impact in any real-world application should be minimal due to typical
nesting levels, and the fact that we overwrite the memoized portion of
the dotted-key lookup on each iteration.
- Avoids regressions [✓]
- Can be opted-out on a per-call basis [✓]
- Minimal performance impact [✓]
- Documented [✓]
- Tested [✓]
- Examples added [✓]
Closes rochacbruno/dynaconf84
- Merge branch 'rsnyman-merge-settings' [Bruno Rocha]
- Add example for merge_configs. [Bruno Rocha]
- Add setting merging. [Raoul Snyman]
- Add the ability to merge nested structures instead of completely overwriting them
- Use monkeypatch to stop one test from interfering with another
- Updated documentation