Skip to content

Commit

Permalink
feat(conf): don't load config-values for traits with ENV-VAR in metadata
Browse files Browse the repository at this point in the history
+ Respect precendance rules laied in
ipython#99 (comment)
  • Loading branch information
ankostis committed Aug 12, 2017
1 parent 9cea826 commit 7d70830
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion traitlets/config/configurable.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ def _load_config(self, cfg, section_names=None, traits=None):
# hold trait notifications until after all config has been loaded
with self.hold_trait_notifications():
for name, config_value in my_config.items():
if name in traits:
trait = traits.get(name)
if trait:
if trait.get_env_value() is not None:
## Env-vars take precendance over config-params.
continue

if isinstance(config_value, LazyConfigValue):
# ConfigValue is a wrapper for using append / update on containers
# without having to copy the initial value
Expand Down

0 comments on commit 7d70830

Please sign in to comment.