kopia lustrzana https://github.com/jupyterhub/repo2docker
Add semver detection logic
rodzic
8afbcb62ec
commit
f3d0bf41e3
|
@ -2,30 +2,36 @@
|
||||||
import os
|
import os
|
||||||
import toml
|
import toml
|
||||||
from ..python import PythonBuildPack
|
from ..python import PythonBuildPack
|
||||||
|
from .julia_semver import find_semver_match
|
||||||
|
|
||||||
class JuliaProjectTomlBuildPack(PythonBuildPack):
|
class JuliaProjectTomlBuildPack(PythonBuildPack):
|
||||||
"""
|
"""
|
||||||
Julia build pack which uses conda.
|
Julia build pack which uses conda.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
minor_julias = {
|
# ALL EXISTING JULIA VERSIONS
|
||||||
'1.0': '1.0.3',
|
# Note that these must remain ordered, in order for the find_semver_match()
|
||||||
'1.1': '1.1.0',
|
# function to behave correctly.
|
||||||
}
|
all_julias = [
|
||||||
major_julias = {
|
"0.7.0",
|
||||||
'1': '1.1.0',
|
"1.0.0", "1.0.1", "1.0.2", "1.0.3",
|
||||||
}
|
"1.1.0",
|
||||||
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def julia_version(self):
|
def julia_version(self):
|
||||||
# TODO Read version out of the file
|
default_julia_version = '1.1.0'
|
||||||
# TODO Handle JuliaProject.toml
|
|
||||||
project_toml = toml.load(self.binder_path('Project.toml'))
|
project_toml = toml.load(self.binder_path('Project.toml'))
|
||||||
if 'compat' in project_toml:
|
if 'compat' in project_toml:
|
||||||
if 'julia' in project_toml['compat']:
|
if 'julia' in project_toml['compat']:
|
||||||
return project_toml['compat']['julia']
|
julia_version_str = project_toml['compat']['julia']
|
||||||
return self.major_julias['1']
|
|
||||||
|
# For Project.toml files, install the latest julia version that
|
||||||
|
# satisfies the given semver.
|
||||||
|
julia_version = find_semver_match(julia_version_str, self.all_julias)
|
||||||
|
if julia_version is None:
|
||||||
|
return _default_julia_version
|
||||||
|
return default_julia_version
|
||||||
|
|
||||||
def get_build_env(self):
|
def get_build_env(self):
|
||||||
"""Get additional environment settings for Julia and Jupyter
|
"""Get additional environment settings for Julia and Jupyter
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -19,6 +19,7 @@ setup(
|
||||||
'jinja2',
|
'jinja2',
|
||||||
'ruamel.yaml>=0.15',
|
'ruamel.yaml>=0.15',
|
||||||
'toml',
|
'toml',
|
||||||
|
'semver',
|
||||||
],
|
],
|
||||||
python_requires='>=3.4',
|
python_requires='>=3.4',
|
||||||
author='Project Jupyter Contributors',
|
author='Project Jupyter Contributors',
|
||||||
|
|
Ładowanie…
Reference in New Issue