Can someone please explain the difference between Pkg.activate vs Base.set_active_project from a practical perspective? I looked at the source and they do slightly different things (besides setting Base.ACTIVE_PROJECT[]).
I want to do the following:
- given a local path, which should default to the active project,
- activate that project,
- (ideally, check that it is a package, not
test/or a similar subproject, but I can skip that), - run tests, collect coverage,
- activate the previous project.
All of this with a try ... finally to do step 6. if anything fails.
It is unclear which entry functions one should use for this, because they have different effects (eg dealing with Base.active_project_callbacks). Surprisingly, the Pkg.activate(::Function, ::AbstractString) is the most barebones.
[FWIW, I am revamping the API of LocalCoverage.jl ]