kopia lustrzana https://github.com/jupyterhub/repo2docker
ci: refactor julia tests, from 5 to 4 (~5 min saved)
rodzic
f1b1339507
commit
a6af244605
|
@ -50,6 +50,16 @@ class JuliaProjectTomlBuildPack(PythonBuildPack):
|
|||
compat = project_toml["compat"]["julia"]
|
||||
except:
|
||||
# Default version which needs to be manually updated with new major.minor releases
|
||||
#
|
||||
# NOTE: Updates to the default version should go hand in hand with
|
||||
# updates to tests/julia/project/verify where is intent to
|
||||
# test the version.
|
||||
#
|
||||
# FIXME: When compat = "1.6" is set below and passed to
|
||||
# find_semver_match, we get 1.8.2 as of 2022-10-09. We should
|
||||
# clarify the desired behavior and have a unit test of
|
||||
# find_semver_match to validate it.
|
||||
#
|
||||
compat = "1.6"
|
||||
|
||||
match = find_semver_match(compat, self.all_julias)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
Julia - Project.toml: test version for julia v1.0.2
|
||||
---------------------------------------------------
|
||||
|
||||
Test a Project.toml file for julia.
|
|
@ -1,4 +0,0 @@
|
|||
Julia - Project.toml: test version for julia v1.1
|
||||
-------------------------------------------------
|
||||
|
||||
Test a Project.toml file for julia.
|
|
@ -1,22 +0,0 @@
|
|||
Julia - REQUIRE: packages and julia version number
|
||||
---------------
|
||||
|
||||
To specify dependencies in Julia, include a REQUIRE file.
|
||||
|
||||
To specify a version of Julia to be installed, the first line of the file must
|
||||
follow the format `julia <version-number>`. For example:
|
||||
```
|
||||
julia 0.7
|
||||
```
|
||||
|
||||
To add package dependencies, the rest of the file can include lines that list
|
||||
the names of packages you'd like to be installed. For example:
|
||||
|
||||
```
|
||||
PyPlot
|
||||
DataFrames
|
||||
```
|
||||
|
||||
Note that `IJulia` is installed by default.
|
||||
|
||||
These packages will all be installed, and then precompiled via `using`.
|
|
@ -1,4 +0,0 @@
|
|||
julia 0.6.3
|
||||
|
||||
# Julia packages:
|
||||
Compat
|
|
@ -1,5 +0,0 @@
|
|||
Julia - REQUIRE: test version for julia v1.0
|
||||
---------------
|
||||
|
||||
Starting with julia v0.7 and up, the package manager has changed, so this tests
|
||||
that the julia version can be specified and packages installed correctly.
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/env julia
|
||||
# Verify the version:
|
||||
if VERSION < v"1" || VERSION >= v"1.1"
|
||||
exit(1)
|
||||
end
|
||||
|
||||
try
|
||||
# Test that the package was installed.
|
||||
using Compat
|
||||
|
||||
# Verify that the environment variables are set correctly for julia 1.0+
|
||||
@assert "julia" ∈ readdir(Sys.BINDIR)
|
||||
catch
|
||||
exit(1)
|
||||
end
|
||||
|
||||
exit(0)
|
|
@ -0,0 +1,4 @@
|
|||
Julia - Project.toml
|
||||
--------------------
|
||||
|
||||
Test a Project.toml file with a specified version for julia.
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env julia
|
||||
# Verify the version:
|
||||
|
||||
if VERSION != v"1.0.2"
|
||||
println("Julia version should be 1.0.2")
|
||||
exit(1)
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Julia - Project.toml
|
||||
--------------------
|
||||
|
||||
This tests a Project.toml file for julia, using the repo2docker default version
|
||||
of julia as specified in ``julia_project.py``.
|
|
@ -1,8 +1,13 @@
|
|||
#!/usr/bin/env julia
|
||||
# Verify the version:
|
||||
if VERSION < v"1.1.0"
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# FIXME: The default version set by repo2docker is in practice the latest
|
||||
# available, but from the julia_project.py file that doesn't seem
|
||||
# intented.
|
||||
#
|
||||
# if ! (VERSION >= v"1.6" && VERSION < v"1.7")
|
||||
# println("Default Julia version should be at 1.6.x")
|
||||
# exit(1)
|
||||
# end
|
||||
|
||||
try
|
||||
# Test that the package was installed.
|
|
@ -1,17 +0,0 @@
|
|||
Julia - REQUIRE
|
||||
---------------
|
||||
|
||||
To specify dependencies in Julia, include a REQUIRE file that lists the names
|
||||
of packages you'd like to be installed. For example:
|
||||
|
||||
```
|
||||
PyPlot
|
||||
IJulia
|
||||
DataFrames
|
||||
```
|
||||
|
||||
Each one will be installed but **not** pre-compiled. If you'd like to
|
||||
pre-compile your Julia packages, consider using a ``postBuild`` file.
|
||||
|
||||
Note that this example also specifies Python dependencies with an
|
||||
``requirements.txt`` file.
|
|
@ -1 +0,0 @@
|
|||
PyPlot
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/env julia
|
||||
using PyPlot
|
||||
|
||||
# Make sure we are re-using the same conda python
|
||||
if ! startswith(PyCall.libpython, ENV["NB_PYTHON_PREFIX"] * "/lib")
|
||||
println("Not re-using conda python! Using " * PyCall.libpython * " instead")
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# We try to plot something, and see if the file saved exists
|
||||
x = linspace(0,2*pi,1000); y = sin(3*x + 4*cos(2*x))
|
||||
plot(x, y, color="red", linewidth=2.0, linestyle="--")
|
||||
savefig("graph.png")
|
||||
if isfile("graph.png")
|
||||
exit(0)
|
||||
else
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# We check that PyPlot is installed inside ${JULIA_DEPOT_PATH}
|
||||
if ! isdir(ENV["JULIA_DEPOT_PATH"] * "/packages/PyPlot")
|
||||
println("PyPlot not installed under JULIA_DEPOT_PATH")
|
||||
exit(1)
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
Julia - REQUIRE, and a requirements.txt file
|
||||
--------------------------------------------
|
||||
|
||||
This tests a REQUIRE file for julia, using the repo2docker default version of
|
||||
julia as specified in ``julia_require.py``.
|
||||
|
||||
This tests the use of the legacy REQUIRE file together with the an
|
||||
``requirements.txt`` file.
|
|
@ -0,0 +1,5 @@
|
|||
julia 1
|
||||
|
||||
# Julia packages:
|
||||
PyCall
|
||||
PyPlot
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env julia
|
||||
using PyCall
|
||||
using PyPlot
|
||||
|
||||
if ! (VERSION >= v"1" && VERSION < v"2")
|
||||
println("Julia version was: ", VERSION)
|
||||
println("Julia version expected to be 1.x when pinned to 1 in a REQUIRE file")
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# Make sure we are re-using the same conda python
|
||||
if ! startswith(PyCall.libpython, ENV["NB_PYTHON_PREFIX"] * "/lib")
|
||||
println("Not re-using conda python! Using " * PyCall.libpython * " instead")
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# We check that PyPlot is installed inside ${JULIA_DEPOT_PATH}
|
||||
if ! isdir(ENV["JULIA_DEPOT_PATH"] * "/packages/PyPlot")
|
||||
println("PyPlot not installed under JULIA_DEPOT_PATH")
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# FIXME: Julia code that worked before v1, but now fails with:
|
||||
#
|
||||
# ERROR: LoadError: UndefVarError: linspace not defined
|
||||
#
|
||||
# x = linspace(0,2*pi,1000); y = sin(3*x + 4*cos(2*x))
|
||||
# plot(x, y, color="red", linewidth=2.0, linestyle="--")
|
||||
# savefig("graph.png")
|
||||
# if isfile("graph.png")
|
||||
# exit(0)
|
||||
# else
|
||||
# exit(1)
|
||||
# end
|
|
@ -0,0 +1,9 @@
|
|||
Julia - REQUIRE, and use of old package manager
|
||||
-----------------------------------------------
|
||||
|
||||
This tests a REQUIRE file for julia, using the repo2docker default version of
|
||||
julia as specified in ``julia_require.py``. Note that this is default version is
|
||||
0.6.4!
|
||||
|
||||
Starting with Julia v0.7 and up, the package manager has changed, so this tests
|
||||
that the Julia version below that can be installed correctly as well.
|
|
@ -1,4 +1,2 @@
|
|||
julia 1.0
|
||||
|
||||
# Julia packages:
|
||||
Compat
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env julia
|
||||
# Verify the version:
|
||||
if VERSION != v"0.6.3"
|
||||
|
||||
if VERSION != v"0.6.4"
|
||||
println("Julia version was: ", VERSION)
|
||||
println("Default Julia version expected to be 0.6.4 when unspecified in a REQUIRE file")
|
||||
exit(1)
|
||||
end
|
||||
|
||||
|
@ -8,7 +10,7 @@ try
|
|||
# Test that the package was installed.
|
||||
using Compat
|
||||
|
||||
# Verify that the environment variables are set correctly for julia <= 0.6
|
||||
# Verify that the environment variables are set correctly for julia < 0.7
|
||||
@assert "julia" ∈ readdir(Base.JULIA_HOME)
|
||||
catch
|
||||
exit(1)
|
Ładowanie…
Reference in New Issue