[POC] Selectively override compat entries #2285
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a proof-of-concept (POC) of a feature that allows users to selectively override
[compat]
entries.This is only a POC. If someone wants to develop this feature further, you are welcome to take this code as a starting point. In order to flesh this out into a full pull request, you will need to:
~/.julia/config/compat-overrides.toml
file is a very good interface.)The documentation of this feature should include a warning of the following form:
Motivation
Suppose that you want to use two packages
PkgA
andPkgB
in the same environment.PkgB
is a direct dependency ofPkgA
, andPkgA
has a[compat]
entry forPkgB
that looks like this:Now,
PkgB
releases version 2.0.0. You would like to usePkgA
andPkgB v2.0.0
in the same environment. Unfortunately, becausePkgA
is not compatible withPkgB v2.0.0
, you cannot do so.This pull request will allow you to use
PkgA
andPkgB v2.0.0
in the same environment.Usage
Create a file at
~/.julia/config/compat-overrides.toml
that has entries that look like this:For example, suppose that the UUID of
PkgA
is00000000-0000-0000-0000-000000000001
, and the UUID ofPkgB
is321657f4-b219-11e9-178b-2701a2544e81
. And suppose that you want to usePkgA v5.6.7
andPkgB v2
. Your~/.julia/config/compat-overrides.toml
file might look like this:Related pull requests
[compat]
entries. When the user selects that option, all[compat]
entries (except the[compat]
entries in your project) will be ignored. This is useful if you want to ignore all[compat]
entries and just get the latest versions of everything. However, it does not allow you to only ignore some[compat]
entries while preserving all other[compat]
entries. In contrast, this pull request allows you to select which[compat]
entries you want to override.Example
In this example, we will use the following packages:
First, observe that MLJModelInterface v0.2.7 is not compatible with ScientificTypes v1:
Next, create a new file at
~/.julia/config/compat-overrides.toml
with the following contents:Now, we try again to add MLJModelInterface v0.2.7 and ScientificTypes v1 into the same environment, and this time it works: