Simplify config override syntax (#8)

* update tests and expected behavior

* clean up arg parsing tests

* update deserialization

* update deserialization

* config argparse action

* update override application logic

* update tests; delete unused imports

* override param must be list

* update docstring

* update test input to SUT

* update remaining override unittests

* make format

* forgot to update CLI syntax
This commit is contained in:
Suhas 2021-02-01 13:30:59 -05:00 committed by GitHub
parent d55fa4134a
commit 2be0d3729e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -18,6 +18,7 @@ from .plugins import util
def deserialize_config_args(input: list) -> dict:
"""
Convert a two-element list of configuration key-value pair into a flat dict
@ -44,6 +45,7 @@ def deserialize_config_args(input: list) -> dict:
cfg_value = False
runtime_modifications[cfg_key] = cfg_value
return runtime_modifications

View file

@ -11,9 +11,11 @@ def apply_overrides(overrides: list, base_config: dict) -> dict:
"""
config = base_config.copy()
for pairs in overrides:
key_as_dots, override_value = list(pairs.items())[0]
keys = key_as_dots.split(".")
config = _recursively_apply(config, keys, override_value)
return config