Julia version dependency of a dependency

I created a package that I initially thought would work with Julia 1.0. When a student of mine installed it, he got an error, because a dependency of it (ThreadPools, specifically), required Julia 1.3.

I then updated the dependencies of my package to require Julia 1.3, but for that I had to find out which was the version of Julia of every dependency depended on.

Is there a way to handle this automatically?

1 Like

An error on Pkg.add I presume? Then all is well – that error, while cryptic, should say that there is no combination of packages that work with the running Julia version.

I don’t quite understand what you mean by

2 Likes

Let me try to be more clear:

  1. Yes, the error was correct. He was trying to install my package on Julia 1.1, but a dependency required Julia 1.3

  2. What I mean is that, when setting up the dependencies of my package, I didn’t know that one of the packages I was using depended on Julia 1.3. Therefore, I put for my package that it depends on Julia 1.0.

  3. I think that if my package depends on a package which by itself depends on Julia 1.3, my package depends on Julia 1.3, right? Thus, I would like to know that in advance, in particular to add that to the documentation. However, I do not know how to find that out without going into the Project.toml files of very dependency to check which Julia version they are requiring.

Thanks.
Leandro.

Right. The same error would happen if your package required 1.3 too.

Yea okay. But as far as the code in your package goes it supports 1.0. So in theory, if the problematic dependencies made an update to allow e.g. Julia 1.0 your package would work. In practice I don’t think that happens often though.

Yea, implicitly it does (for the current state of releases at least). So if you know your dependencies will never work on Julia < 1.3 you can just as well put that for your package too, but not required.

The easiest is probably to just test with multiple Julia versions. For example, if you test the package on 1.3, 1.4, etc you cat put that in the docs, with a disclaimer that it “might work on other versions but you have not tested it” or something.

3 Likes

Yes, that is a good point.

Yet it would be nice to be warned of that kind of dependency before releasing the package.

Thank you.