JuliaDiff / JuliaDiff/ChainRules.jl

Glue packages with working Pkg compat versioning

Open
#280 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
475
Forks
98
PR merge metrics
No merged PRs in 30d

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
    end

So 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing ChainRules.jl's dependency declarations and conditional loading with Requires. Define the separate ChainRules_SpecialFunctions_Glue.jl package for SpecialFunctions.jl and ChainRulesCore.jl, then account for the proposed SpecialFunctions 0.7 and 0.8 compatibility split and the analogous NaNMath.jl work. Done means ChainRules.jl depends on the glue package rather than SpecialFunctions.jl directly, with the glue loaded when SpecialFunctions.jl is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.