Open kthayashi opened 5 months ago
I was wondering if this is unexpected behavior, or if this is simply a case where "Updates will only be checked from the same source" actually means CRAN (or CRAN-like repo) vs. GitHub with no way to distinguish between different sources in getOption("repos").
Right, the intention was the latter -- for packages installed from a CRAN-like repository, any available CRAN-like repository will be considered a candidate when checking for updates. It seems reasonable to restrict this in certain scenarios, though -- it might take some thought to figure out how to best make that work.
Thank you for the clarification! I agree that it could be useful to track individual repos for updates, or at least restrict updates to certain repos. In the example above, it would be convenient if only CRAN packages could be updated without having to manually specify packages
or exclude
.
I've found that
renv::update()
does not respect the recorded source repository for packages that have different versions available in different repos. I've prepared the following minimal reproducible example (https://github.com/kthayashi/stan-renv-reprex) to demonstrate this:For this example, let's say that I'm working with three packages that are distributed as follows:
brms
: release version on CRANloo
: release version on CRAN + development version on R-Universecmdstanr
: release version on R-UniverseSome of these packages have dependencies (e.g.
bayesplot
) that also have the same distribution mode asloo
. I would like to use release versions when possible, so I installbrms
andcmdstanr
from CRAN and R-Universe, respectively. And let's say that I need a feature in the development version ofloo
, so I installloo
from R-Universe.renv
version:Repo configuration:
Excerpts from
renv.lock
:Based on the description for
renv::update()
, I expected packages installed from CRAN (with"Repository": "CRAN"
in itsrenv.lock
entry) will be updated according to the version available on CRAN:However,
renv::update()
attempts to update packages to the newest version across all repos:All the items listed under
Stan
here were initially installed from CRAN and recorded inrenv.lock
as such, butrenv::update()
attempts to replace these with development versions from R-Universe. I was wondering if this is unexpected behavior, or if this is simply a case where "Updates will only be checked from the same source" actually means CRAN (or CRAN-like repo) vs. GitHub with no way to distinguish between different sources ingetOption("repos")
.