From a58e2a83926cdfbc55a55c165101b3d76bb4dc95 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 21 Mar 2018 07:05:03 -0400 Subject: [PATCH] inject environment variables into pipfile.lock Signed-off-by: Kenneth Reitz --- pipenv/project.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pipenv/project.py b/pipenv/project.py index 812a9841..fbf76bc0 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -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):