/
build.jl
28 lines (23 loc) · 827 Bytes
/
build.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using PyCall
println("Running build.jl for the Spectra package.")
# Change that to whatever packages you need.
const PACKAGES = ["gcvspline"]
# Use eventual proxy info
proxy_arg=String[]
if haskey(ENV, "http_proxy")
push!(proxy_arg, "--proxy")
push!(proxy_arg, ENV["http_proxy"])
end
# Import pip
try
@pyimport pip
catch
# If it is not found, install it
println("Pip not found on your system. Downloading it.")
get_pip = joinpath(dirname(@__FILE__), "get-pip.py")
download("https://bootstrap.pypa.io/get-pip.py", get_pip)
run(`$(PyCall.python) $(proxy_arg) $get_pip --user`)
end
println("Installing required python packages using pip")
run(`$(PyCall.python) $(proxy_arg) -m pip install --user --upgrade pip setuptools`)
run(`$(PyCall.python) $(proxy_arg) -m pip install --user $(PACKAGES)`)