Skip to content

Commit

Permalink
Optionally store deps.jl in a different directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre committed Feb 13, 2022
1 parent c77c20a commit 14aab39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ try # make sure deps.jl file is removed on error
error("Python 2.7 or later is required for PyCall")
end

writeifchanged("deps.jl", """
dep_path = get(ENV, "PYCALL_DEPOT", "")

writeifchanged(joinpath(dep_path, "deps.jl"), """
const python = "$(escape_string(python))"
const libpython = "$(escape_string(libpy_name))"
const pyprogramname = "$(escape_string(programname))"
Expand Down
7 changes: 6 additions & 1 deletion src/startup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ end

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

0 comments on commit 14aab39

Please sign in to comment.