bspm
bspm copied to clipboard
Add a mechanism to retrieve package versions
Use case: packages like renv
could ask bspm
what's available in the system repos to choose those preferentially if versions match.
For what it is worth, in r2u
I just use available.packages()
. (Some chin scratching ....) But I may misunderstand what you're after here.
What renv
does, basically, is:
- The lockfile says that
pkgA
vX.Y must be installed. -
renv
downloads cran.r-project.org/src/contrib/Archive/pkgA/pkgA_X.Y.tar.gz - installs it in the cache, and links it in the project repository.
And pak
is basically the same with more bells and whistles. With this feature, this could be possible:
- The lockfile says that
pkgA
vX.Y must be installed. -
renv
asksbspm
what version is available forpkgA
. This could be the latest one (it would normally be the latest one), but it could be an old one ifr2u
(orc2d4u4
, or whatever) is not up-to-date for some reason. Soavailable.packages
is not 100% reliable here. - If the version returned by
bspm
is X.Y, thenrenv
just callsbspm::install_sys("pkgA")
- and links it in the project repository.
Of course, if the version returned by bspm
is not X.Y, then renv
can proceed as usual.
So
available.packages
is not 100% reliable here.
You are correct. I use that on the building side to find what I could inject into r2u
. On the other side we could possibly use RcppAPT
:) but it is probably simpler to just ask apt
or dpkg
from Python.
Use case: packages like
renv
could askbspm
what's available in the system repos to choose those preferentially if versions match.
Another use case for having the R package versions available in the binary repos that bspm accesses, would be to have install.packages()
use the latest version. I was actually assuming this (eddelbuettel/r-ci#10)...