Hi all. After having used Python extensively for the last 4-5 years, I am now switching to Julia both out of interest and for performance reasons. I am now actively learning to master the REPL-focused Julia development cycle. Development is made much faster and enjoyable using Revise.jl
, however I find that my current workflow does not integrate well with Revise.jl
and that I need to work on package development instead.
The project
I have a project, as a Git repository, with the following tree
structure
ProjectName/
βββ README.md
βββ src
β βββ MainModule.jl
β βββ Submodule.jl
βββ docs
β βββ make.jl
β βββ src
β βββ index.md
βββ examples
β βββ README.md
β βββ example.jl
βββ tests
βββ test.jl
File contents of Submodule.jl
are, for example:
module Submodule
export AnotherFunction
function AnotherFunction()
println("This is another function")
end
end # End module
File contents of MainModule.jl are, for example:
module MainModule
include("Submodule.jl")
using .Submodule
export SomeFunction
function SomeFunction()
println("This is a function")
Submodule.AnotherFunction()
end
end # End module
The problem
The problem is that changes in Submodule.jl
are not tracked when using Revise.jl
julia> using Revise
julia> includet("MainModule.jl"); using .MainModule
Reading different topics (both here and on, e.g., StackExchange) recommend that instead of using the includet()
command I switch to making MainModule
a package instead. While most examples using PkgTemplates.jl
, PkgSkeleton
, or even the standard [Pkg.jl
] all work fine, I cannot seem to figure out how to add Submodule
to the package. Most examples out there also do not include the inclusion of separate Julia files (like Submodule.jl
in this case).
I highly prefer to not make Submodule
a separate package such that it can be imported, but I do need Revise.jl
to track changes in Submodule.jl
.
Question
How do I make a bare-bones package that allows Revise.jl
to track all included files as well?
- If possible, I prefer the βPackageβ to be as bare bones as possible. I do not want automated Git workflow (I do this myself), I do not (yet) want to publish the package to the Julia repository, etc. I only want
Revise.jl
to track all included files. - Is there a change in mindset that I have to undergo? Should I always aim to develop packages that have to be pushed to the main Julia repository such that others can use it as well? Should I let the Julia package manager handle my Git workflow? Or is there something else I am not seeing at the moment?
- What specific commands do I need to run (in the Julia REPL) to use and develop my
MainModule
?
Thank you for all the help you can offer.