Skip to content

Commit 5cf4f78

Browse files
committed
add assemble_subset
- get_assemble_files() returns list of files needed for assembly - if buildpack.assemble_with_subset is set, only load assemble_files prior to running assembly scripts. Load the rest of the repo afterward conda opts in to this, but currently I think this works for everything *except* requirements.txt
1 parent 5ef42fc commit 5cf4f78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

repo2docker/buildpacks/conda/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ def py2(self):
178178
"""Am I building a Python 2 kernel environment?"""
179179
return self.python_version and self.python_version.split(".")[0] == "2"
180180

181+
def get_assemble_files(self):
182+
"""Specify that assembly only requires environment.yml
183+
184+
enables caching assembly result even when
185+
repo contents change
186+
"""
187+
assemble_files = super().get_assemble_files()
188+
environment_yml = self.binder_path('environment.yml')
189+
if os.path.exists(environment_yml):
190+
assemble_files.append(environment_yml)
191+
return assemble_files
192+
181193
def get_assemble_scripts(self):
182194
"""Return series of build-steps specific to this source repository.
183195
"""

0 commit comments

Comments
 (0)