Location of package wrt test script

I want to develop a private package (for a few years before releasing it on github). I was wondering what the best workflow is. I checked workflow, I understand what it says except that it does not mention where the Tmp.jl file should be.

Here is what my code structure looks like. I am in $HOME

 |- src/
     |- Bajaboost.jl (include()s the rest.jl, to give the Bajaboost module)
     |- rest.jl
 |- testbaja.ipynb

testbaja.ipynb is a jupyter notebook, where I would say

# Cell 1
import Bajaboost

# Cell 2
    # make calls

# Cell 3

# Go up to Cell 2 and repeat

I get an error

ArgumentError: Module Bajaboost not found in current path.
Run `Pkg.add("Bajaboost")` to install the Bajaboost package.

Where is julia looking for the package to import? I want to approximately maintain the directory structure mentioned above, since that will be my private repo. Thanks.

You can use LOAD_PATH for this. See under modules in the manual. To supplement that section: if you have in your .juliarc.jl file:

push!(LOAD_PATH, expanduser("~/julia-local"))

then Bajaboost.jl/ should be a subdirectory of $(HOME)/julia-local.

1 Like

For a local workflow, you may also be interested in

Note that Pkg3 will obviate the need for the first one soon.

1 Like

Another trick is to create a symbolic link from your local directory to the package directory, something like

ln -s ~/Bajaboost.jl ~/.julia/v0.6/Bajaboost

Does this soft-linking trick work on v0.7, v1.0 ?

For v0.7+, just use

pkg> dev path/to/package