What is the preferred/recommended workflow for developing/maintaining packages, in terms of interaction between developing code in an editor, julia-0.7, and testing the package.
I am used to having a package Mymodule I am working on somewhere in .../work/julia/Mymodule.jl
Before julia-0.7, the lines
include("src/Mymodule")
using Mymodule
would make sure I was using the most recently edited code. But with 0.7, and the new package manager, an older version of the package stored somewhere under ~/.julia always gets the precedence over my current working directory.
Even when I try to add the package using
pkg> add ../Mymodule.jl
pkg> update
using Mymodule
I still seem to be exposed to the old version, but this is probably because I don’t understand the new package manager.
Is there a way I can have quick access to the newly edited code without checking code in and adding to the package manager?
This is a job for pkg> develop. develop (or dev in short) will track a local path. For example, I have the Example package locally in ~/dev/Example, so I can dev the path:
(v1) pkg> dev ~/dev/Example
Resolving package versions...
Updating `~/.julia/environments/v1.1/Project.toml`
[7876af07] + Example v0.5.1+ [`~/dev/Example`]
Note that in the status output we see a path ([~/dev/Example]) which we are now tracking, meaning that changes you do to the code there will be picked up.
pkg> add in contrast, takes a snapshot of the git repository from the path, and stores that internally in .julia/packages/.... The difference is that this code will not change when you change the code where you originally had the package (unless you commit and update etc). Cf the output when adding a path:
For my own reference, because I spent another hour or so figuring this out again, until I stumbled upon my own question (I seem to be pretty stubborn, forgetful and stupid):
If you feel like the docs could be improved, please make a PR! The people using the language most extensively often don’t/can’t see where it could be improved, since they’re already very familiar with how it all works. Since you’ve experienced the problem first hand, you’re also the most knowledgable about what is missing
I am sorry. I would love to submit a PR for documentation, but then I would need to understand things first. For some reason that is too hard for me. I am still regularly lost in the julia-1.0 package loading system, so that I keep switching back to julia-0.6, where for some reason it is easier for me to figure out what is going on.