remotes icon indicating copy to clipboard operation
remotes copied to clipboard

Option: upgrade dependencies only when necessary

Open kenahoo opened this issue 5 years ago • 4 comments

For remote's package installation functions, the options for upgrade are these:

One of "ask", "always" or "never". "ask" prompts the user for which out of date packages to upgrade. For non-interactive sessions "ask" is equivalent to "always". TRUE and FALSE are also accepted and correspond to "always" and "never" respectively.

Sometimes another option is desirable: only upgrade packages which are necessary to satisfy the dependencies' version criteria in the DESCRIPTION file. For production environments that we don't want to change without a good reason, this would give us a lot more stability when we install a new package or upgrade a package.

I think this would be more consistent with other package solvers too, e.g. OS-level package managers like yum.

As a first step, if a full package solver isn't available, then it would seem relatively easy to just omit any top-level dependency that already satisfies the criteria in DESCRIPTION, not worrying about any deep interactions.

Please see also my PR #305 for some functions that might be handy for doing the criteria checking.

kenahoo avatar Apr 11 '19 21:04 kenahoo

I would suggest you use pak if you want this, it does use a solver to upgrade only what is needed to fulfill the requirements. We have no plans to add this functionality to remotes.

jimhester avatar Apr 11 '19 21:04 jimhester

Okay, thanks for the pointer. I'll check out pak - on first usage I'm getting some errors that I'll report in that project.

kenahoo avatar Apr 12 '19 03:04 kenahoo

Hi @jimhester , this is an old thread, but I've been watching pak and it looks like it's kind of stalled out. The last release of it to CRAN was a year and 4 months ago, and it's been a few months since the pak code itself had commits on gitlab.

Even if pak isn't dead, it does seem like it'll be a while before it's widely adopted and stable, whereas devtools/remotes is way farther along.

What I was asking for in this ticket would be a simple addition and I'm willing to write the code for a pull request, would you be willing to review it?

kenahoo avatar Jun 04 '20 16:06 kenahoo

I do not believe it would be a simple addition and I think it is out of scope for remotes, which is really a wrapper around install.packages(), which does not support this behavior.

jimhester avatar Jun 05 '20 15:06 jimhester