File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
repo2docker/buildpacks/julia Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,15 @@ def get_build_env(self):
93
93
("JUPYTER_DATA_DIR" , "${NB_PYTHON_PREFIX}/share/jupyter" ),
94
94
]
95
95
96
+ @property
97
+ def project_dir (self ):
98
+ if self .binder_dir :
99
+ return "${REPO_DIR}/" + self .binder_dir
100
+ else :
101
+ return "${REPO_DIR}"
102
+
96
103
def get_env (self ):
97
- return super ().get_env () + [("JULIA_PROJECT" , "${REPO_DIR}" )]
104
+ return super ().get_env () + [("JULIA_PROJECT" , self . project_dir )]
98
105
99
106
def get_path (self ):
100
107
"""Adds path to Julia binaries to user's PATH.
@@ -148,15 +155,19 @@ def get_assemble_scripts(self):
148
155
The parent, CondaBuildPack, will add the build steps for
149
156
any needed Python packages found in environment.yml.
150
157
"""
151
- return super ().get_assemble_scripts () + [
158
+ scripts = super ().get_assemble_scripts ()
159
+ scripts .append (
152
160
(
153
161
"${NB_USER}" ,
154
162
r"""
155
- JULIA_PROJECT="" julia -e "using Pkg; Pkg.add(\"IJulia\"); using IJulia; installkernel(\"Julia\", \"--project=${REPO_DIR}\");" && \
156
- julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); Pkg.resolve(); pkg"precompile"'
157
- """ ,
163
+ JULIA_PROJECT="" julia -e "using Pkg; Pkg.add(\"IJulia\"); using IJulia; installkernel(\"Julia\", \"--project={project}\");" && \
164
+ julia --project={project} -e 'using Pkg; Pkg.instantiate(); Pkg.resolve(); pkg"precompile"'
165
+ """ .format (
166
+ project = self .project_dir
167
+ ),
158
168
)
159
- ]
169
+ )
170
+ return scripts
160
171
161
172
def detect (self ):
162
173
"""
You can’t perform that action at this time.
0 commit comments