Required dependencies for extensions

I am making a package with functionality which can be nicely visualized with GraphVis, so GraphVis is additional dependency that is not strictly required for the package itself.

I am looking how to provide user experience that if you work with it in IDE then you will have access to visualization “out of the box”

I was thinking to make an extension that depends on presence of VSCodeServer package, but then I need a following logic of package loading:

if VSCodeServer
  require GraphVis
end
require OtherDeps

Note that if VSCodeServer is not available then GraphVis shall not be required too.
Is it possible to make such with Package Extensions or is there other way to achieve that?

1 Like

No, currently package extensions cannot have their own dependencies. They are really just intended for providing extra glue/compatibility between sets of packages.

You could make a GraphViz extension providing these extra visualisations, plus maybe a GraphViz+VSCodeServer extension adding the specific IDE integration. Anyone wanting this functionality would just need to install GraphViz themselves.

2 Likes

Relevant issue: Dependencies of an Extension · Issue #3641 · JuliaLang/Pkg.jl

I think this explains and links to discussions over the difficulties Understanding dependencies of packages extensions - General Usage - Julia Programming Language

1 Like