Install packages for general use in global namespace, such as Revise, BenchmarkTools etc.
In your run script (NOT module!) put using Revise
Now, if you are in the project folder and have activated environment, by ] activate . or similar, then when you do changes in a submodule of your using MyPackage, these are propagated through the using Revise and you do not have to restart Julia terminal.
You need to make sure the project name matches using MyPackage I think, not sure.
Now I don’t have to do that really annoying workflow above
Note that there is a Revise.includet that allows you to reload a file when it changes. The final t is not a typo. This is usually useful when you are trying to develop code outside of the context of a package. Otherwise, it seems like you mostly figured it out.
It is because I am working on my package and in the test script I do; using MyPackage - then now because I have using Revise at the top of the test script, when I do changes inside of MyPackage in the local code it propagates correctly and I do not need to restart Julia.
Wish I had understood earlier that Revise also works with packages, hopefully it helps someone in the future
This will work, but personally I don’t like the idea of putting using Revise in your run script (ideally your run script should only be using packages that are in its Project.toml). I would recommend doing one of the following:
Simply write using Revise in the REPL before the first time that you include your run script in every new Julia session
Add the line using Revise to your ~/.julia/config/startup.jl file
Do like me, add the following line to your ~/.bashrc or similar:
alias j='julia -i -e "using Revise"'
which will start Julia with Revise preloaded when you use the command j on the command line. If you use Windows, then I think that you would need to write a .bat script to achieve something like this.
Finally, I just want to make sure that you are aware of Julias built in Unit test framework which would normally be a good supplement or replacement for your run script.