Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg REPL compatibility bounds #341

Closed
staticfloat opened this issue Jun 5, 2018 · 6 comments
Closed

Pkg REPL compatibility bounds #341

staticfloat opened this issue Jun 5, 2018 · 6 comments

Comments

@staticfloat
Copy link
Member

We need a way to specify compatibility bounds when adding packages, interactively through the REPL mode. I'm thinking something like pkg> add Compat@[0.55.0+], or perhaps pkg> add Compat followed by pkg> restrict Compat 0.55.0-0.66.0

What do you guys think?

@KristofferC
Copy link
Member

KristofferC commented Jun 5, 2018

You can already do something like

(Foo) pkg> add [email protected]
  Updating registry at `~/.julia/registries/Uncurated`
  Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
 Resolving package versions...
  Updating `Project.toml`
  [34da2185] + Compat v0.55.2

Perhaps that should also put Compat = "0.55" into the compatibility section?

@KristofferC
Copy link
Member

Should probably show the compatibility bounds in the status output as well

@staticfloat
Copy link
Member Author

Maybe we should allow “add [email protected]“ to set a lower bound, as that’s the most common use case. Maybe go whole hog and allow “add [email protected]

@StefanKarpinski
Copy link
Member

Compat = "0.55" in the compatibility section means Compat = "^0.55.0".

@oxinabox
Copy link
Contributor

I propose that the API for this be based around the versions of packages currently being used in the Manifest.
This would be partnered with #1607 which would allow things to ignore the current compat settings.

For sake of example, lets call this function write_compat
And it will take options:

  • extend::Bool which if true (default?) will add the compatibility to what is already there, and if false will clear all current compat sections and just write what you have to be there.
  • specificy being one of ^, ~, ==, <=, >=, etc (with ^ being the default), which controls what restrictor is written.
  • packages (optional) which packages to include. Defaults to all packages in Project.toml

So if I just created a new project for some data science I might do:

pkg"add CSV, DataFrames, Plots"
write_compat()

which will give me a Project.toml withat has those packages and normal (carat) bound to the current versions. Which is what i normally do when I start a new project.

If I want to later restrict to also support a newly released CSV v0.6 I would do:

pkg"add [email protected] --ignore-compat"
write_compat("CSV")

pkg"resolve"  # make sure that we no longer are needing to `--ignore-compat`

If I became paranoid about thing breaking, and i wanted to lock all the versions down to what i know currently works.

write_compat(extend=false, restriction= ==)

This API wouldn't do everything, in particular some things would be much easier going into Project.toml to do, like removing compat for an old version of something.

But I think it would nicely handle a lot of common use-cases, and while nontraditional, would be more useful than something that basically just replaces edits to a text file with commands that use basically the same characters in the REPL.

@IanButterworth
Copy link
Member

Introduced in #2702

If anyone's been using it, it would be good to get feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants