Support requirements.txt & runtime.txt with Julia
The comment about Julia only working with CondaBuildPack
hasn't been true since we switched to using conda for getting
our pythons. This change allows people to use requirements.txt
with Julia, rather than forcing them to use environment.yaml
MODIFY
repo2docker/buildpacks/julia/__init__.py
repo2docker/buildpacks/julia/__init__.py
"""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 = {

ADD
tests/julia/pyplot-requirements/README.rst
+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.

ADD
tests/julia/pyplot-requirements/REQUIRE
+PyPlot

ADD
tests/julia/pyplot-requirements/requirements.txt
+matplotlib

ADD
tests/julia/pyplot-requirements/verify
+#!/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

Support requirements.txt & runtime.txt with Julia

The comment about Julia only working with CondaBuildPack
hasn't been true since we switched to using conda for getting
our pythons. This change allows people to use requirements.txt
with Julia, rather than forcing them to use environment.yaml