Resolving a custom REQUIRE when calling julia

I am wondering if there’s a standard-ish way of having a custom REQUIRE file when calling a script. The behaviour I’m after is how Pkg.test() handles test/REQUIRE.

The use case I have in mind is when using Documenter to build the docs, docs/make.jl has additional depenencies (Documenter itself and possibly more). Handling of additional deps could be done within Documenter in principle, but you always need to have Documenter installed first (which is usually done on separate command in .travis.yml right now). It would be neat if you could have a single docs/REQUIRE file which would automagically handled.

If there’s no good way of doing this right now then maybe an additional option to the julia binary could be an option? E.g.:

julia --require=docs/REQUIRE docs/make.jl

As I mentioned, the behaviour should be the same as when you run the tests, so

julia --require=test/REQUIRE test/runtests.jl

should basically be equivalent to calling Pkg.test().

1 Like

It would be great to handle REQUIRE files in docs as well. For consistency, test/REQUIRE and docs/REQUIRE could exploit the same solution. I am currently adding packages manually in docs/make.jl.