How can an user load a package extension?

Sorry I thought that this is rather clear in the documentation you linked. First sentence

A package “extension” is a module that is automatically loaded when a specified set of other packages (its “extension dependencies”) are loaded in the current Julia session.

So you never load a package extension manually. Package extensions are loaded automagically if the user adds the corresponding packages to the environment. So in your case, the extension is loaded if and only if the user added both Compose.jl and GraphPlot.jl to the environment either as a direct dependency (i.e. using Pkg.add) or indirectly by Pkg.adding packages that depend on Compose.jl and GraphPlot.jl. Note that the users also needs to load the load these other packages themselves in the current session to make the extension available.

Your usecase seems to not reflect this. So a package extension in the Julian sense is probably not what you want. It sounds more like you should just make a second, full package, e.g. RingStarProblemsPlotting.jl, that includes the functionality.

5 Likes