Support for test/dev/staging/prod deps environments in Pkg

I’ve been tweaking a lot with PackageCompiler this week and the issue which consistently broke all my attempts to use PackageCompiler is that the tests of the packages that PackageCompiler works with include dependencies which are not listed in the Project file of the packages themselves.

What I mean by that is, for instance, for Plots.jl, the tests will include extra packages which are not dependencies of Plots.jl. PackageCompiler attempts to precompile code by running the tests and it crashes when it can’t find these undeclared dependencies.

Now if we think about it, it makes total sense for the tests to use extra packages – which shouldn’t burden the package when used in production (test will need mock APIs, serialization-deserialization, extra logging, profiling, etc which are not needed in production).

Can we have deps per environments in the Project.toml file? Or what would be the recommended approach? Thanks

1 Like