What is the expected behavior for metapackages?

Wherein I attempt to install StatsKit:

(@v1.4) pkg> add StatsKit
   Updating registry at `C:\Users\alanc\.julia\registries\General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
  Installed Loess ─────────────────────── v0.5.1
  ...
  Installed GLM ───────────────────────── v1.3.9
  ...
  Installed CSV ───────────────────────── v0.6.2
   Updating `C:\Users\alanc\.julia\environments\v1.4\Project.toml`
  [2cb19f9e] + StatsKit v0.3.0
   Updating `C:\Users\alanc\.julia\environments\v1.4\Manifest.toml`
  [4fba245c] + ArrayInterface v2.8.7
  ...
  [38e38edf] + GLM v1.3.9
  ...
  [efce3f68] + WoodburyMatrices v0.5.2

julia> using GLM
ERROR: ArgumentError: Package GLM not found in current path:
- Run `import Pkg; Pkg.add("GLM")` to install the GLM package.

Well, ok, it’s a metapackage, maybe I have to load it first:

julia> using StatsKit
[ Info: Precompiling StatsKit [2cb19f9e-ec4d-5c53-8573-a4542a68d3f0]

julia> using Loess
ERROR: ArgumentError: Package Loess not found in current path:
- Run `import Pkg; Pkg.add("Loess")` to install the Loess package.

What gives? Why did I just install StatsKit, and where did those packages go?

It looks like StatsKit already re-exports every exported symbol from all of those packages, so can you just do:

using StatsKit

mean([1, 2, 3])  # re-exported from Statistics by StatsKit

?

You should also be able to do using StatsKit.GLM to access the exact GLM provided by StatsKit.

1 Like

I see, so they become submodules (and everything is re-exported as necessary). I was thinking it would be a convenient way to install a bunch of stats-related packages and have them available at the “top level” of the environment, so that I could do using GLM or using Loess or whatever. Is this typical of a metapackage?