JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
625 stars 267 forks source link

[docs] document indirect conditional loading #3348

Open CarloLucibello opened 1 year ago

CarloLucibello commented 1 year ago

Say that my Plotting package has a ContourExt extension:

name = "Plotting"

[weakdeps]
Contour = "d38c429a-6771-53c6-b99e-75d170b6e991"

[extensions]
ContourExt = "Contour"

but then in my code I never import Contour directly but only some package PkgUsingContour that depends on Contour. So I wonder if after

using PkgUsingContour, Plotting

the ContourExt extension is available. In any case, this behavior could be documented more clearly in the docs.

KristofferC commented 1 year ago

Yes, no matter how the weak dependency is loaded, the extension will be loaded (at least if it is loaded from the same environment).

CarloLucibello commented 1 year ago

Very nice, that is the behavior I was hoping for. Since the term "loaded package" is used in describing extensions, we could add a corresponding definition in the Glossary section?