File tree Expand file tree Collapse file tree 5 files changed +28
-7
lines changed
repo2docker/buildpacks/julia Expand file tree Collapse file tree 5 files changed +28
-7
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
"""
Original file line number Diff line number Diff line change 13
13
- Tests use of a ` Project.toml ` file for Julia, using the repo2docker default
14
14
version of Julia as specified in ` julia_project.py ` .
15
15
16
- ### project-1.0.2
16
+ ### project-1.0.2-binder-dir
17
17
18
18
- Tests use of a ` Project.toml ` file for Julia, using a version of Julia
19
19
specified via ` julia = "=1.0.2" ` in ` Project.toml ` 's ` [compat] ` section.
20
20
21
+ - Test use of a ` .binder ` directory.
22
+
21
23
### require
22
24
23
25
- Tests use of a ` REQUIRE ` file for Julia, using the repo2docker default version
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # A broken Project.toml, but the idea is that the test should ignore this file
2
+ # anyhow as there is a .binder folder.
3
+ #
4
+ [deps ]
5
+ IteratorInterfaceExtensions = " invalid"
6
+
7
+ [compat ]
8
+ julia = " =1.0.invalid"
File renamed without changes.
You can’t perform that action at this time.
0 commit comments