Packages blocking each other - strange case with DataFrames and PlotlyJS

On a fresh 1.12.7 install, I am seeing this:

  • If I add DataFrames first and then PlotlyJS, I get DataFrames 1.8.2 and PlotlyJS 0.15.0 (which is not up-to-date)
  • If I add PlotlyJS and then DataFrames, I get PlotlyJS 0.18.18 and DataFrames 1.8.2, both up-to-date

My understanding is that DataFrames adds OrderedCollections v2.0.1, while the most recent PlotlyJS wants OrderedCollections v1.8.2. I (sort of) understand that incompatibilities can arise, after reading some documentation and this blog post by Bogumił Kamiński, but what I don’t understand is:

  • Why would an older version of PlotlyJS “tolerate” a more recent version of OrderedCollections, while that version is not OK for the most up-to-date PlotlyJS?
  • After adding DataFrames and then PlotlyJS, which is stuck at 0.15.0, I can force the installation of PlotlyJS 0.18.18. This downgrades OrderedCollections to 1.8.2 and results in exactly the same Manifest.toml file as the one resulting from installing PlotlyJS first. Why isn’t the Package Manager trying to do that by itself?

This pretty much says it all. You have (a reasonable) expectation that the environment resolves to the most updated packages, but the project leads to several possible compromises instead of one objective solution. You might instead be saying that the resolver should prioritize the most updated direct dependencies, but that’s not justified in the general case where they could be less important than the indirect ones. I wouldn’t expect serious issues from unversioned add-s because reputable developers are usually very careful about [compat] bounds, but we are expected to do extra work when we need it, maybe even as far as specifying our own [compat] bounds.

Thank you. I think I see the kind of compromise you mention, but the question that still puzzles me is “surely, if PlotlyJS 0.15.0 works with a recent package (OrderedCollections v1.8.2), a more recent PlotlyJS 0.18.18 should also work with that package, right?”.
But I suspect the answer is more complicated than I think, so I can live with that mystery and keep enjoying Julia…

It’s just as possible that PlotlyJS 0.15 didn’t depend on OrderedCollections at any level, let alone need to restrict it, and a later release started depending on less updated versions of OrderedCollections on some level. The more dependencies are involved, the more likely their versions start to run into each other.

Ah yes, I didn’t think of that, no dependency means “any version is accepted”. That is indeed one possible explanation for my “mystery”, thanks!