Skip to content

Commit dd9a827

Browse files
committed
Rebuild PyCall after installing ipython
1 parent cfbe21b commit dd9a827

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

test/install_dependencies.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ Pkg.build("PyCall")
1212
using Compat: @info
1313
using IPython
1414

15-
if VERSION >= v"0.7.0-"
16-
@info "PyCall/deps/build.log:"
17-
print(read(
18-
joinpath(dirname(dirname(pathof(IPython.PyCall))), "deps", "build.log"),
19-
String))
20-
end
21-
2215
IPython.install_dependency("pytest"; force=true)
2316
IPython.install_dependency("ipython"; force=true)
2417
if get(ENV, "CONDA_JL_VERSION", "") == "2"
2518
# For IPython.testing.globalipapp
2619
IPython.install_dependency("mock"; force=true)
2720
end
21+
22+
# Build PyCall again, since above installation could have changed
23+
# Python versions.
24+
Pkg.build("PyCall")
25+
26+
if VERSION >= v"0.7.0-"
27+
@info "PyCall/deps/build.log:"
28+
print(read(
29+
joinpath(dirname(dirname(pathof(IPython.PyCall))), "deps", "build.log"),
30+
String))
31+
end

test/runtests.jl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
# module TestIPython
22

33
if lowercase(get(ENV, "CI", "false")) == "true"
4-
include("install_dependencies.jl")
4+
let
5+
if VERSION < v"0.7.0-"
6+
setup_code = ""
7+
else
8+
setup_code = Base.load_path_setup_code()
9+
end
10+
path = joinpath(@__DIR__, "install_dependencies.jl")
11+
code = """
12+
$setup_code
13+
include("$(escape_string(path))")
14+
"""
15+
run(`$(Base.julia_cmd()) -e $code`)
16+
# Run install_dependencies.jl in a separate process since it
17+
# may re-build PyCall. In that case, we need to load
18+
# re-precompiled PyCall and IPython.
19+
end
520
end
621

722
include("preamble.jl")

0 commit comments

Comments
 (0)