Skip to content

Commit

Permalink
Rebuild PyCall after installing ipython
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Nov 1, 2018
1 parent cfbe21b commit dd9a827
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
18 changes: 11 additions & 7 deletions test/install_dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ Pkg.build("PyCall")
using Compat: @info
using IPython

if VERSION >= v"0.7.0-"
@info "PyCall/deps/build.log:"
print(read(
joinpath(dirname(dirname(pathof(IPython.PyCall))), "deps", "build.log"),
String))
end

IPython.install_dependency("pytest"; force=true)
IPython.install_dependency("ipython"; force=true)
if get(ENV, "CONDA_JL_VERSION", "") == "2"
# For IPython.testing.globalipapp
IPython.install_dependency("mock"; force=true)
end

# Build PyCall again, since above installation could have changed
# Python versions.
Pkg.build("PyCall")

if VERSION >= v"0.7.0-"
@info "PyCall/deps/build.log:"
print(read(
joinpath(dirname(dirname(pathof(IPython.PyCall))), "deps", "build.log"),
String))
end
17 changes: 16 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# module TestIPython

if lowercase(get(ENV, "CI", "false")) == "true"
include("install_dependencies.jl")
let
if VERSION < v"0.7.0-"
setup_code = ""
else
setup_code = Base.load_path_setup_code()
end
path = joinpath(@__DIR__, "install_dependencies.jl")
code = """
$setup_code
include("$(escape_string(path))")
"""
run(`$(Base.julia_cmd()) -e $code`)
# Run install_dependencies.jl in a separate process since it
# may re-build PyCall. In that case, we need to load
# re-precompiled PyCall and IPython.
end
end

include("preamble.jl")
Expand Down

0 comments on commit dd9a827

Please sign in to comment.