Main issue is when loading the config file with an environment variable in .env that appends or prepends an existing environment variable , such as $HOME, the prepended or appended environment variable is not interpolated. See example .env/yaml config below
System/Project info
OS:
Ubuntu 18.04.6 LTS
Python Version:
3.8.12
pipenv
Version:2021.11.23
envyaml
Version:1.9.210927
Main issue is when loading the config file with an environment variable in
.env
that appends or prepends an existing environment variable , such as$HOME
, the prepended or appended environment variable is not interpolated. See example.env
/yaml
config belowNOTE: Also tried above without quotes and without {} brackets and got the same issue
my_source_directory: "${MY_SOURCE_DIRECTORY}"
NOTE: Also tried above without quotes and without {} brackets and got the same issue
MY_CONFIG=EnvYaml('myconfig.yaml') print(MY_CONFIG['my_source_directory']) '/home/myuser/mapped/source/directory'
MY_CONFIG=EnvYaml('myconfig.yaml') print(MY_CONFIG['my_source_directory']) '$HOME/mapped/source/directory'
ALSO GOT:
'${HOME}/mapped/source/directory'
import os print(os.getenv('MY_SOURCE_DIRECTORY')) '/home/myuser/mapped/source/directory'