-
Couldn't load subscription status.
- Fork 95
Description
This is the outcome of a discussion I had with @KristofferC about how to make glue packages work.
We should put it into practice for SpecialFunctions.jl and NaNMath.jl
We make a new package called:
ChainRules_SpecialFunctions_Glue.jl
which has the released with compat on SpecialFunctions.jl declared
then in ChainRules.jl we would declare a dependency NOT on SpecialFunctions
but on ChainRules_SpecialFunctions_Glue.jl
and then in the source code of ChainRules.jl would do:
@require SpecialFunctions="276daf66-3868-5448-9aa4-cd146d93841b" begin
using ChainRules_SpecialFunctions_Glue # maybe use `Base.require` instead
endSo ChainRules.jl never has a direct dependency on SpecialFunctions.jl
only on ChainRules_SpecialFunctions_Glue.jl.
But ChainRules.jl does use Require to conditionally load ChainRules_SpecialFunctions_Glue.jl in response to SpecialFunction.jl being loaded.
and ChainRules_SpecialFunctions_Glue.jl does have a direct dependency on SpecialFunctions.jl (and on ChainRulesCore.jl), and it declares constraints on it
so the pakcage manager can workout which should be loaded.
In pacticular, ChainRules_SpecialFunctions_Glue.jl would not support both SpecialFunctions.jl v0.7 and v0.8 at the same time.
Rather ChainRules_SpecialFunctions_Glue.jl v1.0.0 would support SpecialFunctions.jl v0.7
and ChainRules_SpecialFunctions_Glue.jl v1.1.0 would support SpecialFunctions.jl v0.8
And ChainRules.jl would support ChainRules_SpecialFunctions_Glue.jl 1.x.y
TL; DR:
you use Requires on the Other package, to load the Glue
and you put the Glue package in your dependencies