inject environment variables into pipfile.lock

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2018-03-21 07:05:03 -04:00
parent e025a3b52f
commit a58e2a8392
+7 -1
View File
@@ -411,7 +411,13 @@ class Project(object):
@property
def lockfile_content(self):
with open(self.lockfile_location) as lock:
return json.load(lock)
j = json.load(lock)
# Expand environment variables in Pipfile.lock at runtime.
for i, source in enumerate(j['_meta']['sources'][:]):
j['_meta']['sources'][i]['url'] = os.path.expandvars(j['_meta']['sources'][i]['url'])
return j
@property
def vcs_packages(self):