From 14aab392b54b1a0fa17835027f41cea81d482b84 Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Sat, 12 Feb 2022 20:55:58 -0500 Subject: [PATCH] Optionally store deps.jl in a different directory --- deps/build.jl | 4 +++- src/startup.jl | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/deps/build.jl b/deps/build.jl index 4dd63826..8b20aebf 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -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))" diff --git a/src/startup.jl b/src/startup.jl index d208040c..d2b888b5 100644 --- a/src/startup.jl +++ b/src/startup.jl @@ -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