Closed kevinushey closed 8 months ago
@kevinushey am I correct in thinking that, if using a vendored version of {renv}, non-exported functions can be made available without calling from namespace?
Are there other exported ways to get a lockfile as an R object?
@kevinushey am I correct in thinking that, if using a vendored version of {renv}, non-exported functions can be made available without calling from namespace?
Yep, that's right.
Are there other exported ways to get a lockfile as an R object?
If you want to create a lockfile, you can use renv::snapshot(lockfile = NULL)
to get the generated lockfile as an R list; alternatively, if you're using renv 1.0.0, you can use functions like lockfile_read()
and lockfile_modify()
to read and edit a lockfile.
Great! And is there a way to generate a lockfile without 1) vendoring {renv} and 2) creating a project level package store. My understanding is no, vendor it like how its done in vetiver.
Do you mean, create an empty lockfile? You could do something similar with e.g.
lockfile_create(project = tempdir(), libpaths = character())
That is, create a lockfile without actually providing any library paths to use.
the use of vendor could be a good way to deal with : https://github.com/ThinkR-open/dockerfiler/issues/64 too ..
done.
I opted for the in-house version of renv. It wasn't straightforward, but it's great
Right now, dockerfiler is using this unexported function:
https://github.com/ThinkR-open/dockerfiler/blob/e40f804e9728afb9bb5a8c52d965c9ac4a8fd58a/R/dock_from_renv.R#L59
However, we're planning to remove this in a future
renv
release, and instead provide some helper functions of the formlockfile_*
to interact with a lockfile. We'll plan to keep this function available for dockerfiler, but would dockerfiler be able to adapt to this change as well?Note that if you want to depend on
renv
internals, you can also explicitly vendor renv in your project -- see https://rstudio.github.io/renv/reference/vendor.html?q=vendor#null for more details.