Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use same ApproximateGPs version for docs and examples #106

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
9 changes: 6 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
using ApproximateGPs

### Process examples
# Always rerun examples
const EXAMPLES_OUT = joinpath(@__DIR__, "src", "examples")
ispath(EXAMPLES_OUT) && rm(EXAMPLES_OUT; recursive=true)
mkpath(EXAMPLES_OUT)

# Obtain path of ApproximateGPs so we can run examples with the same version
const PATH_ApproximateGPs = pkgdir(ApproximateGPs)

devmotion marked this conversation as resolved.
Show resolved Hide resolved
# Install and precompile all packages
# Workaround for https://github.com/JuliaLang/Pkg.jl/issues/2219
examples = filter!(isdir, readdir(joinpath(@__DIR__, "..", "examples"); join=true))
let script = "using Pkg; Pkg.activate(ARGS[1]); Pkg.instantiate()"
let script = "using Pkg; Pkg.activate(ARGS[1]); Pkg.develop(PackageSpec(; path=relpath(\"$PATH_ApproximateGPs\", pwd()))); Pkg.instantiate()"
devmotion marked this conversation as resolved.
Show resolved Hide resolved
for example in examples
if !success(`$(Base.julia_cmd()) -e $script $example`)
error(
Expand Down Expand Up @@ -39,8 +44,6 @@ isempty(processes) || success(processes) || error("some examples were not run su
### Build documentation
using Documenter

using ApproximateGPs

# Doctest setup
DocMeta.setdocmeta!(
ApproximateGPs,
Expand Down