Automatic import of dependent packages

Suppose I develop a package named MyPkg. Also suppose the users of MyPkg must always use other packages PkgA and PkgB (e.g., a core function exported from MyPkg takes types defined in PkgA and PkgB). In that case, it will be convenient if PkgA and PkgB are automatically imported when the users import MyPkg.

Does Julia have such a capability? In other words, I wonder if there is a way to execute using PkgA, PkgB automatically in Main when the users execute using MyPkg in Main. Or, do I have to ask users to execute using MyPkg, PkgA, PkgB whenever they want to use MyPkg?

https://github.com/simonster/Reexport.jl

4 Likes