Fix detecting dependency files in binder/ subidr
MODIFY
repo2docker/buildpacks/conda/__init__.py
repo2docker/buildpacks/conda/__init__.py
"""
Buildpack for conda environments
"""
-import glob
import os
import re
@@ -124,6 +123,5 @@ class CondaBuildPack(BaseImage):
))
return super().get_assemble_scripts() + assembly_scripts
-
def detect(self):
return os.path.exists(self.binder_path('environment.yml')) and super().detect()

MODIFY
repo2docker/buildpacks/python/__init__.py
repo2docker/buildpacks/python/__init__.py
@@ -85,7 +85,8 @@ class PythonBuildPack(BaseImage):
return assemble_scripts
def detect(self):
- return os.path.exists('requirements.txt') and super().detect()
+ return (os.path.exists(self.binder_path('requirements.txt')) and
+ super().detect())
class Python2BuildPack(PythonBuildPack):
@@ -96,7 +97,6 @@ class Python2BuildPack(PythonBuildPack):
'virtualenv'
})
-
def get_env(self):
return super().get_env() + [
('VENV2_PATH', '${APP_BASE}/venv2')

MODIFY
repo2docker/buildpacks/r.py
repo2docker/buildpacks/r.py
@@ -210,11 +210,12 @@ class RBuildPack(PythonBuildPack):
),
]
- if os.path.exists('install.R'):
+ installR_path = self.binder_path('install.R')
+ if os.path.exists(installR_path):
assemble_scripts += [
(
"${NB_USER}",
- "Rscript install.R"
+ "Rscript %s" % installR_path
)
]

Fix detecting dependency files in binder/ subidr