@@ -147,14 +147,14 @@ def _filter_blacklist(package):
147147 pip .main (['install' , package , '-t' , path , '--ignore-installed' , '--no-cache-dir' ])
148148
149149
150- def pip_install_to_target (path , requirements = False , local_package = None ):
150+ def pip_install_to_target (path , requirements = None , local_package = None ):
151151 """
152152 For a given active virtualenv, gather all installed pip packages then
153153 copy (re-install) them to the path provided.
154154
155155 Args:
156156 path (str): Path to copy installed pip packages to.
157- requirements (bool ):
157+ requirements (str ):
158158 If set, only the packages in the requirements.txt
159159 file are installed.
160160 The requirements.txt file needs to be in the same directory as the
@@ -169,12 +169,15 @@ def pip_install_to_target(path, requirements=False, local_package=None):
169169 None
170170 """
171171 packages = []
172- if requirements and os .path .exists (requirements ):
173- log .info ('Gathering requirement from %s' % requirements )
174- data = read_file (requirements )
175- packages .extend (data .splitlines ())
176- else :
177- log .error ('Could not load requirements from: %s (does it exist?)' % requirements )
172+ if requirements :
173+ if os .path .exists (requirements ):
174+ log .info ('Gathering requirement from %s' % requirements )
175+ data = read_file (requirements )
176+ packages .extend (data .splitlines ())
177+ else :
178+ log .error ('Could not load requirements from: %s (does it exist?)'
179+ % requirements )
180+
178181 if local_package is not None :
179182 packages .append (local_package )
180183 if packages :
0 commit comments