From 8236dc8ae14410fad7998fe35614d785cea855f3 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 18 Jul 2019 16:25:04 +0200 Subject: [PATCH] only install pipenv in preassemble save preassembly of pipenv for a later patch --- repo2docker/buildpacks/pipfile/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/repo2docker/buildpacks/pipfile/__init__.py b/repo2docker/buildpacks/pipfile/__init__.py index c60a1f88..b38db08a 100644 --- a/repo2docker/buildpacks/pipfile/__init__.py +++ b/repo2docker/buildpacks/pipfile/__init__.py @@ -75,6 +75,15 @@ class PipfileBuildPack(CondaBuildPack): return files def get_preassemble_scripts(self): + """scripts to run prior to staging the repo contents""" + scripts = super().get_preassemble_scripts() + # install pipenv to install dependencies within Pipfile.lock or Pipfile + scripts.append( + ("${NB_USER}", "${KERNEL_PYTHON_PREFIX}/bin/pip install pipenv==2018.11.26") + ) + return scripts + + def get_assemble_scripts(self): """Return series of build-steps specific to this repository. """ # If we have either Pipfile.lock, Pipfile, or runtime.txt declare the @@ -113,11 +122,6 @@ class PipfileBuildPack(CondaBuildPack): # my_package_example = {path=".", editable=true} working_directory = self.binder_dir or "." - # install pipenv to install dependencies within Pipfile.lock or Pipfile - assemble_scripts.append( - ("${NB_USER}", "${KERNEL_PYTHON_PREFIX}/bin/pip install pipenv==2018.11.26") - ) - # NOTES: # - Without prioritizing the PATH to KERNEL_PYTHON_PREFIX over # NB_SERVER_PYTHON_PREFIX, 'pipenv' draws the wrong conclusion about