Pass the interpolation value to python-dotenv

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
Ulysses Souza 2020-01-29 14:29:32 +01:00
parent f17e7268b0
commit edf27e486a
2 changed files with 6 additions and 3 deletions

View File

@ -39,8 +39,10 @@ def env_vars_from_file(filename, interpolate=True):
elif not os.path.isfile(filename):
raise EnvFileNotFound("{} is not a file.".format(filename))
# TODO: now we should do something with interpolate here, but what?
return dotenv.dotenv_values(dotenv_path=filename, encoding='utf-8-sig')
env = dotenv.dotenv_values(dotenv_path=filename, encoding='utf-8-sig', interpolate=interpolate)
for k, v in env.items():
env[k] = v if interpolate else v.replace('$', '$$')
return env
class Environment(dict):

View File

@ -10,6 +10,7 @@ dockerpty==0.4.1
docopt==0.6.2
enum34==1.1.6; python_version < '3.4'
functools32==3.2.3.post2; python_version < '3.2'
git+git://github.com/ulyssessouza/python-dotenv.git@no-interpolate#egg=python-dotenv
idna==2.8
ipaddress==1.0.23
jsonschema==3.2.0
@ -17,7 +18,7 @@ paramiko==2.7.1
pypiwin32==219; sys_platform == 'win32' and python_version < '3.6'
pypiwin32==223; sys_platform == 'win32' and python_version >= '3.6'
PySocks==1.7.1
python-dotenv==0.10.5
#python-dotenv==0.10.5
PyYAML==5.3
requests==2.22.0
six==1.12.0