Code: Add [compat] to Project.toml

Issue #7 resolved
Andy Nowacki created an issue

Add a [compat] section to Project.toml, giving bounds on package compatibility.

Comments (7)

  1. Andy Nowacki reporter

    I’d say this is a minimum, but ideally you would state the compatible versions of your dependencies as well. This will be needed if you register the package and is good practice in any case.

  2. Andy Nowacki reporter

    Tiny nitpick, but do you need those patch releases? (I.e., is v0.24.2 of Distributions needed, and v0.24.0 is not enough?) I know it’s a pain to establish (and actually there isn’t great tooling for this), but ideally you want the lower bound to be the truly lowest version with which you are compatible. It seems a bit unlikely here that v0.24.2 is needed.

    One brute-force way to test this is to e.g. pkg> add Distributions@0.24.0 (and the same for your suspected lower bounds) and test your package.

    If this is too much hassle, it’s not a problem for me, but it does help avoid dependency issues for your users if you can specify genuine lower bounds (and upper!) on things.

  3. Andy Nowacki reporter

    I’m not sure how you did this, but in order to ‘brute-force’ check for lower compatibility, you would need to remove your [compat] section first. Your compat bounds don’t need to declare a mutually-compatible set of versions, just the bounds of each package’s API with which your own package is compatible.

    I did a quick check and all tests pass, for example, using FFTW v1.0.1, so your lower bound for FFTW should probably be ”1”, not ”1.2.4”. Likewise tests pass with FastGaussQuadrature v0.3, despite the change in pre-v1.0 minor version. So your version for FastGaussQuadrature should be ”0.3, 0.4” (and maybe even v0.2 works, I don’t know). Distributions v0.23 works fine. And so on.

    It’s not essential to get this exactly right, but it is kinder to the resolver to be as loose as possible (and I suppose, as literal as possible, in SemVer terms) with your compat bounds.

  4. Log in to comment