I found that a rather short function I use in the unit tests of a package would be useful somewhere else. If I don’t want to make a separate package for it, is it possible to put it in a separate module in the same package?
Simply putting it in src/MiniModule.jl in the same package does not make using MiniModule find it it.
I’m really hoping to see this feature before 1.0; I don’t think having to use a separate git repository for every chunk of code that forms a standalone module is really scalable for huge projects.
Sorry for necroing this thread, but I assume that those who replied may be interested.
I think found a Pkg3-compatible solution. Let’s call the package ThePackage and the auxiliary module AuxModule.
Have the auxiliary module in a subdirectory of the main project, eg assets/AuxModule/src/AuxModule.jl.
pkg> activate the main project.
pkg> dev ./assets/AuxModule. This will generate an UUID for it, even if there is no Project.toml file in assets/AuxModule.
Then it appears that when the package is activated again, using AuxModule etc will work fine. One just needs to make sure that the project was activated.
This solves my problem, but I am unsure if it is something I can count on to keep working, or an abuse of the Pkg3 setup. Comments welcome.
Did a “generate”, got a uuid, and all seems to be well. The Manifest.toml says exactly the right thing. However, if I put the Manifest.toml on github, will that break CI?
It seems to be trickier than that. When I try to get the AuxModule to load from a notebook, IJulia can’t find it. Nor does it work in the REPL after a restart of Julia.