Skip to content

Commit 14aab39

Browse files
committed
Optionally store deps.jl in a different directory
1 parent c77c20a commit 14aab39

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

deps/build.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ try # make sure deps.jl file is removed on error
9999
error("Python 2.7 or later is required for PyCall")
100100
end
101101

102-
writeifchanged("deps.jl", """
102+
dep_path = get(ENV, "PYCALL_DEPOT", "")
103+
104+
writeifchanged(joinpath(dep_path, "deps.jl"), """
103105
const python = "$(escape_string(python))"
104106
const libpython = "$(escape_string(libpy_name))"
105107
const pyprogramname = "$(escape_string(programname))"

src/startup.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ end
4040

4141
if !symbols_present
4242
# Python not present. Use deps.jl
43-
const depfile = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
43+
const depfile =
44+
if haskey(ENV, "PYCALL_DEPOT")
45+
joinpath(ENV["PYCALL_DEPOT"], "deps.jl")
46+
else
47+
joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")
48+
end
4449
isfile(depfile) || error("PyCall not properly installed. Please run Pkg.build(\"PyCall\")")
4550
include(depfile) # generated by Pkg.build("PyCall")
4651
# Only to be used at top-level - pointer will be invalid after reload

0 commit comments

Comments
 (0)