diff --git a/repo2docker/buildpacks/julia/__init__.py b/repo2docker/buildpacks/julia/__init__.py index 277cd9c6..1296f892 100644 --- a/repo2docker/buildpacks/julia/__init__.py +++ b/repo2docker/buildpacks/julia/__init__.py @@ -1,16 +1,11 @@ """Generates a Dockerfile based on an input matrix for Julia""" import os -from ..conda import CondaBuildPack +from ..python import PythonBuildPack -class JuliaBuildPack(CondaBuildPack): +class JuliaBuildPack(PythonBuildPack): """ Julia build pack which uses conda. - - The Julia build pack always uses the parent, `CondaBuildPack`, - since Julia does not work with Python virtual environments. - See https://github.com/JuliaPy/PyCall.jl/issues/410 - """ minor_julias = { diff --git a/tests/julia/pyplot-requirements/README.rst b/tests/julia/pyplot-requirements/README.rst new file mode 100644 index 00000000..38bc2e57 --- /dev/null +++ b/tests/julia/pyplot-requirements/README.rst @@ -0,0 +1,17 @@ +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. diff --git a/tests/julia/pyplot-requirements/REQUIRE b/tests/julia/pyplot-requirements/REQUIRE new file mode 100644 index 00000000..f858f97a --- /dev/null +++ b/tests/julia/pyplot-requirements/REQUIRE @@ -0,0 +1 @@ +PyPlot diff --git a/tests/julia/pyplot-requirements/requirements.txt b/tests/julia/pyplot-requirements/requirements.txt new file mode 100644 index 00000000..6ccafc3f --- /dev/null +++ b/tests/julia/pyplot-requirements/requirements.txt @@ -0,0 +1 @@ +matplotlib diff --git a/tests/julia/pyplot-requirements/verify b/tests/julia/pyplot-requirements/verify new file mode 100755 index 00000000..9f6781f1 --- /dev/null +++ b/tests/julia/pyplot-requirements/verify @@ -0,0 +1,24 @@ +#!/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