Skip to content

Commit 27a0ed8

Browse files
committed
Manually specify default compat version 1.5
1 parent 8083782 commit 27a0ed8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

repo2docker/buildpacks/julia/julia_project.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ def julia_version(self):
4141
else:
4242
project_toml = toml.load(self.binder_path("Project.toml"))
4343

44-
if "compat" in project_toml:
45-
if "julia" in project_toml["compat"]:
46-
julia_version_str = project_toml["compat"]["julia"]
47-
48-
# For Project.toml files, install the latest julia version that
49-
# satisfies the given semver.
50-
_julia_version = find_semver_match(julia_version_str, self.all_julias)
51-
if _julia_version is not None:
52-
return _julia_version
53-
54-
default_julia_version = self.all_julias[-1]
55-
return default_julia_version
44+
try:
45+
# For Project.toml files, install the latest julia version that
46+
# satisfies the given semver.
47+
compat = project_toml["compat"]["julia"]
48+
except:
49+
# Default version which needs to be manually updated with new major.minor releases
50+
compat = "1.5"
51+
52+
match = find_semver_match(compat, self.all_julias)
53+
if match is None:
54+
raise RuntimeError("Failed to find a matching Julia version: {compat}")
55+
return match
5656

5757
def get_build_env(self):
5858
"""Get additional environment settings for Julia and Jupyter

0 commit comments

Comments
 (0)