TravisCI build with Python deps

If you put setups in .travis.yml, you’ll have trouble with CIBot when registering the package (see The current METADATA release process). Maybe put something like this in your deps/build.jl (untested):

using Pkg

if lowercase(get(ENV, "CI", "false")) == "true"
    let basepython = get(ENV, "PYTHON", "python")
        envpath = joinpath(@__DIR__, "env")
        run(`virtualenv --python=$basepython $envpath`)

        if Sys.iswindows()
            python = joinpath(envpath, "Scripts", "python.exe")
        else
            python = joinpath(envpath, "bin", "python")
        end
        run(`$python -m pip install basemap`)

        ENV["PYTHON"] = python
        Pkg.build("PyCall")
    end
end

It’s a bit ugly to build PyCall again in your build process, but you can’t avoid it if you want to change Python path.

2 Likes